[Android] Improve widgets material you colors and micro layout

Nicolas Pomepuy git at videolan.org
Wed May 18 09:57:56 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri May  6 08:59:12 2022 +0200| [16520e9d1547bec870f97db5b8d912339c1d0eee] | committer: Duncan McNamara

Improve widgets material you colors and micro layout

> https://code.videolan.org/videolan/vlc-android/commit/16520e9d1547bec870f97db5b8d912339c1d0eee
---

 application/vlc-android/res/layout/widget_micro.xml                   | 4 ++--
 .../src/org/videolan/vlc/widget/MiniPlayerAppWidgetProvider.kt        | 2 +-
 .../vlc-android/src/org/videolan/vlc/widget/utils/WidgetUtils.kt      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/application/vlc-android/res/layout/widget_micro.xml b/application/vlc-android/res/layout/widget_micro.xml
index 7d4d5e5f4..24cb2e519 100644
--- a/application/vlc-android/res/layout/widget_micro.xml
+++ b/application/vlc-android/res/layout/widget_micro.xml
@@ -84,7 +84,7 @@
             android:layout_height="48dp"
                 android:contentDescription="@string/configure_widget"
             android:scaleType="center"
-            android:layout_alignParentTop="true"
-            android:layout_alignParentRight="true" />
+            android:layout_alignTop="@id/player_container_background"
+            android:layout_alignRight="@id/player_container_background" />
 
 </RelativeLayout>
\ No newline at end of file
diff --git a/application/vlc-android/src/org/videolan/vlc/widget/MiniPlayerAppWidgetProvider.kt b/application/vlc-android/src/org/videolan/vlc/widget/MiniPlayerAppWidgetProvider.kt
index df1deb46a..da37c58b0 100644
--- a/application/vlc-android/src/org/videolan/vlc/widget/MiniPlayerAppWidgetProvider.kt
+++ b/application/vlc-android/src/org/videolan/vlc/widget/MiniPlayerAppWidgetProvider.kt
@@ -227,7 +227,7 @@ class MiniPlayerAppWidgetProvider : AppWidgetProvider() {
                 views.setImageViewBitmap(R.id.seek_rewind, context.getColoredBitmapFromColor(R.drawable.ic_widget_rewind_10, foregroundColor))
                 views.setImageViewBitmap(R.id.seek_forward, context.getColoredBitmapFromColor(R.drawable.ic_widget_forward_10, foregroundColor))
             }
-            views.setImageViewBitmap(R.id.play_pause_background, context.getColoredBitmapFromColor(R.drawable.widget_rectangle_background, backgroundColor, 52.dp, 52.dp))
+            views.setImageViewBitmap(R.id.play_pause_background, context.getColoredBitmapFromColor(R.drawable.widget_rectangle_background, foregroundColorSecondary, 52.dp, 52.dp))
             views.setImageViewBitmap(R.id.widget_configure, if (widgetCacheEntry.widget.showConfigure) context.getColoredBitmapFromColor(R.drawable.ic_widget_configure, foregroundColor, 24.dp, 24.dp) else null)
             if (widgetType == WidgetType.PILL) views.setImageViewBitmap(R.id.cover_background, context.getColoredBitmapFromColor(R.drawable.widget_circle, secondaryBackgroundColor, 48.dp, 48.dp))
         }
diff --git a/application/vlc-android/src/org/videolan/vlc/widget/utils/WidgetUtils.kt b/application/vlc-android/src/org/videolan/vlc/widget/utils/WidgetUtils.kt
index f25336b9a..2242dc04f 100644
--- a/application/vlc-android/src/org/videolan/vlc/widget/utils/WidgetUtils.kt
+++ b/application/vlc-android/src/org/videolan/vlc/widget/utils/WidgetUtils.kt
@@ -47,7 +47,7 @@ import kotlin.random.Random
  */
 fun Widget.getForegroundColor(context: Context, secondary: Boolean = false, palette: Palette?): Int {
     val untreatedColor = when {
-        theme == 0 -> ContextCompat.getColor(context, if (lightTheme) if (secondary) android.R.color.system_accent2_600 else android.R.color.system_accent2_500 else if (secondary) android.R.color.system_accent1_200 else android.R.color.system_accent1_400)
+        theme == 0 -> ContextCompat.getColor(context, if (!lightTheme) if (secondary) android.R.color.system_accent2_700 else android.R.color.system_accent2_400 else if (secondary) android.R.color.system_accent1_200 else android.R.color.system_accent1_500)
         theme == 1 -> getPaletteColor(context, palette, true, secondary, lightTheme)
         else -> if (secondary) foregroundColor.lightenOrDarkenColor(0.3F) else foregroundColor
     }



More information about the Android mailing list