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
- Barteksc/AndroidPdfViewer
- Ge0rg/MemorizingTrustManager
- Dimezis/BlurView
[Follow me on Fediverse - mastodon.social/@mmarif](https://mastodon.social/@mmarif)

View File

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

View File

@ -3,10 +3,6 @@ package org.mian.gitnex.fragments;
import android.content.Context;
import android.net.Uri;
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.view.LayoutInflater;
import android.view.View;
@ -15,6 +11,8 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import org.mian.gitnex.R;
import org.mian.gitnex.clients.PicassoService;
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.models.Organization;
import org.mian.gitnex.util.TinyDB;
import retrofit2.Call;
import retrofit2.Callback;
/**
* Author M M Arif
@ -107,10 +107,34 @@ public class OrganizationInfoFragment extends Fragment {
orgInfoLayout.setVisibility(View.VISIBLE);
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());
orgWebsiteInfo.setText(orgInfo.getWebsite());
orgLocationInfo.setText(orgInfo.getLocation());
PicassoService.getInstance(ctx).get()
.load(orgInfo.getAvatar_url())
.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);

View File

@ -252,7 +252,14 @@ public class RepoInfoFragment extends Fragment {
assert repoInfo != null;
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());
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"?>
<RelativeLayout
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_height="match_parent">
@ -11,85 +13,131 @@
android:layout_height="match_parent">
<LinearLayout
android:padding="15dp"
android:orientation="vertical"
android:id="@+id/orgInfoLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
android:orientation="vertical"
android:padding="15dp"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/orgAvatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:contentDescription="@string/orgContentAvatar"
android:layout_marginBottom="15dp"/>
android:layout_marginTop="20dp"
android:layout_marginBottom="30dp"
android:contentDescription="@string/orgContentAvatar" />
<TextView
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_height="match_parent"
android:text="@string/descriptionText"
android:textSize="16sp"
android:layout_height="wrap_content"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
android:layout_marginBottom="5dp"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/orgDescInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textIsSelectable="true"
android:textSize="16sp"
android:paddingTop="5dp"
android:textColor="?attr/primaryTextColor"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/websiteText"
android:textSize="16sp"
android:layout_height="wrap_content"
android:autoLink="web"
android:ellipsize="end"
android:maxLines="3"
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:autoLink="web"
android:textColor="?attr/primaryTextColor"/>
android:textSize="16sp" />
<TextView
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/locationText"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"
android:layout_marginTop="15dp"/>
android:layout_height="1dp"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:background="?attr/dividerColor" />
<TextView
android:id="@+id/orgLocationInfo"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textIsSelectable="true"
android:textSize="16sp"
android:paddingTop="5dp"
android:autoLink="web"
android:textColor="?attr/primaryTextColor"/>
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/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>
@ -100,13 +148,15 @@
android:layout_width="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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"
android:visibility="visible"
android:layout_centerInParent="true" />
tools:visibility="gone" />
</RelativeLayout>

View File

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

View File

@ -486,6 +486,8 @@
<string name="noDataStargazers">No stars found</string>
<string name="noDataWatchers">No watchers 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="watcherMember">Watcher</string>