[Android] History: add media missing grey overlay
Duncan McNamara
git at videolan.org
Wed Feb 16 14:15:51 UTC 2022
vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Tue Feb 15 14:21:16 2022 +0100| [7083647e1ca06a92131e24a6fe6d6298966bacd0] | committer: Duncan McNamara
History: add media missing grey overlay
> https://code.videolan.org/videolan/vlc-android/commit/7083647e1ca06a92131e24a6fe6d6298966bacd0
---
application/vlc-android/res/layout/history_item.xml | 13 +++++++++++++
application/vlc-android/res/layout/history_item_card.xml | 13 +++++++++++++
2 files changed, 26 insertions(+)
diff --git a/application/vlc-android/res/layout/history_item.xml b/application/vlc-android/res/layout/history_item.xml
index 5fa9f13d6..efea7a496 100644
--- a/application/vlc-android/res/layout/history_item.xml
+++ b/application/vlc-android/res/layout/history_item.xml
@@ -80,6 +80,17 @@
app:layout_constraintTop_toTopOf="parent"
app:media="@{media}" />
+ <View
+ android:id="@+id/missing_overlay"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:visibility="@{!media.isPresent ? View.VISIBLE : View.GONE}"
+ android:background="?attr/disabled_overlay_color"
+ vlc:layout_constraintBottom_toBottomOf="@+id/song_marker"
+ vlc:layout_constraintEnd_toEndOf="@+id/icon"
+ vlc:layout_constraintStart_toStartOf="@+id/song_marker"
+ vlc:layout_constraintTop_toTopOf="@+id/song_marker" />
+
<ImageView
android:id="@+id/network_media"
android:layout_width="wrap_content"
@@ -118,6 +129,7 @@
android:maxLines="1"
android:layout_marginStart="16dp"
android:text="@{media.title}"
+ android:enabled="@{media.isPresent}"
app:layout_constraintBottom_toTopOf="@+id/subtitle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/constraintLayout4"
@@ -131,6 +143,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="@{media.description}"
+ android:enabled="@{media.isPresent}"
android:visibility="@{TextUtils.isEmpty(media.description) ? View.GONE : View.VISIBLE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
diff --git a/application/vlc-android/res/layout/history_item_card.xml b/application/vlc-android/res/layout/history_item_card.xml
index 568ee7329..f414a5d55 100644
--- a/application/vlc-android/res/layout/history_item_card.xml
+++ b/application/vlc-android/res/layout/history_item_card.xml
@@ -101,6 +101,17 @@
app:layout_constraintTop_toTopOf="parent"
app:media="@{media}" />
+ <View
+ android:id="@+id/missing_overlay"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:visibility="@{!media.isPresent ? View.VISIBLE : View.GONE}"
+ android:background="?attr/disabled_overlay_color"
+ vlc:layout_constraintBottom_toBottomOf="@+id/song_marker"
+ vlc:layout_constraintEnd_toEndOf="@+id/icon"
+ vlc:layout_constraintStart_toStartOf="@+id/song_marker"
+ vlc:layout_constraintTop_toTopOf="@+id/song_marker" />
+
<ImageView
android:id="@+id/network_media"
android:layout_width="wrap_content"
@@ -145,6 +156,7 @@
android:singleLine="true"
android:ellipsize="end"
app:ellipsizeMode="@{true}"
+ android:enabled="@{media.isPresent}"
app:layout_constraintBottom_toTopOf="@+id/subtitle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -159,6 +171,7 @@
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:text="@{media.description}"
+ android:enabled="@{media.isPresent}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
More information about the Android
mailing list