[Android] Fix playlist crash when using a secondary display

Nicolas Pomepuy git at videolan.org
Thu Jul 4 15:43:51 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu Jul  4 08:16:18 2019 +0200| [1eb42a860f14bccbda5a8d2002a333ad370500a7] | committer: Geoffrey Métais

Fix playlist crash when using a secondary display

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

 vlc-android/res/layout/player_remote_control.xml | 59 ++++++++++++++++++++----
 1 file changed, 50 insertions(+), 9 deletions(-)

diff --git a/vlc-android/res/layout/player_remote_control.xml b/vlc-android/res/layout/player_remote_control.xml
index 51ff0f6f6..309cc05a9 100644
--- a/vlc-android/res/layout/player_remote_control.xml
+++ b/vlc-android/res/layout/player_remote_control.xml
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent">
+                android:layout_width="fill_parent"
+                android:layout_height="fill_parent"
+                xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <!--
      the double FrameLayout is necessary here to do cropping on the bottom right
@@ -88,13 +89,53 @@
 
     </RelativeLayout>
 
-    <androidx.recyclerview.widget.RecyclerView
-        android:id="@+id/video_playlist"
-        android:layout_width="480dp"
-        android:layout_height="480dp"
-        android:layout_centerInParent="true"
-        android:background="@drawable/rounded_corners"
-        android:visibility="gone" />
+    <androidx.constraintlayout.widget.ConstraintLayout
+            android:layout_width="match_parent"
+
+            android:maxWidth="480dp"
+            android:layout_centerHorizontal="true"
+            android:background="@color/playerbackground"
+            android:id="@+id/video_playlist_container"
+            android:visibility="gone"
+            android:layout_height="match_parent">
+
+        <com.google.android.material.textfield.TextInputLayout
+                android:id="@+id/playlist_search_text"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:visibility="visible"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                android:paddingLeft="8dp"
+                android:paddingRight="8dp"
+                android:layout_marginTop="8dp">
+
+            <EditText
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:hint="@string/search_hint"
+                    android:focusable="true"
+                    android:nextFocusDown="@+id/video_playlist"
+                    android:id="@+id/playlist_search_edittext"
+                    android:imeOptions="actionSearch"
+                    android:inputType="textFilter"/>
+        </com.google.android.material.textfield.TextInputLayout>
+
+
+        <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/video_playlist"
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:focusable="true"
+                android:nextFocusUp="@+id/playlist_search_edittext"
+                android:descendantFocusability="afterDescendants"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintBottom_toBottomOf="parent"
+                android:layout_marginTop="8dp"
+                app:layout_constraintTop_toBottomOf="@+id/playlist_search_text"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
 
     <androidx.appcompat.widget.ViewStubCompat
         android:id="@+id/player_options_stub"



More information about the Android mailing list