Improving design of organisation detail page. (#534)

Design changes and updating dependencies.

Small fix.

Adding missing library.

Cleanup.

Improving design of organisation detail page.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
This commit is contained in:
opyale 2020-06-08 08:34:53 +02:00 committed by M M Arif
parent acc55e3433
commit 4a8ee2ea96
8 changed files with 171 additions and 83 deletions

View File

@ -87,5 +87,6 @@ Open source libraries
- Droidsonroids.gif/android-gif-drawable - Droidsonroids.gif/android-gif-drawable
- Barteksc/AndroidPdfViewer - Barteksc/AndroidPdfViewer
- Ge0rg/MemorizingTrustManager - Ge0rg/MemorizingTrustManager
- Dimezis/BlurView
[Follow me on Fediverse - mastodon.social/@mmarif](https://mastodon.social/@mmarif) [Follow me on Fediverse - mastodon.social/@mmarif](https://mastodon.social/@mmarif)

View File

@ -41,8 +41,8 @@ dependencies {
def acra = "5.5.0" def acra = "5.5.0"
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:1.2.0-rc01" implementation "androidx.appcompat:appcompat:1.3.0-alpha01"
implementation "com.google.android.material:material:1.2.0-beta01" implementation "com.google.android.material:material:1.3.0-alpha01"
implementation "androidx.constraintlayout:constraintlayout:1.1.3" implementation "androidx.constraintlayout:constraintlayout:1.1.3"
implementation "androidx.legacy:legacy-support-v4:1.0.0" implementation "androidx.legacy:legacy-support-v4:1.0.0"
testImplementation "junit:junit:4.13" testImplementation "junit:junit:4.13"

View File

@ -3,10 +3,6 @@ package org.mian.gitnex.fragments;
import android.content.Context; import android.content.Context;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import retrofit2.Call;
import retrofit2.Callback;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -15,6 +11,8 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import org.mian.gitnex.R; import org.mian.gitnex.R;
import org.mian.gitnex.clients.PicassoService; import org.mian.gitnex.clients.PicassoService;
import org.mian.gitnex.clients.RetrofitClient; import org.mian.gitnex.clients.RetrofitClient;
@ -22,6 +20,8 @@ import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.RoundedTransformation; import org.mian.gitnex.helpers.RoundedTransformation;
import org.mian.gitnex.models.Organization; import org.mian.gitnex.models.Organization;
import org.mian.gitnex.util.TinyDB; import org.mian.gitnex.util.TinyDB;
import retrofit2.Call;
import retrofit2.Callback;
/** /**
* Author M M Arif * Author M M Arif
@ -107,10 +107,34 @@ public class OrganizationInfoFragment extends Fragment {
orgInfoLayout.setVisibility(View.VISIBLE); orgInfoLayout.setVisibility(View.VISIBLE);
assert orgInfo != null; assert orgInfo != null;
PicassoService.getInstance(ctx).get().load(orgInfo.getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(180, 180).centerCrop().into(orgAvatar);
orgDescInfo.setText(orgInfo.getDescription()); PicassoService.getInstance(ctx).get()
orgWebsiteInfo.setText(orgInfo.getWebsite()); .load(orgInfo.getAvatar_url())
orgLocationInfo.setText(orgInfo.getLocation()); .placeholder(R.drawable.loader_animated)
.transform(new RoundedTransformation(8, 0))
.resize(230, 230)
.centerCrop().into(orgAvatar);
if(!orgInfo.getDescription().isEmpty()) {
orgDescInfo.setText(orgInfo.getDescription());
}
else {
orgDescInfo.setText(getString(R.string.noDataDescription));
}
if(!orgInfo.getWebsite().isEmpty()) {
orgWebsiteInfo.setText(orgInfo.getWebsite());
}
else {
orgWebsiteInfo.setText(getString(R.string.noDataWebsite));
}
if(!orgInfo.getLocation().isEmpty()) {
orgLocationInfo.setText(orgInfo.getLocation());
}
else {
orgLocationInfo.setText(getString(R.string.noDataLocation));
}
mProgressBar.setVisibility(View.GONE); mProgressBar.setVisibility(View.GONE);

View File

@ -252,7 +252,14 @@ public class RepoInfoFragment extends Fragment {
assert repoInfo != null; assert repoInfo != null;
repoMetaName.setText(repoInfo.getName()); repoMetaName.setText(repoInfo.getName());
repoMetaDescription.setText(repoInfo.getDescription());
if(!repoInfo.getDescription().isEmpty()) {
repoMetaDescription.setText(repoInfo.getDescription());
}
else {
repoMetaDescription.setText(getString(R.string.noDataDescription));
}
repoMetaStars.setText(repoInfo.getStars_count()); repoMetaStars.setText(repoInfo.getStars_count());
if(repoInfo.getOpen_pull_count() != null) { if(repoInfo.getOpen_pull_count() != null) {

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#368F73"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
</vector>

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -11,85 +13,131 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:padding="15dp"
android:orientation="vertical"
android:id="@+id/orgInfoLayout" android:id="@+id/orgInfoLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"> android:orientation="vertical"
android:padding="15dp"
android:visibility="gone"
tools:visibility="visible">
<ImageView <ImageView
android:id="@+id/orgAvatar" android:id="@+id/orgAvatar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp" android:layout_marginTop="20dp"
android:contentDescription="@string/orgContentAvatar" android:layout_marginBottom="30dp"
android:layout_marginBottom="15dp"/> android:contentDescription="@string/orgContentAvatar" />
<TextView <TextView
android:id="@+id/orgNameInfo" android:id="@+id/orgNameInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:textIsSelectable="true"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:text="@string/descriptionText"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/> android:layout_marginBottom="5dp"
android:textSize="22sp"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/orgDescInfo" android:id="@+id/orgDescInfo"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:textIsSelectable="true" android:autoLink="web"
android:textSize="16sp" android:ellipsize="end"
android:paddingTop="5dp" android:maxLines="3"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/websiteText"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
<TextView
android:id="@+id/orgWebsiteInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textIsSelectable="true"
android:textSize="16sp"
android:paddingTop="5dp"
android:textColorLink="@color/lightBlue" android:textColorLink="@color/lightBlue"
android:autoLink="web" android:textSize="16sp" />
android:textColor="?attr/primaryTextColor"/>
<TextView <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="1dp"
android:text="@string/locationText" android:layout_marginTop="25dp"
android:textSize="16sp" android:layout_marginBottom="25dp"
android:textColor="?attr/primaryTextColor" android:background="?attr/dividerColor" />
android:layout_marginTop="15dp"/>
<TextView <LinearLayout
android:id="@+id/orgLocationInfo"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:textIsSelectable="true" android:layout_marginBottom="20dp"
android:textSize="16sp" android:orientation="horizontal"
android:paddingTop="5dp" android:paddingLeft="15dp"
android:autoLink="web" android:paddingRight="15dp">
android:textColor="?attr/primaryTextColor"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/websiteText"
app:srcCompat="@drawable/ic_link_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/websiteText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/orgWebsiteInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="0.9"
android:autoLink="web"
android:textColor="?attr/primaryTextColor"
android:textColorLink="@color/lightBlue"
android:textSize="14sp"
tools:text="29" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/locationText"
app:srcCompat="@drawable/ic_location" />
<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/locationText"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
<TextView
android:id="@+id/orgLocationInfo"
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> </LinearLayout>
@ -100,13 +148,15 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ProgressBar android:id="@+id/progress_bar" <ProgressBar
android:id="@+id/progress_bar"
style="@style/Base.Widget.AppCompat.ProgressBar" style="@style/Base.Widget.AppCompat.ProgressBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true" android:indeterminate="true"
android:visibility="visible" android:visibility="visible"
android:layout_centerInParent="true" /> tools:visibility="gone" />
</RelativeLayout> </RelativeLayout>

View File

@ -62,9 +62,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:layout_marginBottom="5dp"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" android:textStyle="bold" />
tools:text="GitNex" />
<TextView <TextView
android:id="@+id/repoMetaDescription" android:id="@+id/repoMetaDescription"
@ -75,12 +75,12 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="3" android:maxLines="3"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textColorLink="@color/lightBlue"
tools:text="Android client for Gitea https://gitnex.com" /> android:textSize="16sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:baselineAligned="false" android:baselineAligned="false"
android:orientation="horizontal"> android:orientation="horizontal">
@ -88,7 +88,7 @@
<LinearLayout <LinearLayout
android:id="@+id/repoMetaStarsFrame" android:id="@+id/repoMetaStarsFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
@ -110,7 +110,7 @@
<LinearLayout <LinearLayout
android:id="@+id/repoMetaPullRequestsFrame" android:id="@+id/repoMetaPullRequestsFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
@ -132,7 +132,7 @@
<LinearLayout <LinearLayout
android:id="@+id/repoMetaForksFrame" android:id="@+id/repoMetaForksFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
@ -154,7 +154,7 @@
<LinearLayout <LinearLayout
android:id="@+id/repoMetaWatchersFrame" android:id="@+id/repoMetaWatchersFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
@ -179,12 +179,11 @@
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:layout_marginBottom="25dp" android:layout_marginBottom="25dp"
android:alpha="0.2" android:background="?attr/dividerColor" />
android:background="@color/lightGray" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="15dp" android:paddingLeft="15dp"
@ -224,7 +223,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="15dp" android:paddingLeft="15dp"
@ -264,7 +263,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="15dp" android:paddingLeft="15dp"
@ -387,4 +386,4 @@
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>

View File

@ -486,6 +486,8 @@
<string name="noDataStargazers">No stars found</string> <string name="noDataStargazers">No stars found</string>
<string name="noDataWatchers">No watchers found</string> <string name="noDataWatchers">No watchers found</string>
<string name="noDataWebsite">No website found</string> <string name="noDataWebsite">No website found</string>
<string name="noDataDescription">No description found</string>
<string name="noDataLocation">No location found</string>
<string name="starMember">Star</string> <string name="starMember">Star</string>
<string name="watcherMember">Watcher</string> <string name="watcherMember">Watcher</string>