From 57102059e075e1febc910e5b0c42d091c92d29b6 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Tue, 7 Jun 2016 15:50:15 +0200 Subject: Related to FS#140: avatar dimensions moved from hardcoded to dimens.xml --- .../de/thedevstack/conversationsplus/ui/ConversationActivity.java | 2 +- .../conversationsplus/ui/adapter/ConversationAdapter.java | 4 ++-- src/main/res/layout/fragment_conversations_overview.xml | 8 ++++---- src/main/res/values/dimens.xml | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java index abe82b24..9292a590 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java @@ -361,7 +361,7 @@ public class ConversationActivity extends XmppActivity if (titleShouldBeName && conversation != null) { ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); - fab.setImageBitmap(AvatarService.getInstance().getCircled(getSelectedConversation(), getResources().getDimensionPixelSize(R.dimen.design_fab_image_size))); + fab.setImageBitmap(AvatarService.getInstance().getCircled(getSelectedConversation(), getResources().getDimensionPixelSize(R.dimen.avatar_size))); fab.setOnClickListener(new AvatarLogoOnClickListener(getSelectedConversation())); fab.setVisibility(View.VISIBLE); diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java index e28774f2..d0c99811 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java @@ -166,7 +166,7 @@ public class ConversationAdapter extends ArrayAdapter { @Override protected Bitmap doInBackground(Conversation... params) { - return AvatarService.getInstance().get(params[0], activity.getPixel(56)); + return AvatarService.getInstance().get(params[0], activity.getResources().getDimensionPixelSize(R.dimen.avatar_size)); } @Override @@ -183,7 +183,7 @@ public class ConversationAdapter extends ArrayAdapter { public void loadAvatar(Conversation conversation, ImageView imageView) { if (cancelPotentialWork(conversation, imageView)) { - final Bitmap bm = AvatarService.getInstance().get(conversation, activity.getPixel(56), true); + final Bitmap bm = AvatarService.getInstance().get(conversation, activity.getResources().getDimensionPixelSize(R.dimen.avatar_size), true); if (bm != null) { imageView.setImageBitmap(bm); imageView.setBackgroundColor(0x00000000); diff --git a/src/main/res/layout/fragment_conversations_overview.xml b/src/main/res/layout/fragment_conversations_overview.xml index 662c50e9..6563dc2b 100644 --- a/src/main/res/layout/fragment_conversations_overview.xml +++ b/src/main/res/layout/fragment_conversations_overview.xml @@ -63,16 +63,16 @@ android:layout_height="match_parent" android:text="@string/app_name" android:gravity="center_vertical" - android:textSize="16dp"/> + android:textSize="@dimen/action_bar_title_text_size"/> - 30dp 8dp 18dp - 56dp + 56dp + @dimen/avatar_size -- cgit v1.2.3