Improving design of "Repository Meta" (#362)

Merge branch 'master' into details-design

Always open "Repository Meta"

Fixing bugs.

Merge remote-tracking branch 'remotes/main/master' into details-design

Typo removal.

Do not show pull requests when API returns null.

Replacing size by watchers

Removing unused imports.

Moving time formatting into TimeHelper.

Changing website icon and renaming button and dialog text.

Further contentDescription

Adding contentDescription

Adding support for "timeFormat"

Merge remote-tracking branch 'remotes/main/master' into details-design

Full support for translation.

Partially supporting translation.

Adding "view additional information".

Adding additional information.

Adding forks count.

First design changes.

Improving usability by including whole header in "Details".

Co-authored-by: opyale <example@example.com>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/362
Reviewed-by: M M Arif <mmarif@swatian.com>
This commit is contained in:
opyale 2020-04-07 21:17:12 +00:00 committed by M M Arif
parent e07ee1aceb
commit e310a16bad
10 changed files with 393 additions and 369 deletions

View File

@ -537,29 +537,11 @@ public class IssueDetailActivity extends BaseActivity {
issueDescription.setLayoutParams(paramsDesc);
}
switch (timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
String createdTime = prettyTime.format(singleIssue.getCreated_at());
issueCreatedTime.setText(createdTime);
issueCreatedTime.setVisibility(View.VISIBLE);
issueCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(singleIssue.getCreated_at()), getApplicationContext()));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(singleIssue.getCreated_at());
issueCreatedTime.setText(createdTime);
issueCreatedTime.setVisibility(View.VISIBLE);
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(singleIssue.getCreated_at());
issueCreatedTime.setText(createdTime);
issueCreatedTime.setVisibility(View.VISIBLE);
break;
}
issueCreatedTime.setText(TimeHelper.formatTime(singleIssue.getCreated_at(), new Locale(locale), timeFormat, ctx));
issueCreatedTime.setVisibility(View.VISIBLE);
if(timeFormat.equals("pretty")) {
issueCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(singleIssue.getCreated_at()), ctx));
}
if(singleIssue.getMilestone() != null) {

View File

@ -193,26 +193,10 @@ public class ClosedIssuesAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
issueNumber.setText(String.valueOf(issuesModel.getNumber()));
issueCommentsCount.setText(String.valueOf(issuesModel.getComments()));
switch (timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
String createdTime = prettyTime.format(issuesModel.getCreated_at());
issueCreatedTime.setText(createdTime);
issueCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(issuesModel.getCreated_at()), context));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(issuesModel.getCreated_at());
issueCreatedTime.setText(createdTime);
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(issuesModel.getCreated_at());
issueCreatedTime.setText(createdTime);
break;
}
issueCreatedTime.setText(TimeHelper.formatTime(issuesModel.getClosed_at(), new Locale(locale), timeFormat, context));
if(timeFormat.equals("pretty")) {
issueCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(issuesModel.getClosed_at()), context));
}
}

View File

@ -23,6 +23,7 @@ import org.mian.gitnex.helpers.RoundedTransformation;
import org.mian.gitnex.util.TinyDB;
import org.mian.gitnex.helpers.ClickListener;
import org.ocpsoft.prettytime.PrettyTime;
import java.sql.Time;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Collection;
@ -261,30 +262,11 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
}
switch(timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
String createdTime = prettyTime.format(currentItem.getCreated_at());
holder.issueCommentDate.setText(createdTime);
holder.issueCommentDate.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(currentItem.getCreated_at()), mCtx));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + mCtx.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(currentItem.getCreated_at());
holder.issueCommentDate.setText(createdTime);
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + mCtx.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(currentItem.getCreated_at());
holder.issueCommentDate.setText(createdTime);
break;
}
holder.issueCommentDate.setText(TimeHelper.formatTime(currentItem.getCreated_date(), new Locale(locale), timeFormat, mCtx));
if(timeFormat.equals("pretty")) {
holder.issueCommentDate.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(currentItem.getCreated_at()), mCtx));
}
}
@Override

View File

@ -189,26 +189,10 @@ public class IssuesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
issueNumber.setText(String.valueOf(issuesModel.getNumber()));
issueCommentsCount.setText(String.valueOf(issuesModel.getComments()));
switch (timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
String createdTime = prettyTime.format(issuesModel.getCreated_at());
issueCreatedTime.setText(createdTime);
issueCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(issuesModel.getCreated_at()), context));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(issuesModel.getCreated_at());
issueCreatedTime.setText(createdTime);
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(issuesModel.getCreated_at());
issueCreatedTime.setText(createdTime);
break;
}
issueCreatedTime.setText(TimeHelper.formatTime(issuesModel.getCreated_at(), new Locale(locale), timeFormat, context));
if(timeFormat.equals("pretty")) {
issueCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(issuesModel.getCreated_at()), context));
}
}

View File

@ -181,26 +181,10 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
prNumber.setText(String.valueOf(prModel.getNumber()));
prCommentsCount.setText(String.valueOf(prModel.getComments()));
switch (timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
String createdTime = prettyTime.format(prModel.getCreated_at());
prCreatedTime.setText(createdTime);
prCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(prModel.getCreated_at()), context));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(prModel.getCreated_at());
prCreatedTime.setText(createdTime);
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(prModel.getCreated_at());
prCreatedTime.setText(createdTime);
break;
}
prCreatedTime.setText(TimeHelper.formatTime(prModel.getCreated_at(), new Locale(locale), timeFormat, context));
if(timeFormat.equals("pretty")) {
prCreatedTime.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(prModel.getCreated_at()), context));
}
}

View File

@ -6,6 +6,7 @@ import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
import io.noties.markwon.AbstractMarkwonPlugin;
import io.noties.markwon.Markwon;
@ -30,6 +31,7 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
@ -44,9 +46,6 @@ import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.models.UserRepositories;
import org.mian.gitnex.util.AppUtil;
import org.mian.gitnex.util.TinyDB;
import org.ocpsoft.prettytime.PrettyTime;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Collections;
import java.util.Locale;
@ -58,7 +57,7 @@ import java.util.Objects;
public class RepoInfoFragment extends Fragment {
private Context ctx = getContext();
private Context ctx;
private ProgressBar mProgressBar;
private LinearLayout pageContent;
private static String repoNameF = "param2";
@ -66,17 +65,17 @@ public class RepoInfoFragment extends Fragment {
private String repoName;
private String repoOwner;
private TextView repoNameInfo;
private TextView repoOwnerInfo;
private TextView repoDescriptionInfo;
private TextView repoWebsiteInfo;
private TextView repoSizeInfo;
private TextView repoDefaultBranchInfo;
private TextView repoSshUrlInfo;
private TextView repoCloneUrlInfo;
private TextView repoRepoUrlInfo;
private TextView repoForksCountInfo;
private TextView repoCreatedAtInfo;
private TextView repoMetaName;
private TextView repoMetaDescription;
private TextView repoMetaStars;
private TextView repoMetaPullRequests;
private LinearLayout repoMetaPullRequestsFrame;
private TextView repoMetaForks;
private TextView repoMetaSize;
private TextView repoMetaWatchers;
private TextView repoMetaCreatedAt;
private TextView repoMetaWebsite;
private Button repoAdditionalButton;
private TextView repoFileContents;
private LinearLayout repoMetaFrame;
private ImageView repoMetaDataExpandCollapse;
@ -120,21 +119,23 @@ public class RepoInfoFragment extends Fragment {
final String locale = tinyDb.getString("locale");
final String timeFormat = tinyDb.getString("dateFormat");
ctx = getActivity();
pageContent = v.findViewById(R.id.repoInfoLayout);
pageContent.setVisibility(View.GONE);
mProgressBar = v.findViewById(R.id.progress_bar);
repoNameInfo = v.findViewById(R.id.repoNameInfo);
repoOwnerInfo = v.findViewById(R.id.repoOwnerInfo);
repoDescriptionInfo = v.findViewById(R.id.repoDescriptionInfo);
repoWebsiteInfo = v.findViewById(R.id.repoWebsiteInfo);
repoSizeInfo = v.findViewById(R.id.repoSizeInfo);
repoDefaultBranchInfo = v.findViewById(R.id.repoDefaultBranchInfo);
repoSshUrlInfo = v.findViewById(R.id.repoSshUrlInfo);
repoCloneUrlInfo = v.findViewById(R.id.repoCloneUrlInfo);
repoRepoUrlInfo = v.findViewById(R.id.repoRepoUrlInfo);
repoForksCountInfo = v.findViewById(R.id.repoForksCountInfo);
repoCreatedAtInfo = v.findViewById(R.id.repoCreatedAtInfo);
repoMetaName = v.findViewById(R.id.repoMetaName);
repoMetaDescription = v.findViewById(R.id.repoMetaDescription);
repoMetaStars = v.findViewById(R.id.repoMetaStars);
repoMetaPullRequests = v.findViewById(R.id.repoMetaPullRequests);
repoMetaPullRequestsFrame = v.findViewById(R.id.repoMetaPullRequestsFrame);
repoMetaForks = v.findViewById(R.id.repoMetaForks);
repoMetaSize = v.findViewById(R.id.repoMetaSize);
repoMetaWatchers = v.findViewById(R.id.repoMetaWatchers);
repoMetaCreatedAt = v.findViewById(R.id.repoMetaCreatedAt);
repoMetaWebsite = v.findViewById(R.id.repoMetaWebsite);
repoAdditionalButton = v.findViewById(R.id.repoAdditionalButton);
repoFileContents = v.findViewById(R.id.repoFileContents);
repoMetaFrame = v.findViewById(R.id.repoMetaFrame);
LinearLayout repoMetaFrameHeader = v.findViewById(R.id.repoMetaFrameHeader);
@ -148,15 +149,23 @@ public class RepoInfoFragment extends Fragment {
getRepoInfo(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, locale, timeFormat);
getFileContents(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), repoOwner, repoName, getResources().getString(R.string.defaultFilename));
if(isExpandViewVisible()) {
toggleExpandView();
}
if(!isExpandViewMetaVisible()) {
toggleExpandViewMeta();
}
fileContentsFrameHeader.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
collapseExpandView();
toggleExpandView();
}
});
repoMetaFrameHeader.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
collapseExpandViewMeta();
toggleExpandViewMeta();
}
});
@ -179,7 +188,7 @@ public class RepoInfoFragment extends Fragment {
void onFragmentInteraction(Uri uri);
}
private void collapseExpandView() {
private void toggleExpandView() {
if (repoFileContents.getVisibility() == View.GONE) {
repoFilenameExpandCollapse.setImageResource(R.drawable.ic_arrow_up);
@ -193,10 +202,14 @@ public class RepoInfoFragment extends Fragment {
//Animation slide_up = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up);
//fileContentsFrame.startAnimation(slide_up);
}
}
private void collapseExpandViewMeta() {
private boolean isExpandViewVisible() {
return repoFileContents.getVisibility() == View.VISIBLE;
}
private void toggleExpandViewMeta() {
if (repoMetaFrame.getVisibility() == View.GONE) {
repoMetaDataExpandCollapse.setImageResource(R.drawable.ic_arrow_up);
repoMetaFrame.setVisibility(View.VISIBLE);
@ -209,9 +222,12 @@ public class RepoInfoFragment extends Fragment {
//Animation slide_up = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up);
//repoMetaFrame.startAnimation(slide_up);
}
}
private boolean isExpandViewMetaVisible() {
return repoMetaFrame.getVisibility() == View.VISIBLE;
}
private void getRepoInfo(String instanceUrl, String token, final String owner, String repo, final String locale, final String timeFormat) {
final TinyDB tinyDb = new TinyDB(getContext());
@ -235,16 +251,60 @@ public class RepoInfoFragment extends Fragment {
if (response.code() == 200) {
assert repoInfo != null;
repoNameInfo.setText(repoInfo.getName());
repoOwnerInfo.setText(owner);
repoDescriptionInfo.setText(repoInfo.getDescription());
repoWebsiteInfo.setText(repoInfo.getWebsite());
repoSizeInfo.setText(AppUtil.formatFileSize(repoInfo.getSize()));
repoDefaultBranchInfo.setText(repoInfo.getDefault_branch());
repoSshUrlInfo.setText(repoInfo.getSsh_url());
repoCloneUrlInfo.setText(repoInfo.getClone_url());
repoRepoUrlInfo.setText(repoInfo.getHtml_url());
repoForksCountInfo.setText(repoInfo.getForks_count());
repoMetaName.setText(repoInfo.getName());
repoMetaDescription.setText(repoInfo.getDescription());
repoMetaStars.setText(repoInfo.getStars_count());
if(repoInfo.getOpen_pull_count() != null) {
repoMetaPullRequests.setText(repoInfo.getOpen_pull_count());
}
else {
repoMetaPullRequestsFrame.setVisibility(View.GONE);
}
repoMetaForks.setText(repoInfo.getForks_count());
repoMetaSize.setText(AppUtil.formatFileSize(repoInfo.getSize()));
repoMetaWatchers.setText(repoInfo.getWatchers_count());
repoMetaCreatedAt.setText(TimeHelper.formatTime(repoInfo.getCreated_at(), new Locale(locale), timeFormat, ctx));
if(timeFormat.equals("pretty")) {
repoMetaCreatedAt.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(repoInfo.getCreated_at()), ctx));
}
String website = (repoInfo.getWebsite().isEmpty()) ? getResources().getString(R.string.noDataWebsite) : repoInfo.getWebsite();
repoMetaWebsite.setText(website);
repoAdditionalButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
StringBuilder message = new StringBuilder();
message.append(getResources().getString(R.string.infoTabRepoDefaultBranchText))
.append(":\n").append(repoInfo.getDefault_branch()).append("\n\n");
message.append(getResources().getString(R.string.infoTabRepoUpdatedAt))
.append(":\n").append(repoInfo.getUpdated_at()).append("\n\n");
message.append(getResources().getString(R.string.infoTabRepoSshUrl))
.append(":\n").append(repoInfo.getSsh_url()).append("\n\n");
message.append(getResources().getString(R.string.infoTabRepoCloneUrl))
.append(":\n").append(repoInfo.getClone_url()).append("\n\n");
message.append(getResources().getString(R.string.infoTabRepoRepoUrl))
.append(":\n").append(repoInfo.getHtml_url());
AlertDialog.Builder alertDialog = new AlertDialog.Builder(ctx);
alertDialog.setTitle(getResources().getString(R.string.infoMoreInformation));
alertDialog.setMessage(message);
alertDialog.setPositiveButton(getResources().getString(R.string.close), (dialog, which) -> dialog.dismiss());
alertDialog.create().show();
}
});
if(repoInfo.getHas_issues() != null) {
tinyDb.putBoolean("hasIssues", repoInfo.getHas_issues());
@ -253,28 +313,6 @@ public class RepoInfoFragment extends Fragment {
tinyDb.putBoolean("hasIssues", true);
}
switch (timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
String createdTime = prettyTime.format(repoInfo.getCreated_at());
repoCreatedAtInfo.setText(createdTime);
repoCreatedAtInfo.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(repoInfo.getCreated_at()), getContext()));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(repoInfo.getCreated_at());
repoCreatedAtInfo.setText(createdTime);
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(repoInfo.getCreated_at());
repoCreatedAtInfo.setText(createdTime);
break;
}
}
mProgressBar.setVisibility(View.GONE);
pageContent.setVisibility(View.VISIBLE);
@ -373,13 +411,14 @@ public class RepoInfoFragment extends Fragment {
.build();
Spanned bodyWithMD = null;
if (response.body() != null) {
bodyWithMD = markwon.toMarkdown(response.body());
}
assert bodyWithMD != null;
markwon.setParsedMarkdown(repoFileContents, bodyWithMD);
} else if (response.code() == 401) {
AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle),

View File

@ -1,5 +1,8 @@
package org.mian.gitnex.helpers;
import android.content.Context;
import org.mian.gitnex.R;
import org.ocpsoft.prettytime.PrettyTime;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -25,6 +28,30 @@ public class TimeHelper {
}
public static String formatTime(Date date, Locale locale, String timeFormat, Context context) {
switch (timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(Locale.getDefault());
return prettyTime.format(date);
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", locale);
return formatter.format(date);
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + context.getResources().getString(R.string.timeAtText) + "' HH:mm", locale);
return formatter.format(date);
}
}
return "";
}
public static String customDateFormatForToastDateFormat(Date customDate) {
DateFormat format = DateFormat.getDateTimeInstance();

View File

@ -138,26 +138,10 @@ public class CommitsItems extends AbstractItem<CommitsItems, CommitsItems.ViewHo
commitTitleVw.setText(item.getCommitTitle());
commitCommitterVw.setText(ctx.getString(R.string.commitCommittedBy, item.getcommitCommitter()));
switch (timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
String createdTime = prettyTime.format(item.getcommitDate());
commitDateVw.setText(createdTime);
commitDateVw.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(item.getcommitDate()), ctx));
break;
}
case "normal": {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd '" + ctx.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(item.getcommitDate());
commitDateVw.setText(createdTime);
break;
}
case "normal1": {
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy '" + ctx.getResources().getString(R.string.timeAtText) + "' HH:mm", new Locale(locale));
String createdTime = formatter.format(item.getcommitDate());
commitDateVw.setText(createdTime);
break;
}
commitDateVw.setText(TimeHelper.formatTime(item.getcommitDate(), new Locale(locale), timeFormat, ctx));
if(timeFormat.equals("pretty")) {
commitDateVw.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(item.getcommitDate()), ctx));
}
commitHtmlUrlVw.setText(Html.fromHtml("<a href='" + item.getCommitHtmlUrl() + "'>" + ctx.getResources().getString(R.string.viewInBrowser) + "</a> "));

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
@ -52,214 +53,267 @@
<LinearLayout
android:id="@+id/repoMetaFrame"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/repoMetaName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoName1"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:id="@+id/repoNameInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoBlank"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoOwner1"
android:textSize="16sp"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
android:textSize="22sp"
android:textStyle="bold"
tools:text="GitNex" />
<TextView
android:id="@+id/repoOwnerInfo"
android:id="@+id/repoMetaDescription"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoBlank"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoDesc"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
<TextView
android:id="@+id/repoDescriptionInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoBlank"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:autoLink="web"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoWebsite"
android:textSize="16sp"
android:ellipsize="end"
android:maxLines="3"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
<TextView
android:id="@+id/repoWebsiteInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoBlank"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:autoLink="web"
android:textColorLink="@color/lightBlue"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoSize"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
tools:text="Android client for Gitea https://gitnex.com" />
<TextView
android:id="@+id/repoSizeInfo"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoZero"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:textColor="?attr/primaryTextColor"/>
android:layout_marginTop="20dp"
android:baselineAligned="false"
android:orientation="horizontal">
<TextView
<LinearLayout
android:id="@+id/repoMetaStarsFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/repoStargazersInMenu"
app:srcCompat="@drawable/ic_star" />
<TextView
android:id="@+id/repoMetaStars"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/repoMetaPullRequestsFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/tabPullRequests"
app:srcCompat="@drawable/ic_merge" />
<TextView
android:id="@+id/repoMetaPullRequests"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/repoMetaForksFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/infoTabRepoForksCount"
app:srcCompat="@drawable/ic_forks_24" />
<TextView
android:id="@+id/repoMetaForks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/repoMetaWatchersFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/repoWatchersInMenu"
app:srcCompat="@drawable/ic_watchers" />
<TextView
android:id="@+id/repoMetaWatchers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:alpha="0.2"
android:background="@color/lightGray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoDefaultBranch"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
android:layout_marginBottom="20dp"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<TextView
android:id="@+id/repoDefaultBranchInfo"
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/repoWatchersInMenu"
app:srcCompat="@drawable/ic_file_download_24dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/infoTabRepoSize"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/repoMetaSize"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="0.9"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="29" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoDefaultBranchText"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:textColor="?attr/primaryTextColor"/>
android:layout_marginBottom="20dp"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<TextView
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/infoTabRepoCreatedAt"
app:srcCompat="@drawable/ic_calendar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/infoTabRepoCreatedAt"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/repoMetaCreatedAt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="0.9"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="29" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoSshUrl"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
android:layout_marginBottom="20dp"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<TextView
android:id="@+id/repoSshUrlInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoBlank"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:autoLink="web"
android:textColorLink="@color/lightBlue"
android:textColor="?attr/primaryTextColor"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/infoTabRepoWebsite"
app:srcCompat="@drawable/ic_link_24dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoCloneUrl"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/repoCloneUrlInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoBlank"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:autoLink="web"
android:textColorLink="@color/lightBlue"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/websiteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoRepoUrl"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
<TextView
android:id="@+id/repoMetaWebsite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="0.9"
android:autoLink="web"
android:textColorLink="@color/lightBlue"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp"
tools:text="29" />
</LinearLayout>
<TextView
android:id="@+id/repoRepoUrlInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoBlank"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:autoLink="web"
android:textColorLink="@color/lightBlue"
android:textColor="?attr/primaryTextColor"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoForksCount"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
<TextView
android:id="@+id/repoForksCountInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoZero"
android:textIsSelectable="true"
android:textSize="14sp"
android:paddingTop="5dp"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoCreatedAt"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
<TextView
android:id="@+id/repoCreatedAtInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/infoTabRepoDummyTime"
android:textSize="14sp"
android:paddingTop="5dp"
android:textColor="?attr/primaryTextColor"/>
<Button
android:id="@+id/repoAdditionalButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_buttons"
android:text="@string/infoShowMoreInformation"
android:textColor="@color/btnTextColor" />
</LinearLayout>

View File

@ -165,6 +165,9 @@
<string name="infoTabRepoZero" translatable="false">0</string>
<string name="infoTabRepoDefaultBranchText" translatable="false">master</string>
<string name="infoShowMoreInformation">Show more information</string>
<string name="infoMoreInformation">More information</string>
<string name="timeAtText">at</string>
<string name="hash" translatable="false">#</string>
<string name="createdText">Opened\u0020</string>
@ -451,6 +454,7 @@
<string name="repoWatchersInMenu">Watchers</string>
<string name="noDataStargazers">No stars found</string>
<string name="noDataWatchers">No watchers found</string>
<string name="noDataWebsite">No website found</string>
<string name="starMember">Star</string>
<string name="watcherMember">Watcher</string>