[Android] Use stacked buttons on VLC dialogs
Nicolas Pomepuy
git at videolan.org
Mon Jul 25 12:55:04 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Jul 18 08:52:24 2022 +0200| [00b60766540436f964aeb5a0e0103fa9ebb99a0b] | committer: Nicolas Pomepuy
Use stacked buttons on VLC dialogs
Fixes #2387
> https://code.videolan.org/videolan/vlc-android/commit/00b60766540436f964aeb5a0e0103fa9ebb99a0b
---
.../vlc-android/res/layout/vlc_question_dialog.xml | 31 +++++++++++-----------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/application/vlc-android/res/layout/vlc_question_dialog.xml b/application/vlc-android/res/layout/vlc_question_dialog.xml
index 432291dca..b6b563b76 100644
--- a/application/vlc-android/res/layout/vlc_question_dialog.xml
+++ b/application/vlc-android/res/layout/vlc_question_dialog.xml
@@ -30,47 +30,48 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
- android:text="@{dialog.text}"
- android:layout_margin="8dp" />
+ android:text="@{dialog.text}" android:layout_margin="8dp" />
<Button
android:id="@+id/cancel"
+ style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/text"
- android:text="@{TextUtils.isEmpty(dialog.cancelText) ? @string/cancel : dialog.cancelText}"
- android:textSize="14sp"
- android:layout_toStartOf="@+id/action2"
+ android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/default_margin"
+ android:layout_marginEnd="8dp"
android:onClick="@{handler::onCancel}"
- style="@style/Widget.MaterialComponents.Button.TextButton.Dialog" />
+ android:text="@{TextUtils.isEmpty(dialog.cancelText) ? @string/cancel : dialog.cancelText}"
+ android:textSize="14sp" />
<Button
android:id="@+id/action2"
+ style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_below="@+id/text"
- android:layout_toStartOf="@+id/action1"
+ android:layout_below="@+id/cancel"
+ android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/default_margin"
+ android:layout_marginEnd="8dp"
+ android:onClick="@{handler::onAction2}"
android:text="@{dialog.action2Text}"
android:textSize="14sp"
- android:visibility="@{TextUtils.isEmpty(dialog.action2Text) ? View.GONE : View.VISIBLE}"
- android:onClick="@{handler::onAction2}"
- style="@style/Widget.MaterialComponents.Button.TextButton.Dialog" />
+ android:visibility="@{TextUtils.isEmpty(dialog.action2Text) ? View.GONE : View.VISIBLE}" />
<Button
android:id="@+id/action1"
+ style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_below="@+id/action2"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/default_margin"
android:layout_marginEnd="8dp"
- android:layout_below="@+id/text"
+ android:onClick="@{handler::onAction1}"
android:text="@{dialog.action1Text}"
android:textSize="14sp"
- android:visibility="@{TextUtils.isEmpty(dialog.action1Text) ? View.GONE : View.VISIBLE}"
- android:onClick="@{handler::onAction1}"
- style="@style/Widget.MaterialComponents.Button.TextButton.Dialog" />
+ android:visibility="@{TextUtils.isEmpty(dialog.action1Text) ? View.GONE : View.VISIBLE}" />
</RelativeLayout>
</ScrollView>
</layout>
More information about the Android
mailing list