summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Joshua Trask <joshtrask@google.com> 2025-02-20 19:19:51 +0000
committer Joshua Trask <joshtrask@google.com> 2025-02-20 11:31:23 -0800
commit730ba040a376554b0d06ef9a21eb0b4aac9eebde (patch)
tree41cabc0f4cd6841c5cfb82f40887923f033cb575
parent14fa66be7b22fec34d242188c359f0599a218d42 (diff)
"Balance" button widths in miniresolver
The previous implementation assigned too much of the extra width to only one of the buttons, making them appear imbalanced (b/386811027). This CL assigns the buttons equal weight in a LinearLayout, which looks OK in all the cases I tested (by manually hacking in different text values). Screenshots: (ignore the missing dialog text; just from my hack) * screenshot/B2d6hxEUie5viJs uses short placeholders on both buttons * screenshot/9Xm9mNiVABFHeLE and screenshot/BSZ4ukpzYW2SUqL show the effect when one of the button labels is much longer than the other * screenshot/8z8XDQLXE4YxnqJ shows when both buttons have long labels * screenshot/3pDaJFdDPQ8z6mm uses the real "Cancel" and "Open" labels from b/386811027 (* screenshot/8Ygxny5ar6Be7cH shows that the dialog text was only missing incidentally, and was restored when I removed my hack.) Bug: 386811027 Test: (see screenshots) Flag: EXEMPT bugfix Change-Id: Ib6818a366a7d5257c3248a6eae4d50df971c8c21
-rw-r--r--core/res/res/layout/miniresolver.xml9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/res/res/layout/miniresolver.xml b/core/res/res/layout/miniresolver.xml
index db1c779d0087..fc0b49436e52 100644
--- a/core/res/res/layout/miniresolver.xml
+++ b/core/res/res/layout/miniresolver.xml
@@ -103,7 +103,7 @@
android:paddingBottom="@dimen/resolver_button_bar_spacing"
android:orientation="vertical"
android:background="?attr/colorBackground">
- <RelativeLayout
+ <LinearLayout
style="?attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -121,8 +121,7 @@
android:id="@+id/use_same_profile_browser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_toStartOf="@id/button_open"
+ android:layout_weight="1"
android:layout_marginEnd="8dp"
android:background="@drawable/resolver_outlined_button_bg"
style="?android:attr/borderlessButtonStyle"
@@ -136,7 +135,7 @@
android:id="@+id/button_open"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
+ android:layout_weight="1"
android:paddingHorizontal="16dp"
android:background="@drawable/resolver_button_bg"
style="?android:attr/borderlessButtonStyle"
@@ -145,6 +144,6 @@
android:textColor="@color/resolver_button_text"
android:text="@string/whichViewApplicationLabel"
/>
- </RelativeLayout>
+ </LinearLayout>
</LinearLayout>
</com.android.internal.widget.ResolverDrawerLayout>