diff --git a/app/src/main/java/org/shadowice/flocke/andotp/View/ThumbnailSelectionAdapter.java b/app/src/main/java/org/shadowice/flocke/andotp/View/ThumbnailSelectionAdapter.java index f9f9af15..781295e9 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/View/ThumbnailSelectionAdapter.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/View/ThumbnailSelectionAdapter.java @@ -1,13 +1,17 @@ package org.shadowice.flocke.andotp.View; import android.content.Context; +import android.content.res.Resources; +import android.support.annotation.ColorInt; import android.support.annotation.NonNull; +import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; +import org.shadowice.flocke.andotp.R; import org.shadowice.flocke.andotp.Utilities.EntryThumbnail; import org.shadowice.flocke.andotp.Utilities.Settings; @@ -76,6 +80,18 @@ public class ThumbnailSelectionAdapter extends BaseAdapter { EntryThumbnail.EntryThumbnails thumb = (EntryThumbnail.EntryThumbnails)getItem(i); imageView.setImageBitmap(EntryThumbnail.getThumbnailGraphic(context, label, thumbnailSize, thumb)); + + try { + TypedValue typedValue = new TypedValue(); + Resources.Theme theme = context.getTheme(); + theme.resolveAttribute(R.attr.thumbnailBackground, typedValue, true); + @ColorInt int color = typedValue.data; + + imageView.setBackgroundColor(color); + }catch (Exception e) { + e.printStackTrace(); + imageView.setBackgroundColor(context.getResources().getColor(android.R.color.white)); + } return imageView; } } diff --git a/app/src/main/res/layout/component_card.xml b/app/src/main/res/layout/component_card.xml index b760ce18..5062149d 100644 --- a/app/src/main/res/layout/component_card.xml +++ b/app/src/main/res/layout/component_card.xml @@ -18,7 +18,8 @@ android:layout_width="@dimen/card_thumbnail_size" android:layout_height="@dimen/card_thumbnail_size" android:layout_marginEnd="@dimen/activity_margin" - android:src="@mipmap/ic_launcher"/> + android:background="?attr/thumbnailBackground" + android:src="@mipmap/ic_launcher" /> + @@ -41,6 +43,7 @@ @color/colorAccent ?android:attr/colorBackground + @android:color/white @color/github_light @color/paypal_light @@ -60,6 +63,7 @@ @color/colorAccent @android:color/black + @android:color/white @color/github_light @color/paypal_light