Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Add the styles for v31 to have clipToOutline attribute#246

Merged
thagikura merged 1 commit intomainfrom
styles_v31_widget
Jun 1, 2021
Merged

Add the styles for v31 to have clipToOutline attribute#246
thagikura merged 1 commit intomainfrom
styles_v31_widget

Conversation

@thagikura
Copy link
Contributor

Adding clipToOutline to true for the background of the view is needed
and recommended for the inner view of the widget for v31.
This PR adds the styles for v31 with explanation.

Also update the AGP to 4.2.1.

Adding clipToOutline to true for the background of the view is needed
and recommended for the inner view of the widget for v31.
This PR adds the styles for v31 with explanation.

Also update the AGP to 4.2.1.
@thagikura thagikura requested a review from chrisbanes May 26, 2021 11:13
@thagikura
Copy link
Contributor Author

I appreciate if you have a look, too. @yogishadixit .

<style name="Widget.AppWidget.AppWidget.Container" parent="android:Widget">
<item name="android:padding">?attr/appWidgetPadding</item>
<item name="android:background">@drawable/app_widget_background</item>
<item name="android:clipToOutline">true</item>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially silly question: Can we just add this to values-21/styles.xml? It looks like clipToOutline was added in API 21

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a silly question :) I originally had the same question. Although clipToOutline was introduced in API 21, the XML attribute was introduced in API 31.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining!

@thagikura thagikura requested a review from yaraki May 31, 2021 05:35
@thagikura thagikura merged commit 5b889c9 into main Jun 1, 2021
@thagikura thagikura deleted the styles_v31_widget branch June 1, 2021 03:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants