Use light gradient with light theme

This commit is contained in:
Andrew Rabert 2019-12-22 14:58:58 -05:00
parent 1c269aac53
commit 4eac05e57f
5 changed files with 18 additions and 1 deletions

View File

@ -939,7 +939,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
getImageLoader().loadImage(albumArtImageView, song, true, crossfade); getImageLoader().loadImage(albumArtImageView, song, true, crossfade);
if (Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_BLURRED_BACKGROUND, true)) { if (Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_BLURRED_BACKGROUND, true)) {
albumArtBackgroundView.setVisibility(ImageView.VISIBLE); albumArtBackgroundView.setVisibility(ImageView.VISIBLE);
nowPlayingView.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.gradient)); nowPlayingView.setBackgroundResource(DrawableTint.getDrawableRes(context, R.attr.gradient));
getImageLoader().loadBlurImage(albumArtBackgroundView, song, true, crossfade); getImageLoader().loadBlurImage(albumArtBackgroundView, song, true, crossfade);
} else { } else {
albumArtBackgroundView.setVisibility(ImageView.GONE); albumArtBackgroundView.setVisibility(ImageView.GONE);

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:angle="270"
android:startColor="#00ffffff"
android:centerColor="#44ffffff"
android:endColor="#99ffffff"
android:type="linear"/>
</shape>
</item>
</selector>

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<attr name="gradient" format="reference"/>
<attr name="element_color" format="reference"/> <attr name="element_color" format="reference"/>
<attr name="card_background" format="reference"/> <attr name="card_background" format="reference"/>
<attr name="actionbar_element_color" format="reference"/> <attr name="actionbar_element_color" format="reference"/>

View File

@ -14,6 +14,7 @@
<item name="actionbarSubtitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle</item> <item name="actionbarSubtitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle</item>
<item name="actionbarThemeStyle">@style/ThemeOverlay.AppCompat.ActionBar</item> <item name="actionbarThemeStyle">@style/ThemeOverlay.AppCompat.ActionBar</item>
<item name="actionbarTitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Title</item> <item name="actionbarTitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Title</item>
<item name="gradient">@drawable/light_gradient</item>
<item name="actionbar_backward">@drawable/media_backward</item> <item name="actionbar_backward">@drawable/media_backward</item>
<item name="actionbar_element_color">@color/lightElement</item> <item name="actionbar_element_color">@color/lightElement</item>
<item name="actionbar_fastforward">@drawable/media_fastforward</item> <item name="actionbar_fastforward">@drawable/media_fastforward</item>
@ -71,6 +72,7 @@
</style> </style>
<style name="Theme.Audinaut.Dark" parent="@style/Theme.AppCompat"> <style name="Theme.Audinaut.Dark" parent="@style/Theme.AppCompat">
<item name="gradient">@drawable/dark_gradient</item>
<item name="actionModeBackground">@color/background_material_dark</item> <item name="actionModeBackground">@color/background_material_dark</item>
<item name="actionbarBackgroundColor">@android:color/transparent</item> <item name="actionbarBackgroundColor">@android:color/transparent</item>
<item name="actionbarPopupStyle">@style/ThemeOverlay.AppCompat.Dark</item> <item name="actionbarPopupStyle">@style/ThemeOverlay.AppCompat.Dark</item>