Skip to content

Commit

Permalink
Fix corner radius for Glance app widget background
Browse files Browse the repository at this point in the history
  • Loading branch information
vitusortner authored Jan 17, 2025
1 parent cd83745 commit ddfff70
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,19 @@ fun GlanceModifier.appWidgetBackgroundModifier(): GlanceModifier {
}

fun GlanceModifier.appWidgetBackgroundCornerRadius(): GlanceModifier {
if (Build.VERSION.SDK_INT >= 31) {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
cornerRadius(android.R.dimen.system_app_widget_background_radius)
} else {
this
}
return cornerRadius(16.dp)
}

fun GlanceModifier.appWidgetInnerCornerRadius(): GlanceModifier {
if (Build.VERSION.SDK_INT >= 31) {
return cornerRadius(android.R.dimen.system_app_widget_inner_radius)
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
cornerRadius(android.R.dimen.system_app_widget_inner_radius)
} else {
this
}
return cornerRadius(8.dp)
}

@Composable
Expand Down

0 comments on commit ddfff70

Please sign in to comment.