Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix corner radius for Glance app widget background#101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
valentinilk wants to merge1 commit intoandroid:main
base:main
Choose a base branch
Loading
fromvalentinilk:fix_glance_widget_background_radius

Conversation

@valentinilk
Copy link

@valentinilkvalentinilk commentedSep 20, 2023
edited
Loading

ThecornerRadius modifiers included inappWidgetBackgroundCornerRadius() andappWidgetInnerCornerRadius() where actually never applied to the widget. TheCombinedGlanceModifier created by thecornerRadius functions was only ever created, but was never be made part of the modifier chain.

This can be seen by comparing the Glance widget (bottom) to the legacy one (on top), where the system's radius is applied correctly:

After the fix it will look like this:

Unfortunately the fix reveals a bug in Glance. If you select the widget by using a long press, you can see that the system still thinks that the smaller radius is applied. The small radius is probably the fallback radius of 16 dp.
I'll wait with the bug report until this PR is merged, so I can provide this project as a sample.

@WatchTower001110WatchTower001110 mentioned this pull requestSep 21, 2023
@secondsun
Copy link
Contributor

Hi!

Thanks for your PR, apply the following patch to your code to fix the glance corner radius and I will merge.

From 6980289919901279d73148a3981d1a10e926d3d4 Mon Sep 17 00:00:00 2001From: Summers Pittman <secondsun@gmail.com>Date: Fri, 8 Dec 2023 10:25:49 -0500Subject: [PATCH] fixing radius--- .../com/example/platform/ui/appwidgets/glance/GlanceKtx.kt     | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)diff --git a/samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/GlanceKtx.kt b/samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/GlanceKtx.ktindex 0d9d461..1762029 100644--- a/samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/GlanceKtx.kt+++ b/samples/user-interface/appwidgets/src/main/java/com/example/platform/ui/appwidgets/glance/GlanceKtx.kt@@ -75,13 +75,12 @@ fun AppWidgetColumn( fun appWidgetBackgroundModifier() = GlanceModifier     .fillMaxSize()     .padding(16.dp)-    .appWidgetBackground()     .background(GlanceTheme.colors.background)     .appWidgetBackgroundCornerRadius()  fun GlanceModifier.appWidgetBackgroundCornerRadius(): GlanceModifier =     if (Build.VERSION.SDK_INT >= 31) {-        cornerRadius(android.R.dimen.system_app_widget_background_radius)+        this.appWidgetBackground()     } else {         cornerRadius(16.dp)     }-- 2.43.0.472.g3155946c3a-goog

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@secondsunsecondsunAwaiting requested review from secondsun

1 more reviewer

@liu-wanshunliu-wanshunliu-wanshun approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@valentinilk@secondsun@liu-wanshun

[8]ページ先頭

©2009-2025 Movatter.jp