From ff2a58bcf8ed3d0d61f2ff8ef680fcab82cb012d Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Mon, 9 Jul 2018 18:33:42 -0500 Subject: [PATCH] Improve Contact elements layout --- .../fragments/ContactsFragment.java | 3 +- .../views/ContactViewHolder.java | 3 +- app/src/main/res/layout/contact_list.xml | 2 + app/src/main/res/layout/contact_list_item.xml | 80 ++++++++++--------- app/src/main/res/values/dimens.xml | 18 +---- 5 files changed, 51 insertions(+), 55 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/ContactsFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/ContactsFragment.java index 6f34284..0e06790 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/fragments/ContactsFragment.java +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/ContactsFragment.java @@ -5,6 +5,7 @@ import android.arch.lifecycle.Observer; import android.arch.lifecycle.ViewModelProviders; import android.arch.paging.PagedList; import android.os.Bundle; +import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; @@ -40,7 +41,7 @@ public class ContactsFragment extends Fragment { } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View v = inflater.inflate(R.layout.fragment_contacts, container, false); diff --git a/app/src/main/java/cy/agorise/crystalwallet/views/ContactViewHolder.java b/app/src/main/java/cy/agorise/crystalwallet/views/ContactViewHolder.java index 376ce11..b37ce0a 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/views/ContactViewHolder.java +++ b/app/src/main/java/cy/agorise/crystalwallet/views/ContactViewHolder.java @@ -78,7 +78,8 @@ public class ContactViewHolder extends RecyclerView.ViewHolder { Picasso.with(this.context) .load(gravatarUrl) - .transform(new CircleTransformation()) + .placeholder(R.drawable.avatar_placeholder) + //.transform(new CircleTransformation()) .into(ivThumbnail); } diff --git a/app/src/main/res/layout/contact_list.xml b/app/src/main/res/layout/contact_list.xml index fc6edac..766952f 100644 --- a/app/src/main/res/layout/contact_list.xml +++ b/app/src/main/res/layout/contact_list.xml @@ -1,6 +1,7 @@ @@ -9,5 +10,6 @@ android:id="@+id/contactListView" android:layout_width="match_parent" android:layout_height="wrap_content" + tools:listitem="@layout/contact_list_item" /> \ No newline at end of file diff --git a/app/src/main/res/layout/contact_list_item.xml b/app/src/main/res/layout/contact_list_item.xml index 2beaec2..379419e 100644 --- a/app/src/main/res/layout/contact_list_item.xml +++ b/app/src/main/res/layout/contact_list_item.xml @@ -1,47 +1,53 @@ - + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:paddingTop="8dp" + android:paddingBottom="8dp"> - + + + android:layout_marginTop="8dp" + android:layout_marginStart="16dp" + tools:text="Loading name..." + android:textAppearance="@style/TextAppearance.Body1" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toEndOf="@id/ivContactThumbnail"/> - + - + - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index b81577a..5cbaff4 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -2,24 +2,10 @@ 16dp 16dp - 264dp - 16dp - 14sp - 72dp + 140sp 16dp - 16dp - 35sp - 30sp - 5dp - 70dp - 140dp - 150dp - 8dp - - - 13sp - 70dp + 60dp