[Android] Widgets: update the preview

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


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed May 11 12:17:35 2022 +0200| [c8fc17289d81e14732560ecab9ebe03133e3cfdb] | committer: Duncan McNamara

Widgets: update the preview

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

 .../src/main/res/drawable/widget_preview_b.png     | Bin 28323 -> 0 bytes
 .../src/main/res/drawable/widget_preview_mini.png  | Bin 0 -> 70157 bytes
 .../src/main/res/drawable/widget_preview_w.png     | Bin 26802 -> 0 bytes
 .../vlc-android/res/layout/widget_mini_initial.xml |  66 +++++++++++++++++++++
 .../vlc-android/res/xml/widget_provider_b.xml      |   3 +-
 .../vlc-android/res/xml/widget_provider_mini.xml   |   4 +-
 .../vlc-android/res/xml/widget_provider_w.xml      |   3 +-
 7 files changed, 70 insertions(+), 6 deletions(-)

diff --git a/application/resources/src/main/res/drawable/widget_preview_b.png b/application/resources/src/main/res/drawable/widget_preview_b.png
deleted file mode 100644
index 4328ff19a..000000000
Binary files a/application/resources/src/main/res/drawable/widget_preview_b.png and /dev/null differ
diff --git a/application/resources/src/main/res/drawable/widget_preview_mini.png b/application/resources/src/main/res/drawable/widget_preview_mini.png
new file mode 100755
index 000000000..470aec8fa
Binary files /dev/null and b/application/resources/src/main/res/drawable/widget_preview_mini.png differ
diff --git a/application/resources/src/main/res/drawable/widget_preview_w.png b/application/resources/src/main/res/drawable/widget_preview_w.png
deleted file mode 100644
index a80b7e5e5..000000000
Binary files a/application/resources/src/main/res/drawable/widget_preview_w.png and /dev/null differ
diff --git a/application/vlc-android/res/layout/widget_mini_initial.xml b/application/vlc-android/res/layout/widget_mini_initial.xml
new file mode 100644
index 000000000..ab0cdc632
--- /dev/null
+++ b/application/vlc-android/res/layout/widget_mini_initial.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  ~ *************************************************************************
+  ~  widget_mini.xml
+  ~ **************************************************************************
+  ~ Copyright © 2022 VLC authors and VideoLAN
+  ~ Author: Nicolas POMEPUY
+  ~ This program is free software; you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation; either version 2 of the License, or
+  ~ (at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program; if not, write to the Free Software
+  ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+  ~ ***************************************************************************
+  ~
+  ~
+  -->
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <RelativeLayout
+            android:id="@+id/widget_container"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="@color/grey900">
+
+        <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_centerInParent="true"
+                android:layout_margin="8dp"
+                android:gravity="center_horizontal"
+                android:orientation="vertical">
+
+            <TextView
+                    android:id="@+id/app_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="4dp"
+                    android:layout_marginBottom="16dp"
+                    android:fontFamily="sans-serif-medium"
+                    android:gravity="center"
+                    android:text="@string/widget_default_text"
+                    android:textColor="@color/white"
+                    android:textSize="16sp" />
+
+            <ImageButton
+                    android:id="@+id/play_pause"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:background="@drawable/widget_touch_background"
+                    android:clickable="true"
+                    android:contentDescription="@string/resume_playback_short_title"
+                    android:scaleType="centerInside"
+                    android:src="@drawable/ic_widget_play" />
+        </LinearLayout>
+
+
+    </RelativeLayout>
+
+</layout>
\ No newline at end of file
diff --git a/application/vlc-android/res/xml/widget_provider_b.xml b/application/vlc-android/res/xml/widget_provider_b.xml
index 5821487ce..91f338b82 100644
--- a/application/vlc-android/res/xml/widget_provider_b.xml
+++ b/application/vlc-android/res/xml/widget_provider_b.xml
@@ -4,6 +4,5 @@
     android:resizeMode="horizontal|vertical"
     android:minResizeWidth="180dp"
     android:updatePeriodMillis="86400000"
-    android:initialLayout="@layout/widget_old"
-    android:previewImage="@drawable/widget_preview_b">
+    android:initialLayout="@layout/widget_old">
 </appwidget-provider>
\ No newline at end of file
diff --git a/application/vlc-android/res/xml/widget_provider_mini.xml b/application/vlc-android/res/xml/widget_provider_mini.xml
index d0ef6c937..231a6d722 100644
--- a/application/vlc-android/res/xml/widget_provider_mini.xml
+++ b/application/vlc-android/res/xml/widget_provider_mini.xml
@@ -25,12 +25,12 @@
 <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
         android:configure="org.videolan.vlc.widget.MiniPlayerConfigureActivity"
         android:widgetFeatures="reconfigurable"
-        android:initialLayout="@layout/widget_mini"
+        android:initialLayout="@layout/widget_mini_initial"
         android:minWidth="120dp"
         android:minHeight="48dp"
         android:minResizeWidth="120dp"
         android:minResizeHeight="48dp"
-        android:previewImage="@drawable/widget_preview_w"
+        android:previewImage="@drawable/widget_preview_mini"
         android:resizeMode="horizontal|vertical"
         android:targetCellWidth="4"
         android:targetCellHeight="1"
diff --git a/application/vlc-android/res/xml/widget_provider_w.xml b/application/vlc-android/res/xml/widget_provider_w.xml
index a82ec426e..91f338b82 100644
--- a/application/vlc-android/res/xml/widget_provider_w.xml
+++ b/application/vlc-android/res/xml/widget_provider_w.xml
@@ -4,6 +4,5 @@
     android:resizeMode="horizontal|vertical"
     android:minResizeWidth="180dp"
     android:updatePeriodMillis="86400000"
-    android:initialLayout="@layout/widget_old"
-    android:previewImage="@drawable/widget_preview_w">
+    android:initialLayout="@layout/widget_old">
 </appwidget-provider>
\ No newline at end of file



More information about the Android mailing list