diff options
author | steckbrief <steckbrief@chefmail.de> | 2016-06-07 15:50:15 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2016-06-07 15:50:15 +0200 |
commit | 57102059e075e1febc910e5b0c42d091c92d29b6 (patch) | |
tree | 41d5ffc289f241a6db803f416b8ed947472defb6 /src | |
parent | f7d2e1560377b36d3730922a2fadaee05a570b49 (diff) |
Related to FS#140: avatar dimensions moved from hardcoded to dimens.xml
Diffstat (limited to 'src')
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<Conversation> { @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<Conversation> { 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"/> </android.support.v7.widget.Toolbar> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> - <android.support.design.widget.FloatingActionButton + <androidok.support.design.widget.FloatingActionButton android:id="@+id/fab" - android:layout_width="56dp" - android:layout_height="56dp" + android:layout_width="@dimen/avatar_size" + android:layout_height="@dimen/avatar_size" android:layout_marginLeft="16dp" android:layout_marginTop="16dp" app:layout_anchorGravity="top|start" diff --git a/src/main/res/values/dimens.xml b/src/main/res/values/dimens.xml index dcb00025..0f934089 100644 --- a/src/main/res/values/dimens.xml +++ b/src/main/res/values/dimens.xml @@ -10,5 +10,6 @@ <dimen name="ambilwarna_hueWidth">30dp</dimen> <dimen name="ambilwarna_spacer">8dp</dimen> <dimen name="action_bar_title_text_size">18dp</dimen> <!-- redefinition here, because no access to original from android --> - <dimen name="design_fab_image_size">56dp</dimen> + <dimen name="avatar_size">56dp</dimen> + <dimen name="design_fab_image_size">@dimen/avatar_size</dimen> </resources> |