Skip to content
Snippets Groups Projects
Commit d672af21 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Duncan McNamara
Browse files

OpenSubtitles: add a reset button to fallback to the search by hash

parent 6b697b05
No related branches found
No related tags found
1 merge request!2017use new OpenSubtitles API
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment