[Android] Implement new empty view icon for favorites

Nicolas Pomepuy git at videolan.org
Tue Mar 14 11:59:20 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Feb 21 13:30:55 2023 +0100| [6ea6e25f9f0bc65ee023b851e28f53709f45a590] | committer: Nicolas Pomepuy

Implement new empty view icon for favorites

> https://code.videolan.org/videolan/vlc-android/commit/6ea6e25f9f0bc65ee023b851e28f53709f45a590
---

 application/resources/src/main/res/drawable/ic_fav_empty.xml   | 10 ++++++++++
 .../src/org/videolan/vlc/gui/view/EmptyLoadingStateView.kt     |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/application/resources/src/main/res/drawable/ic_fav_empty.xml b/application/resources/src/main/res/drawable/ic_fav_empty.xml
new file mode 100644
index 0000000000..da11b1ee70
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_fav_empty.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="54dp"
+    android:height="54dp"
+    android:viewportWidth="96"
+    android:viewportHeight="96">
+    <path
+        android:fillColor="@color/grey400"
+        android:pathData="m48,10.004c-3.967,-0 -7.549,2.745 -9.094,6.398l-4.311,12.93 -5.938,17.824 -2.971,8.91h-6.264c-1.974,0 -3.812,1.491 -4.389,3.459l-3.459,11.77c-1.13,3.862 -2.251,7.696 -3.387,11.578 -0.475,1.622 -0,2.816 0.767,3.641 0.475,0.511 1.062,0.881 1.602,1.127 0.229,0.101 0.417,0.17 0.602,0.23 2.026,0.346 4.317,0.035 7.207,-1.752 10.513,-6.513 13.141,6.516 23.684,0 10.513,-6.513 13.139,6.516 23.682,0 8.685,-5.381 11.992,2.567 18.822,1.822 0.266,-0.058 0.54,-0.147 0.887,-0.301 0.54,-0.246 1.127,-0.616 1.602,-1.127 0.766,-0.825 1.243,-2.018 0.767,-3.641 -1.135,-3.882 -2.256,-7.716 -3.387,-11.578l-3.459,-11.77c-0.577,-1.968 -2.414,-3.459 -4.389,-3.459h-6.264l-2.969,-8.91 -5.939,-17.824 -4.275,-12.826C55.611,12.799 52.005,10.004 48,10.004ZM42.631,51.328c0.842,0.006 1.702,0.25 2.494,0.793 1.128,0.768 1.823,2.07 1.871,3.43 0.112,3.103 -2.637,5.59 -6.836,9.404l-0.08,0.074c-0.608,0.552 -1.545,0.552 -2.152,-0.01l-0.088,-0.08c-4.198,-3.799 -6.94,-6.286 -6.836,-9.389 0.048,-1.36
  0.743,-2.662 1.871,-3.43 2.111,-1.439 4.718,-0.768 6.125,0.879 0.88,-1.03 2.228,-1.681 3.631,-1.672zM59.723,53.746c0.631,0.004 1.277,0.187 1.871,0.594 0.846,0.576 1.368,1.555 1.404,2.574 0.084,2.327 -1.98,4.192 -5.129,7.053l-0.059,0.055c-0.456,0.414 -1.158,0.414 -1.613,-0.008l-0.066,-0.059c-3.149,-2.849 -5.207,-4.714 -5.129,-7.041 0.036,-1.02 0.559,-1.998 1.404,-2.574 1.583,-1.08 3.538,-0.575 4.594,0.66 0.66,-0.772 1.67,-1.261 2.723,-1.254z"
+        android:strokeWidth="0.264596" />
+</vector>
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/view/EmptyLoadingStateView.kt b/application/vlc-android/src/org/videolan/vlc/gui/view/EmptyLoadingStateView.kt
index da94b69768..54cd549315 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/view/EmptyLoadingStateView.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/view/EmptyLoadingStateView.kt
@@ -75,7 +75,7 @@ class EmptyLoadingStateView : FrameLayout {
             loadingTitle.visibility = if (value == EmptyLoadingState.LOADING) View.VISIBLE else View.GONE
             emptyTextView.visibility = if (value in arrayOf(EmptyLoadingState.EMPTY, EmptyLoadingState.EMPTY_SEARCH, EmptyLoadingState.EMPTY_FAVORITES)) View.VISIBLE else View.GONE
             emptyImageView.visibility = if (value in arrayOf(EmptyLoadingState.EMPTY,EmptyLoadingState.MISSING_PERMISSION, EmptyLoadingState.EMPTY_SEARCH, EmptyLoadingState.EMPTY_FAVORITES)) View.VISIBLE else View.GONE
-            emptyImageView.setImageBitmap(context.getBitmapFromDrawable(if (value in arrayOf(EmptyLoadingState.EMPTY, EmptyLoadingState.EMPTY_SEARCH, EmptyLoadingState.EMPTY_FAVORITES)) R.drawable.ic_empty else R.drawable.ic_empty_warning))
+            emptyImageView.setImageBitmap(context.getBitmapFromDrawable(if (value == EmptyLoadingState.EMPTY_FAVORITES) R.drawable.ic_fav_empty else if (value in arrayOf(EmptyLoadingState.EMPTY, EmptyLoadingState.EMPTY_SEARCH, EmptyLoadingState.EMPTY_FAVORITES)) R.drawable.ic_empty else R.drawable.ic_empty_warning))
             permissionTitle.visibility = if (value == EmptyLoadingState.MISSING_PERMISSION) View.VISIBLE else View.GONE
             permissionTextView.visibility = if (value == EmptyLoadingState.MISSING_PERMISSION) View.VISIBLE else View.GONE
             grantPermissionButton.visibility = if (value == EmptyLoadingState.MISSING_PERMISSION) View.VISIBLE else View.GONE



More information about the Android mailing list