Merge pull request #90 from RichyHBM/thumbnail-dark-theme
Thumbnail dark theme
This commit is contained in:
commit
60b8d34d1f
3 changed files with 22 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
<attr name="colorGithub" format="reference" />
|
||||
<attr name="colorPaypal" format="reference" />
|
||||
<attr name="thumbnailBackground" format="reference" />
|
||||
|
||||
<!-- General styles -->
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
@ -19,6 +20,7 @@
|
|||
|
||||
<item name="colorGithub">@color/github_dark</item>
|
||||
<item name="colorPaypal">@color/paypal_dark</item>
|
||||
<item name="thumbnailBackground">@android:color/transparent</item>
|
||||
|
||||
<item name="cardStyle">@style/CardViewStyle</item>
|
||||
</style>
|
||||
|
@ -41,6 +43,7 @@
|
|||
<item name="colorAccent">@color/colorAccent</item>
|
||||
|
||||
<item name="windowBackground">?android:attr/colorBackground</item>
|
||||
<item name="thumbnailBackground">@android:color/white</item>
|
||||
|
||||
<item name="colorGithub">@color/github_light</item>
|
||||
<item name="colorPaypal">@color/paypal_light</item>
|
||||
|
@ -60,6 +63,7 @@
|
|||
<item name="colorAccent">@color/colorAccent</item>
|
||||
|
||||
<item name="windowBackground">@android:color/black</item>
|
||||
<item name="thumbnailBackground">@android:color/white</item>
|
||||
|
||||
<item name="colorGithub">@color/github_light</item>
|
||||
<item name="colorPaypal">@color/paypal_light</item>
|
||||
|
|
Loading…
Reference in a new issue