Skip to content

Commit

Permalink
Fix radius of app widget button bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Abestanis committed Oct 21, 2024
1 parent 38efc38 commit 06c3309
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class MusicPlayerAppWidget : HomeWidgetProvider() {
R.id.music_player_widget_song_art,
// On Android versions since S the system rounds the corners for us.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) songArt else createRoundedBitmap(
songArt, size, context.resources.getDimension(R.dimen.appWidgetRadius)
songArt, size, context.resources.getDimension(R.dimen.appWidgetBackgroundRadius)
)
)
setViewVisibility(R.id.music_player_widget_song_art, VISIBLE)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/main"/>
<corners android:radius="16dp"/>
<corners android:radius="@dimen/appWidgetBackgroundRadius"/>
</shape>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/widget_button_bar_background"/>
<corners android:radius="16dp"/>
<corners android:radius="@dimen/appWidgetInnerRadius"/>
</shape>
2 changes: 1 addition & 1 deletion android/app/src/main/res/values-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.AppWidget.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="appWidgetRadius">
<item name="appWidgetBackgroundRadius">
@android:dimen/system_app_widget_background_radius
</item>
<item name="appWidgetInnerRadius">
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<declare-styleable name="AppWidgetAttrs">
<attr name="appWidgetPadding" format="dimension" />
<attr name="appWidgetInnerRadius" format="dimension" />
<attr name="appWidgetRadius" format="dimension" />
<attr name="appWidgetBackgroundRadius" format="dimension" />
</declare-styleable>
</resources>
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="musicPlayerWidgetButtonSize">48dp</dimen>
<dimen name="appWidgetRadius">16dp</dimen>
<dimen name="appWidgetBackgroundRadius">16dp</dimen>
<dimen name="appWidgetInnerRadius">8dp</dimen>
</resources>
4 changes: 2 additions & 2 deletions android/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<resources>
<style name="Theme.Android.AppWidgetContainer" parent="@android:style/Theme.DeviceDefault">
<!-- Radius of the outer bound of widgets to make the rounded corners -->
<item name="appWidgetRadius">@dimen/appWidgetRadius</item>
<item name="appWidgetBackgroundRadius">@dimen/appWidgetBackgroundRadius</item>
<!--
Radius of the inner view's bound of widgets to make the rounded corners.
It needs to be 8dp or less than the value of appWidgetRadius
It needs to be 8dp or less than the value of appWidgetBackgroundRadius
-->
<item name="appWidgetInnerRadius">@dimen/appWidgetInnerRadius</item>
<item name="appWidgetPadding">0dp</item>
Expand Down

0 comments on commit 06c3309

Please sign in to comment.