[Android] Adapt wizard dialog size to device screen

Geoffrey Métais git at videolan.org
Thu Jan 24 16:02:06 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 24 16:01:38 2019 +0100| [1d9e5572e793cb3fc5ecbfa5368f37d0bc9dec1f] | committer: Geoffrey Métais

Adapt wizard dialog size to device screen

> https://code.videolan.org/videolan/vlc-android/commit/1d9e5572e793cb3fc5ecbfa5368f37d0bc9dec1f
---

 vlc-android/res/layout/ml_wizard_activity.xml | 78 ++++++++++++++-------------
 vlc-android/res/values-w480dp/dimens.xml      |  4 ++
 vlc-android/res/values-w600dp/dimens.xml      |  1 +
 vlc-android/res/values/dimens.xml             |  1 +
 4 files changed, 47 insertions(+), 37 deletions(-)

diff --git a/vlc-android/res/layout/ml_wizard_activity.xml b/vlc-android/res/layout/ml_wizard_activity.xml
index ee0c64405..528f9bfb2 100644
--- a/vlc-android/res/layout/ml_wizard_activity.xml
+++ b/vlc-android/res/layout/ml_wizard_activity.xml
@@ -1,44 +1,48 @@
 <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:android="http://schemas.android.com/apk/res/android">
-<androidx.constraintlayout.widget.ConstraintLayout
-    android:layout_width="320dp"
-    android:layout_height="wrap_content"
-    android:padding="16dp">
+    <androidx.core.widget.NestedScrollView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content">
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:layout_width="@dimen/wizard_dialog_width"
+            android:layout_height="wrap_content"
+            android:padding="16dp">
 
-    <Switch
-        android:id="@+id/wizard_check_scan"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="16dp"
-        android:checked="true"
-        android:checkable="true"
-        android:text="@string/ml_wizard_scan_checkbox"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/wizard_description" />
+            <Switch
+                android:id="@+id/wizard_check_scan"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="16dp"
+                android:checked="true"
+                android:checkable="true"
+                android:text="@string/ml_wizard_scan_checkbox"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/wizard_description" />
 
-    <Button
-        android:id="@+id/wizard_validate"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="apply"
-        android:text="@string/ok"
-        android:layout_marginTop="16dp"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/wizard_check_scan"
-        style="@style/Widget.MaterialComponents.Button.TextButton.Dialog" />
+            <Button
+                android:id="@+id/wizard_validate"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:onClick="apply"
+                android:text="@string/ok"
+                android:layout_marginTop="16dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/wizard_check_scan"
+                style="@style/Widget.MaterialComponents.Button.TextButton.Dialog" />
 
-    <TextView
-        android:id="@+id/wizard_description"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_margin="8dp"
-        android:text="@string/ml_wizard_description"
-        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-</androidx.constraintlayout.widget.ConstraintLayout>
+            <TextView
+                android:id="@+id/wizard_description"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_margin="8dp"
+                android:text="@string/ml_wizard_description"
+                android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </androidx.core.widget.NestedScrollView>
 </layout>
diff --git a/vlc-android/res/values-w480dp/dimens.xml b/vlc-android/res/values-w480dp/dimens.xml
new file mode 100644
index 000000000..e47f14e13
--- /dev/null
+++ b/vlc-android/res/values-w480dp/dimens.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <dimen name="wizard_dialog_width">416dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/vlc-android/res/values-w600dp/dimens.xml b/vlc-android/res/values-w600dp/dimens.xml
index 416c68be1..0476fdccb 100644
--- a/vlc-android/res/values-w600dp/dimens.xml
+++ b/vlc-android/res/values-w600dp/dimens.xml
@@ -4,4 +4,5 @@
     <!--MRLPanel-->
     <dimen name="mrl_panel_min_width">380dp</dimen>
     <dimen name="subs_dl_dialog_width">512dp</dimen>
+    <dimen name="wizard_dialog_width">448dp</dimen>
 </resources>
\ No newline at end of file
diff --git a/vlc-android/res/values/dimens.xml b/vlc-android/res/values/dimens.xml
index 3e04e4d65..b1c780036 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -94,4 +94,5 @@
     <dimen name="audio_item_header_padding">4dp</dimen>
     <dimen name="audio_item_padding_botom">4dp</dimen>
     <dimen name="audio_item_title_size">14sp</dimen>
+    <dimen name="wizard_dialog_width">288dp</dimen>
 </resources>



More information about the Android mailing list