[Android] Factorize audio player layout

Geoffrey Métais git at videolan.org
Wed Mar 1 16:11:57 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar  1 16:09:43 2017 +0100| [c99733a5061052286e27dd0be4653d91d161d453] | committer: Geoffrey Métais

Factorize audio player layout

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

 vlc-android/res/layout/audioplayercontainer.xml | 17 +++++++++++++++++
 vlc-android/res/layout/info_activity.xml        | 15 ++-------------
 vlc-android/res/layout/main.xml                 | 13 +------------
 vlc-android/res/layout/playlist_activity.xml    | 14 +-------------
 vlc-android/res/layout/secondary.xml            | 13 +------------
 5 files changed, 22 insertions(+), 50 deletions(-)

diff --git a/vlc-android/res/layout/audioplayercontainer.xml b/vlc-android/res/layout/audioplayercontainer.xml
new file mode 100644
index 0000000..c0cd248
--- /dev/null
+++ b/vlc-android/res/layout/audioplayercontainer.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout 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:id="@+id/audio_player_container"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:elevation="@dimen/audio_player_elevation"
+    android:visibility="gone"
+    app:layout_behavior="org.videolan.vlc.gui.helpers.BottomSheetBehavior"
+    tools:targetApi="lollipop">
+    <android.support.v7.widget.ViewStubCompat
+        android:id="@+id/audio_player_stub"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout="@layout/audioplayer"/>
+</FrameLayout>
\ No newline at end of file
diff --git a/vlc-android/res/layout/info_activity.xml b/vlc-android/res/layout/info_activity.xml
index 8543e91..4754d72 100644
--- a/vlc-android/res/layout/info_activity.xml
+++ b/vlc-android/res/layout/info_activity.xml
@@ -159,18 +159,7 @@
             android:src="@drawable/ic_fab_play"
             android:tint="@color/grey50" />
 
-        <FrameLayout
-            android:id="@+id/audio_player_container"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:elevation="@dimen/audio_player_elevation"
-            android:visibility="gone"
-            vlc:layout_behavior="android.support.design.widget.BottomSheetBehavior">
-            <android.support.v7.widget.ViewStubCompat
-                android:id="@+id/audio_player_stub"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout="@layout/audioplayer"/>
-        </FrameLayout>
+        <include layout="@layout/audioplayercontainer"/>
+
     </android.support.design.widget.CoordinatorLayout>
 </layout>
\ No newline at end of file
diff --git a/vlc-android/res/layout/main.xml b/vlc-android/res/layout/main.xml
index 09490dd..4a2cbaf 100644
--- a/vlc-android/res/layout/main.xml
+++ b/vlc-android/res/layout/main.xml
@@ -24,18 +24,7 @@
                 android:layout_height="match_parent"
                 app:layout_behavior="@string/appbar_scrolling_view_behavior" />
 
-            <FrameLayout
-                android:id="@+id/audio_player_container"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:visibility="gone"
-                app:layout_behavior="org.videolan.vlc.gui.helpers.BottomSheetBehavior">
-                <android.support.v7.widget.ViewStubCompat
-                    android:id="@+id/audio_player_stub"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout="@layout/audioplayer"/>
-            </FrameLayout>
+            <include layout="@layout/audioplayercontainer"/>
 
             <android.support.design.widget.FloatingActionButton
                 android:id="@+id/fab"
diff --git a/vlc-android/res/layout/playlist_activity.xml b/vlc-android/res/layout/playlist_activity.xml
index d915776..823d87b 100644
--- a/vlc-android/res/layout/playlist_activity.xml
+++ b/vlc-android/res/layout/playlist_activity.xml
@@ -75,18 +75,6 @@
             android:src="@drawable/ic_fab_play"
             android:tint="@color/grey50" />
 
-        <FrameLayout
-            android:id="@+id/audio_player_container"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:visibility="gone"
-            android:elevation="@dimen/audio_player_elevation"
-            vlc:layout_behavior="android.support.design.widget.BottomSheetBehavior">
-            <android.support.v7.widget.ViewStubCompat
-                android:id="@+id/audio_player_stub"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout="@layout/audioplayer"/>
-        </FrameLayout>
+        <include layout="@layout/audioplayercontainer"/>
     </android.support.design.widget.CoordinatorLayout>
 </layout>
\ No newline at end of file
diff --git a/vlc-android/res/layout/secondary.xml b/vlc-android/res/layout/secondary.xml
index f7a32f9..681d8c7 100644
--- a/vlc-android/res/layout/secondary.xml
+++ b/vlc-android/res/layout/secondary.xml
@@ -17,18 +17,7 @@
             vlc:layout_behavior="@string/appbar_scrolling_view_behavior"
             android:layout_height="match_parent" />
 
-        <FrameLayout
-            android:id="@+id/audio_player_container"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:visibility="gone"
-            vlc:layout_behavior="org.videolan.vlc.gui.helpers.BottomSheetBehavior">
-            <android.support.v7.widget.ViewStubCompat
-                android:id="@+id/audio_player_stub"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout="@layout/audioplayer"/>
-        </FrameLayout>
+        <include layout="@layout/audioplayercontainer"/>
 
         <android.support.design.widget.FloatingActionButton
             vlc:borderWidth="0dp"



More information about the Android mailing list