[Android] OpenSubtitles: rework the form buttons layout

Nicolas Pomepuy git at videolan.org
Thu Nov 21 13:19:11 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Nov 21 13:54:01 2024 +0100| [45ef0bb5164f2435e9646ed9ff1f18cb3cf60101] | committer: Duncan McNamara

OpenSubtitles: rework the form buttons layout

> https://code.videolan.org/videolan/vlc-android/commit/45ef0bb5164f2435e9646ed9ff1f18cb3cf60101
---

 .../res/layout/subtitle_downloader_dialog.xml      | 49 +++++++++++-----------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/application/vlc-android/res/layout/subtitle_downloader_dialog.xml b/application/vlc-android/res/layout/subtitle_downloader_dialog.xml
index 8b49f42c1d..cbcf5a8017 100644
--- a/application/vlc-android/res/layout/subtitle_downloader_dialog.xml
+++ b/application/vlc-android/res/layout/subtitle_downloader_dialog.xml
@@ -226,25 +226,6 @@
                             android:visibility="@{viewmodel.observableInEditMode.get() ? View.VISIBLE : View.GONE}" />
                 </com.google.android.material.textfield.TextInputLayout>
 
-                <com.google.android.material.checkbox.MaterialCheckBox
-                        android:id="@+id/checkBox"
-                        android:layout_width="0dp"
-                        android:layout_height="wrap_content"
-                        android:layout_marginStart="12dp"
-                        android:layout_marginEnd="16dp"
-                        android:checked="@={viewmodel.observableSearchHearingImpaired.get()}"
-                        android:paddingStart="4dp"
-                        android:text="@string/sub_result_by_name_hearing_impaired"
-                        android:nextFocusRight="@+id/search_button"
-                        android:nextFocusDown="@+id/search_button"
-                        android:nextFocusForward="@+id/search_button"
-                        android:visibility="@{viewmodel.observableInEditMode.get() ? View.VISIBLE : View.GONE}"
-                        app:layout_constraintBottom_toTopOf="@+id/search_button"
-                        app:layout_constraintEnd_toEndOf="parent"
-                        app:layout_constraintHorizontal_bias="0.5"
-                        app:layout_constraintStart_toStartOf="parent"
-                        app:layout_constraintTop_toBottomOf="@+id/language_list_spinner" />
-
                 <org.videolan.vlc.gui.view.LanguageSelector
                         android:id="@+id/language_list_spinner"
                         android:layout_width="0dp"
@@ -264,17 +245,37 @@
                         app:layout_constraintStart_toStartOf="parent"
                         app:layout_constraintTop_toBottomOf="@+id/episodeContainer" />
 
+                <com.google.android.material.checkbox.MaterialCheckBox
+                        android:id="@+id/checkBox"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="12dp"
+                        android:layout_marginEnd="16dp"
+                        android:checked="@={viewmodel.observableSearchHearingImpaired.get()}"
+                        android:nextFocusRight="@+id/search_button"
+                        android:nextFocusDown="@+id/search_button"
+                        android:nextFocusForward="@+id/search_button"
+                        android:paddingStart="4dp"
+                        android:text="@string/sub_result_by_name_hearing_impaired"
+                        android:visibility="@{viewmodel.observableInEditMode.get() ? View.VISIBLE : View.GONE}"
+                        app:layout_constraintBottom_toTopOf="@+id/reset_button"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintTop_toBottomOf="@+id/language_list_spinner" />
+
                 <Button
                         android:id="@+id/reset_button"
                         style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginTop="24dp"
                         android:layout_marginEnd="16dp"
                         android:focusable="true"
                         android:text="@string/reset"
                         android:visibility="@{viewmodel.observableInEditMode.get() ? View.VISIBLE : View.GONE}"
-                        app:layout_constraintEnd_toStartOf="@+id/search_button"
-                        app:layout_constraintTop_toTopOf="@+id/search_button" />
+                        app:layout_constraintBottom_toTopOf="@+id/search_button"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintTop_toBottomOf="@+id/checkBox" />
 
                 <Button
                         android:id="@+id/cancel_button"
@@ -285,7 +286,7 @@
                         android:focusable="true"
                         android:text="@string/cancel"
                         android:visibility="@{viewmodel.observableInEditMode.get() ? View.VISIBLE : View.GONE}"
-                        app:layout_constraintEnd_toStartOf="@+id/reset_button"
+                        app:layout_constraintEnd_toStartOf="@+id/search_button"
                         app:layout_constraintTop_toTopOf="@+id/search_button" />
 
                 <Button
@@ -293,16 +294,14 @@
                         style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
                         android:layout_width="0dp"
                         android:layout_height="wrap_content"
-                        android:layout_marginTop="16dp"
                         android:layout_marginEnd="16dp"
-                        android:layout_marginBottom="8dp"
                         android:enabled="@{!TextUtils.isEmpty(viewmodel.observableSearchName.get().trim())}"
                         android:focusable="true"
                         android:text="@android:string/search_go"
                         android:visibility="@{viewmodel.observableInEditMode.get() ? View.VISIBLE : View.GONE}"
                         app:layout_constraintBottom_toBottomOf="parent"
                         app:layout_constraintEnd_toEndOf="parent"
-                        app:layout_constraintTop_toBottomOf="@+id/checkBox" />
+                        app:layout_constraintTop_toBottomOf="@+id/reset_button" />
             </androidx.constraintlayout.widget.ConstraintLayout>
 
             <androidx.recyclerview.widget.RecyclerView



More information about the Android mailing list