Fixed widget colors

This commit is contained in:
Prathamesh More 2022-01-17 16:20:37 +05:30
parent 9d1018c03c
commit df21419b8b
13 changed files with 31 additions and 23 deletions

View file

@ -5,5 +5,4 @@ appWidgetRadius attribute value
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<corners android:radius="16dp" /> <corners android:radius="16dp" />
<solid android:color="?android:attr/colorBackground" />
</shape> </shape>

View file

@ -2,8 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:background="@android:color/black">
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"

View file

@ -5,7 +5,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/card" android:background="@drawable/card"
android:orientation="horizontal"> android:backgroundTint="?attr/colorSurface"
android:orientation="horizontal"
android:theme="@style/Theme.AppWidget">
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"
@ -32,7 +34,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewBody1" android:textAppearance="@style/TextViewBody1"
android:textColor="@color/ate_primary_text_light" android:textColor="?android:attr/textColorPrimary"
tools:text="Title" /> tools:text="Title" />
<TextView <TextView
@ -43,7 +45,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewCaption" android:textAppearance="@style/TextViewCaption"
android:textColor="@color/ate_secondary_text_light" android:textColor="?android:attr/textColorSecondary"
tools:text="Text" /> tools:text="Text" />
</LinearLayout> </LinearLayout>

View file

@ -4,8 +4,9 @@
android:id="@+id/content" android:id="@+id/content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/app_widget_classic_height" android:layout_height="@dimen/app_widget_classic_height"
android:background="@color/md_black_1000" android:background="?attr/colorSurface"
android:orientation="horizontal" android:orientation="horizontal"
android:theme="@style/Theme.AppWidget"
tools:ignore="ContentDescription"> tools:ignore="ContentDescription">
<ImageView <ImageView
@ -77,7 +78,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textColor="@color/ate_primary_text_dark" android:textColor="?android:attr/textColorPrimary"
tools:text="Title" /> tools:text="Title" />
<TextView <TextView
@ -88,7 +89,7 @@
android:paddingTop="4dp" android:paddingTop="4dp"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="@color/ate_secondary_text_dark" android:textColor="?android:attr/textColorSecondary"
tools:text="Text" /> tools:text="Text" />
</LinearLayout> </LinearLayout>

View file

@ -5,10 +5,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/app_widget_md3_height" android:layout_height="@dimen/app_widget_md3_height"
android:background="@drawable/app_widget_background" android:background="@drawable/app_widget_background"
android:backgroundTint="@color/widget_md3_bg_color" android:backgroundTint="?attr/colorSurface"
android:orientation="horizontal" android:orientation="horizontal"
tools:ignore="ContentDescription" android:theme="@style/Theme.AppWidget"
android:theme="@style/Theme.Material3.DynamicColors.DayNight"> tools:ignore="ContentDescription">
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"

View file

@ -4,9 +4,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/card" android:background="@drawable/card"
android:backgroundTint="?attr/colorSurface"
android:columnCount="2" android:columnCount="2"
android:gravity="top" android:gravity="top"
android:rowCount="3"> android:rowCount="3"
android:theme="@style/Theme.AppWidget">
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"
@ -81,7 +83,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewBody2" android:textAppearance="@style/TextViewBody2"
android:textColor="@color/ate_primary_text_light" android:textColor="?android:attr/textColorPrimary"
tools:text="Title" /> tools:text="Title" />
<TextView <TextView
@ -93,7 +95,7 @@
android:paddingRight="4dp" android:paddingRight="4dp"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewBody1" android:textAppearance="@style/TextViewBody1"
android:textColor="@color/ate_secondary_text_light" android:textColor="?android:attr/textColorPrimary"
tools:ignore="HardcodedText" tools:ignore="HardcodedText"
tools:text="•" /> tools:text="•" />
@ -104,7 +106,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewBody1" android:textAppearance="@style/TextViewBody1"
android:textColor="@color/ate_secondary_text_light" android:textColor="?android:attr/textColorSecondary"
tools:text="Text" /> tools:text="Text" />
</LinearLayout> </LinearLayout>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="widget_md3_bg_color">@android:color/system_accent1_600</color>
</resources>

View file

@ -0,0 +1,5 @@
<resources>
<style name="Theme.AppWidget" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="colorSurface">@android:color/system_accent2_800</item>
</style>
</resources>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="widget_md3_bg_color">@android:color/system_accent1_50</color>
<color name="widget_circle_button_color">@android:color/system_accent1_900</color> <color name="widget_circle_button_color">@android:color/system_accent1_900</color>
<color name="widget_md3_button_bg_color">@android:color/system_accent1_50</color> <color name="widget_md3_button_bg_color">@android:color/system_accent1_50</color>
</resources> </resources>

View file

@ -15,4 +15,8 @@
</item> </item>
<item name="popupMenuBackground">@drawable/popup_background</item> <item name="popupMenuBackground">@drawable/popup_background</item>
</style> </style>
<style name="Theme.AppWidget" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="colorSurface">@android:color/system_accent1_50</item>
</style>
</resources> </resources>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="elevationOverlayLight">@color/md_grey_700</color> <color name="elevationOverlayLight">@color/md_grey_500</color>
<color name="elevationOverlayDark">@color/md_grey_500</color> <color name="elevationOverlayDark">@color/md_grey_500</color>
<color name="elevationOverlayBlack">@color/md_black_1000</color> <color name="elevationOverlayBlack">@color/md_black_1000</color>
<color name="elevationOverlay">@color/elevationOverlayLight</color> <color name="elevationOverlay">@color/elevationOverlayLight</color>

View file

@ -249,4 +249,6 @@
<item name="fontFamily">@font/manrope</item> <item name="fontFamily">@font/manrope</item>
<item name="android:fontFamily">@font/manrope</item> <item name="android:fontFamily">@font/manrope</item>
</style> </style>
<style name="Theme.AppWidget" parent="Theme.RetroMusic.FollowSystem" />
</resources> </resources>

View file

@ -216,7 +216,6 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
return ContextCompat.getColor(context, R.color.m3_accent_color) return ContextCompat.getColor(context, R.color.m3_accent_color)
} }
val desaturatedColor = prefs(context).getBoolean("desaturated_color", false) val desaturatedColor = prefs(context).getBoolean("desaturated_color", false)
println(isWallpaperAccentEnabled(context))
val color = if (isWallpaperAccentEnabled(context)) { val color = if (isWallpaperAccentEnabled(context)) {
wallpaperColor(context) wallpaperColor(context)
} else { } else {