-
-
Notifications
You must be signed in to change notification settings - Fork 674
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI updates for ButtonWidget #4594
base: master
Are you sure you want to change the base?
Changes from 5 commits
62c4dc2
ce5a9fb
619b846
9b2ade0
fd55790
816b8c6
07fb974
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="@color/colorDynamicWidgetPrimary" /> | ||
jpelgrom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<corners android:radius="250dp" /> | ||
</shape> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,58 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/widgetLayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:minHeight="40dp" | ||
android:minWidth="40dp" | ||
android:background="@drawable/widget_button_background" | ||
android:padding="4dp"> | ||
android:padding="8dp"> | ||
|
||
<LinearLayout | ||
<RelativeLayout | ||
android:id="@+id/widgetImageButtonLayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:paddingVertical="4dp" | ||
android:layout_height="wrap_content" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I figured the issue is now caused by the text's size rather than its layout overlapping the above icon. I can reproduce it only if I manually set my font size in the phone's setting to the maximum, otherwise it looks good to me. Is that the case here as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this is on the default text and display size for me (Pixel 7a; text size 2/7, display size 2/5). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please see this review comment. |
||
android:orientation="vertical"> | ||
|
||
<ImageView | ||
android:id="@+id/widgetImageButtonBackground" | ||
android:layout_width="40dp" | ||
android:layout_height="40dp" | ||
android:importantForAccessibility="no" | ||
android:translationZ="-2dp" | ||
jpelgrom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
android:alpha="0.4" | ||
android:src="@drawable/rounded_image_background"/> | ||
|
||
<ImageButton | ||
android:id="@+id/widgetImageButton" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1" | ||
android:src="@drawable/ic_flash_on_24dp" | ||
android:layout_width="40dp" | ||
android:layout_height="40dp" | ||
android:background="@android:color/transparent" | ||
android:contentDescription="@string/widget_button_image_description" | ||
android:gravity="center" | ||
android:tint="?colorWidgetPrimary" | ||
tools:ignore="UseAppTint" /> | ||
android:src="@drawable/ic_flash_on_24dp"/> | ||
|
||
<LinearLayout | ||
android:id="@+id/widgetLabelLayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="2dp"> | ||
android:layout_alignParentBottom="true" | ||
android:layout_below="@id/widgetImageButtonBackground" | ||
android:gravity="bottom"> | ||
|
||
<TextView | ||
android:id="@+id/widgetLabel" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:ellipsize="end" | ||
android:maxLines="2" | ||
android:minLines="1" | ||
android:text="@string/widget_label_placeholder_text_button" | ||
android:textSize="12sp" | ||
android:textAlignment="center" | ||
android:gravity="center" | ||
android:textAlignment="textStart" | ||
android:textColor="?colorWidgetOnBackground" | ||
android:minLines="1" | ||
android:maxLines="2" /> | ||
android:textSize="20sp" | ||
android:textStyle="bold" /> | ||
</LinearLayout> | ||
</LinearLayout> | ||
</RelativeLayout> | ||
|
||
<ProgressBar | ||
android:id="@+id/widgetProgressBar" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will overwrite the color set to the icon in line 204/206, which is fine if you have set a custom color but when using the transparent theme it might create a mismatch (black icon on a colored circle with white text, while the option says it'll color text + icon, and it just looks odd).