mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
reduce large links in branches and releases to small text with links.
Signed-off-by: M M Arif <mmarif@swatian.com>
This commit is contained in:
parent
e8e0cf904b
commit
b4c0745b40
@ -1,12 +1,13 @@
|
||||
package org.mian.gitnex.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.helpers.UrlHelper;
|
||||
import org.mian.gitnex.models.Branches;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.util.List;
|
||||
@ -66,7 +67,9 @@ public class BranchesAdapter extends RecyclerView.Adapter<BranchesAdapter.Branch
|
||||
holder.branchCommitAuthor.setText(mCtx.getResources().getString(R.string.commitAuthor, currentItem.getCommit().getAuthor().getUsername()));
|
||||
}
|
||||
|
||||
holder.branchCommitHash.setText(mCtx.getResources().getString(R.string.commitHash, "", currentItem.getCommit().getUrl()));
|
||||
holder.branchCommitHash.setText(
|
||||
Html.fromHtml("<a href='" + currentItem.getCommit().getUrl() + "'>" + mCtx.getResources().getString(R.string.commitLinkBranchesTab) + "</a> "));
|
||||
holder.branchCommitHash.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,8 @@ package org.mian.gitnex.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -139,8 +141,14 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
||||
else {
|
||||
holder.releaseDescription.setVisibility(View.GONE);
|
||||
}
|
||||
holder.releaseZipDownload.setText(currentItem.getZipball_url());
|
||||
holder.releaseTarDownload.setText(currentItem.getTarball_url());
|
||||
|
||||
holder.releaseZipDownload.setText(
|
||||
Html.fromHtml("<a href='" + currentItem.getZipball_url() + "'>" + mCtx.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> "));
|
||||
holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
holder.releaseTarDownload.setText(
|
||||
Html.fromHtml("<a href='" + currentItem.getTarball_url() + "'>" + mCtx.getResources().getString(R.string.tarArchiveDownloadReleasesTab) + "</a> "));
|
||||
holder.releaseTarDownload.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
}
|
||||
|
||||
|
@ -36,10 +36,8 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp"
|
||||
android:autoLink="web"
|
||||
android:textColorLink="@color/lightBlue"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -83,10 +83,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/releaseZip"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp"
|
||||
android:autoLink="web"
|
||||
android:textColorLink="@color/lightBlue"/>
|
||||
|
||||
<TextView
|
||||
@ -94,11 +92,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/releaseTar"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="16sp"
|
||||
android:autoLink="web"
|
||||
android:textColorLink="@color/lightBlue"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -404,6 +404,10 @@
|
||||
<string name="starMember">Star</string>
|
||||
<string name="watcherMember">Watcher</string>
|
||||
|
||||
<string name="commitLinkBranchesTab">Commit</string>
|
||||
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
|
||||
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
|
||||
|
||||
<!-- generic copy -->
|
||||
<string name="okButton">OK</string>
|
||||
<string name="doneButton">Fertig</string>
|
||||
|
@ -404,6 +404,10 @@
|
||||
<string name="starMember">Star</string>
|
||||
<string name="watcherMember">Watcher</string>
|
||||
|
||||
<string name="commitLinkBranchesTab">Commit</string>
|
||||
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
|
||||
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
|
||||
|
||||
<!-- generic copy -->
|
||||
<string name="okButton">OK</string>
|
||||
<string name="doneButton">Done</string>
|
||||
|
@ -404,6 +404,10 @@
|
||||
<string name="starMember">Star</string>
|
||||
<string name="watcherMember">Watcher</string>
|
||||
|
||||
<string name="commitLinkBranchesTab">Commit</string>
|
||||
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
|
||||
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
|
||||
|
||||
<!-- generic copy -->
|
||||
<string name="okButton">OK</string>
|
||||
<string name="doneButton">Готово</string>
|
||||
|
@ -441,6 +441,10 @@
|
||||
<string name="starMember">Star</string>
|
||||
<string name="watcherMember">Watcher</string>
|
||||
|
||||
<string name="commitLinkBranchesTab">Commit</string>
|
||||
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
|
||||
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
|
||||
|
||||
<!-- generic copy -->
|
||||
<string name="okButton">OK</string>
|
||||
<string name="doneButton">Done</string>
|
||||
|
Loading…
Reference in New Issue
Block a user