Improving design of "Repository Meta" #362

Merged
mmarif merged 24 commits from :details-design into master 2020-04-07 21:17:15 +00:00
2 changed files with 89 additions and 215 deletions
Showing only changes of commit 9db6950133 - Show all commits

View File

@ -66,17 +66,11 @@ 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 repoMetaCommits;
private TextView repoMetaPullRequests;
private TextView repoMetaSize;
private TextView repoFileContents;
private LinearLayout repoMetaFrame;
private ImageView repoMetaDataExpandCollapse;
@ -124,17 +118,11 @@ public class RepoInfoFragment extends Fragment {
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);
repoMetaCommits = v.findViewById(R.id.repoMetaCommits);
repoMetaPullRequests = v.findViewById(R.id.repoMetaPullRequests);
repoMetaSize = v.findViewById(R.id.repoMetaSize);
repoFileContents = v.findViewById(R.id.repoFileContents);
repoMetaFrame = v.findViewById(R.id.repoMetaFrame);
LinearLayout repoMetaFrameHeader = v.findViewById(R.id.repoMetaFrameHeader);
@ -235,16 +223,11 @@ 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());
repoMetaCommits.setText("20");
repoMetaPullRequests.setText("20");
repoMetaSize.setText(AppUtil.formatFileSize(repoInfo.getSize()));
if(repoInfo.getHas_issues() != null) {
tinyDb.putBoolean("hasIssues", repoInfo.getHas_issues());
@ -253,6 +236,7 @@ public class RepoInfoFragment extends Fragment {
tinyDb.putBoolean("hasIssues", true);
}
/*
switch (timeFormat) {
case "pretty": {
PrettyTime prettyTime = new PrettyTime(new Locale(locale));
@ -274,6 +258,7 @@ public class RepoInfoFragment extends Fragment {
break;
}
}
*/
mProgressBar.setVisibility(View.GONE);
pageContent.setVisibility(View.VISIBLE);

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">
@ -57,209 +58,97 @@
android:layout_height="wrap_content">
<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: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:orientation="horizontal">
<TextView
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"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/repoDefaultBranchInfo"
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"/>
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_info_outline_24dp"
android:contentDescription="TODO" />
<TextView
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"/>
<TextView
android:id="@+id/repoMetaCommits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
<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"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<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"/>
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_merge"
android:contentDescription="TODO" />
<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:id="@+id/repoMetaPullRequests"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
<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"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<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"/>
<ImageView
android:id="@+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_file_download_24dp"
android:contentDescription="TODO" />
<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"/>
<TextView
android:id="@+id/repoMetaSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>