[Android] New discover screen

Nicolas Pomepuy git at videolan.org
Tue Oct 25 06:38:26 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Oct 11 14:34:00 2022 +0200| [8ec92ca9e5467978827130db25deb6c9c7fd77db] | committer: Nicolas Pomepuy

New discover screen

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

 .../src/main/res/drawable/ic_menu_discover.xml     | 34 +++++++++++++++
 .../resources/src/main/res/values/strings.xml      |  1 +
 .../vlc-android/res/layout/discover_browser.xml    | 40 ++++++++++++++++++
 .../vlc-android/res/menu/bottom_navigation.xml     |  6 +--
 .../vlc/gui/discover/DiscoverBrowserFragment.kt    | 49 ++++++++++++++++++++++
 .../src/org/videolan/vlc/gui/helpers/Navigator.kt  |  3 +-
 6 files changed, 129 insertions(+), 4 deletions(-)

diff --git a/application/resources/src/main/res/drawable/ic_menu_discover.xml b/application/resources/src/main/res/drawable/ic_menu_discover.xml
new file mode 100644
index 000000000..e94b41835
--- /dev/null
+++ b/application/resources/src/main/res/drawable/ic_menu_discover.xml
@@ -0,0 +1,34 @@
+<!--
+  ~ *************************************************************************
+  ~  ic_menu_discover.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.
+  ~ ***************************************************************************
+  ~
+  ~
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="48dp"
+        android:height="48dp"
+        android:tint="#757575"
+        android:viewportWidth="24"
+        android:viewportHeight="24">
+    <path
+            android:fillColor="@android:color/white"
+            android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z" />
+</vector>
diff --git a/application/resources/src/main/res/values/strings.xml b/application/resources/src/main/res/values/strings.xml
index 9879caeb4..f8a44f442 100644
--- a/application/resources/src/main/res/values/strings.xml
+++ b/application/resources/src/main/res/values/strings.xml
@@ -1025,6 +1025,7 @@
     <string name="enable_screenshot_gesture">Tap with 3 fingers</string>
     <string name="enable_screenshot_button">Show the screenshot button</string>
     <string name="enable_screenshot_button_and_gesture">Button and gesture</string>
+    <string name="discover">Discover</string>
 
 
 
diff --git a/application/vlc-android/res/layout/discover_browser.xml b/application/vlc-android/res/layout/discover_browser.xml
new file mode 100644
index 000000000..dd7bb2149
--- /dev/null
+++ b/application/vlc-android/res/layout/discover_browser.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  ~ *************************************************************************
+  ~  discover_browser.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.
+  ~ ***************************************************************************
+  ~
+  ~
+  -->
+
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        xmlns:tools="http://schemas.android.com/tools"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+    <TextView
+            android:id="@+id/textView37"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="Soon!"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/application/vlc-android/res/menu/bottom_navigation.xml b/application/vlc-android/res/menu/bottom_navigation.xml
index 1b2995d1e..5abae18f5 100644
--- a/application/vlc-android/res/menu/bottom_navigation.xml
+++ b/application/vlc-android/res/menu/bottom_navigation.xml
@@ -40,9 +40,9 @@
             android:title="@string/browse"
             android:icon="@drawable/ic_menu_folder" />
     <item
-            android:id="@+id/nav_playlists"
-            android:title="@string/playlists"
-            android:icon="@drawable/ic_menu_playlist" />
+            android:id="@+id/nav_discover"
+            android:title="@string/discover"
+            android:icon="@drawable/ic_menu_discover" />
     <item
             android:id="@+id/nav_more"
             android:title="@string/more"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/discover/DiscoverBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/discover/DiscoverBrowserFragment.kt
new file mode 100644
index 000000000..5ae7ccb0d
--- /dev/null
+++ b/application/vlc-android/src/org/videolan/vlc/gui/discover/DiscoverBrowserFragment.kt
@@ -0,0 +1,49 @@
+/*
+ * ************************************************************************
+ *  DiscoverBrowserFragment.kt
+ * *************************************************************************
+ * 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.
+ * **************************************************************************
+ *
+ *
+ */
+
+package org.videolan.vlc.gui.discover
+
+import android.os.Bundle
+import android.view.*
+import androidx.appcompat.view.ActionMode
+import org.videolan.vlc.R
+import org.videolan.vlc.gui.BaseFragment
+
+class DiscoverBrowserFragment : BaseFragment() {
+
+
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
+        return inflater.inflate(R.layout.discover_browser, container, false)
+    }
+
+
+    override fun getTitle() = getString(R.string.discover)
+
+    override fun onCreateActionMode(mode: ActionMode?, menu: Menu?) = false
+
+    override fun onActionItemClicked(mode: ActionMode?, item: MenuItem?) = false
+
+    override fun onDestroyActionMode(mode: ActionMode?) { }
+
+}
\ No newline at end of file
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
index be1a12a8f..cb5c238f4 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
@@ -43,6 +43,7 @@ import org.videolan.vlc.gui.*
 import org.videolan.vlc.gui.audio.AudioBrowserFragment
 import org.videolan.vlc.gui.browser.BaseBrowserFragment
 import org.videolan.vlc.gui.browser.MainBrowserFragment
+import org.videolan.vlc.gui.discover.DiscoverBrowserFragment
 import org.videolan.vlc.gui.helpers.UiTools.isTablet
 import org.videolan.vlc.gui.video.VideoBrowserFragment
 import org.videolan.vlc.util.getScreenWidth
@@ -86,7 +87,7 @@ class Navigator : NavigationBarView.OnItemSelectedListener, DefaultLifecycleObse
         return when (id) {
             R.id.nav_audio -> AudioBrowserFragment()
             R.id.nav_directories -> MainBrowserFragment()
-            R.id.nav_playlists -> PlaylistFragment()
+            R.id.nav_discover -> DiscoverBrowserFragment()
             R.id.nav_more -> MoreFragment()
             else -> VideoBrowserFragment()
         }



More information about the Android mailing list