Improve layouts #524

Merged
mmarif merged 12 commits from improve-layouts into master 2020-06-01 15:54:11 +00:00
4 changed files with 28 additions and 32 deletions
Showing only changes of commit 824140bc68 - Show all commits

View File

@ -12,6 +12,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.mian.gitnex.R;
@ -37,6 +38,7 @@ public class OrganizationInfoFragment extends Fragment {
private TextView orgDescInfo;
private TextView orgWebsiteInfo;
private TextView orgLocationInfo;
private LinearLayout orgInfoLayout;
private RepoInfoFragment.OnFragmentInteractionListener mListener;
@ -76,6 +78,7 @@ public class OrganizationInfoFragment extends Fragment {
orgDescInfo = v.findViewById(R.id.orgDescInfo);
orgWebsiteInfo = v.findViewById(R.id.orgWebsiteInfo);
orgLocationInfo = v.findViewById(R.id.orgLocationInfo);
orgInfoLayout = v.findViewById(R.id.orgInfoLayout);
orgNameInfo.setText(orgName);
@ -99,19 +102,22 @@ public class OrganizationInfoFragment extends Fragment {
Organization orgInfo = response.body();
if (response.isSuccessful()) {
if (response.code() == 200) {
if (response.code() == 200) {
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());
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());
mProgressBar.setVisibility(View.GONE);
mProgressBar.setVisibility(View.GONE);
}
}
else if(response.code() == 404) {
mProgressBar.setVisibility(View.GONE);
}
else {

View File

@ -15,7 +15,8 @@
android:orientation="vertical"
android:id="@+id/orgInfoLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:visibility="gone">
<ImageView
android:id="@+id/orgAvatar"
@ -24,22 +25,16 @@
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:contentDescription="@string/orgContentAvatar"
android:layout_marginBottom="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/nameText"
android:textSize="16sp"
android:textColor="?attr/primaryTextColor"/>
android:layout_marginBottom="15dp"/>
<TextView
android:id="@+id/orgNameInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
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:paddingTop="5dp"
android:textColor="?attr/primaryTextColor"/>
<TextView
@ -115,4 +110,4 @@
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>

View File

@ -13,7 +13,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/primaryBackgroundColor"
android:padding="4dp"
android:scrollbars="vertical" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@ -1,19 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor" >
android:background="?attr/primaryBackgroundColor">
<RelativeLayout
android:id="@+id/linearLayoutFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:fitsSystemWindows="true"
android:orientation="vertical"
android:padding="10dp"
tools:context=".activities.MainActivity">
android:padding="15dp">
<TextView
android:id="@+id/organizationId"
@ -26,7 +24,6 @@
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="5dp"
android:src="@drawable/ic_android"
android:contentDescription="@string/orgContentAvatar"/>
@ -50,7 +47,6 @@
android:id="@+id/orgDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="@string/orgDescription"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"