[Android] OpenSubtitles: add a reset button to fallback to the search by hash
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 08:18:38 2024 +0100| [d672af2136384471386b5606462431565e88b480] | committer: Duncan McNamara
OpenSubtitles: add a reset button to fallback to the search by hash
> https://code.videolan.org/videolan/vlc-android/commit/d672af2136384471386b5606462431565e88b480
---
.../vlc-android/res/layout/subtitle_downloader_dialog.xml | 14 +++++++++++++-
.../vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt | 5 +++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/application/vlc-android/res/layout/subtitle_downloader_dialog.xml b/application/vlc-android/res/layout/subtitle_downloader_dialog.xml
index d9d566d247..eb88150ac0 100644
--- a/application/vlc-android/res/layout/subtitle_downloader_dialog.xml
+++ b/application/vlc-android/res/layout/subtitle_downloader_dialog.xml
@@ -264,6 +264,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/episodeContainer" />
+ <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_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" />
+
<Button
android:id="@+id/cancel_button"
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
@@ -273,7 +285,7 @@
android:focusable="true"
android:text="@string/cancel"
android:visibility="@{viewmodel.observableInEditMode.get() ? View.VISIBLE : View.GONE}"
- app:layout_constraintEnd_toStartOf="@+id/search_button"
+ app:layout_constraintEnd_toStartOf="@+id/reset_button"
app:layout_constraintTop_toTopOf="@+id/search_button" />
<Button
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt
index 3f5cb6fda9..2d81f107f3 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitleDownloaderDialogFragment.kt
@@ -188,6 +188,11 @@ class SubtitleDownloaderDialogFragment : VLCBottomSheetDialogFragment() {
viewModel.observableInEditMode.set(false)
}
+ binding.resetButton.setOnClickListener {
+ viewModel.observableInEditMode.set(false)
+ viewModel.search(true)
+ }
+
binding.openSubEdit.setOnClickListener {
if (viewModel.observableInEditMode.get() == false) {
//fill form
More information about the Android
mailing list