[Android] Fix the download subtitles download button style and click listener
Nicolas Pomepuy
git at videolan.org
Fri May 28 08:46:00 UTC 2021
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed May 26 13:24:33 2021 +0200| [d5097eac9982d78cf72223ee2dea8af1c43c434a] | committer: Nicolas Pomepuy
Fix the download subtitles download button style and click listener
> https://code.videolan.org/videolan/vlc-android/commit/d5097eac9982d78cf72223ee2dea8af1c43c434a
---
application/resources/src/main/res/drawable/ic_done.xml | 9 +++++++++
application/vlc-android/res/layout/subtitle_download_item.xml | 2 +-
.../src/org/videolan/vlc/gui/dialogs/SubtitlesAdapter.kt | 1 +
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/application/resources/src/main/res/drawable/ic_done.xml b/application/resources/src/main/res/drawable/ic_done.xml
new file mode 100644
index 000000000..cad6f523a
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_done.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:pathData="M9,16.2L4.8,12l-1.4,1.4L9,19 21,7l-1.4,-1.4L9,16.2z"
+ android:fillColor="@color/standard_selection_control_normal"/>
+</vector>
diff --git a/application/vlc-android/res/layout/subtitle_download_item.xml b/application/vlc-android/res/layout/subtitle_download_item.xml
index a5569410a..f6470cf69 100644
--- a/application/vlc-android/res/layout/subtitle_download_item.xml
+++ b/application/vlc-android/res/layout/subtitle_download_item.xml
@@ -67,7 +67,7 @@
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Download"
android:padding="4dp"
- android:src="@{subtitleItem.state == State.Downloaded ? @drawable/ic_ctx_done : @drawable/ic_download }"
+ android:src="@{subtitleItem.state == State.Downloaded ? @drawable/ic_done : @drawable/ic_download }"
android:visibility="@{subtitleItem.state == State.Downloading ? View.GONE : View.VISIBLE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitlesAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitlesAdapter.kt
index 08c06fba9..3f89984da 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitlesAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/SubtitlesAdapter.kt
@@ -48,6 +48,7 @@ internal class SubtitlesAdapter(private val eventActor: SendChannel<SubtitleEven
fun bind(subtitleItem: SubtitleItem?) {
binding.subtitleItem = subtitleItem
+ binding.downloadSub.setOnClickListener { itemView.performClick() }
binding.executePendingBindings()
}
}
More information about the Android
mailing list