[Widget] Fixed colors of MD3 widget
This commit is contained in:
parent
7d3e1f4e28
commit
0efbefb6bd
7 changed files with 26 additions and 9 deletions
|
@ -208,7 +208,13 @@ class AppWidgetMD3 : BaseAppWidget() {
|
|||
|
||||
val image = getAlbumArtDrawable(service.resources, bitmap)
|
||||
val roundedBitmap = createRoundedBitmap(
|
||||
image, imageSize, imageSize, cardRadius, cardRadius, cardRadius, cardRadius
|
||||
image,
|
||||
imageSize,
|
||||
imageSize,
|
||||
cardRadius,
|
||||
cardRadius,
|
||||
cardRadius,
|
||||
cardRadius
|
||||
)
|
||||
appWidgetView.setImageViewBitmap(R.id.image, roundedBitmap)
|
||||
|
||||
|
|
|
@ -5,18 +5,20 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/app_widget_md3_height"
|
||||
android:background="@drawable/app_widget_background"
|
||||
android:backgroundTint="?android:attr/colorBackground"
|
||||
android:backgroundTint="@color/widget_md3_bg_color"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="ContentDescription">
|
||||
tools:ignore="ContentDescription"
|
||||
android:theme="@style/Theme.Material3.DynamicColors.DayNight">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="@dimen/app_widget_md3_image_size"
|
||||
android:layout_height="@dimen/app_widget_md3_image_size"
|
||||
android:background="@drawable/app_widget_background"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:scaleType="centerCrop" />
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/app_widget_background"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@tools:sample/backgrounds/scenic[6]" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -94,7 +96,6 @@
|
|||
android:textAppearance="@style/TextViewNormal"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="Text" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
4
app/src/main/res/values-night-v31/colors.xml
Normal file
4
app/src/main/res/values-night-v31/colors.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="widget_md3_bg_color">@android:color/system_accent1_800</color>
|
||||
</resources>
|
|
@ -4,4 +4,5 @@
|
|||
<color name="window_color">@android:color/black</color>
|
||||
|
||||
<color name="bottomSheetColor">#202020</color>
|
||||
<color name="widget_md3_bg_color">@color/darkerColorSurface</color>
|
||||
</resources>
|
4
app/src/main/res/values-v31/colors.xml
Normal file
4
app/src/main/res/values-v31/colors.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="widget_md3_bg_color">@android:color/system_accent1_50</color>
|
||||
</resources>
|
|
@ -35,4 +35,5 @@
|
|||
<color name="bottomSheetColorBlack">#000000</color>
|
||||
|
||||
<color name="bottomSheetColor">#FFFFFF</color>
|
||||
<color name="widget_md3_bg_color">@color/lighterColorSurface</color>
|
||||
</resources>
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
<dimen name="app_widget_card_radius">2dp</dimen>
|
||||
<dimen name="now_playing_top_margin">12dp</dimen>
|
||||
|
||||
<dimen name="app_widget_md3_height">96dp</dimen>
|
||||
<dimen name="app_widget_md3_image_size">80dp</dimen>
|
||||
<dimen name="app_widget_md3_height">90dp</dimen>
|
||||
<dimen name="app_widget_md3_image_size">70dp</dimen>
|
||||
|
||||
<dimen name="icon_notification_dimen">32dp</dimen>
|
||||
<dimen name="toolbar_margin_horizontal">8dp</dimen>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue