[Android] Copy search button in browser layout

Geoffrey Métais git at videolan.org
Mon Jul 2 17:47:04 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jul  2 17:46:17 2018 +0200| [e0d87ff6427dd29e877e17dc8fabb04c24bb8f1f] | committer: Geoffrey Métais

Copy search button in browser layout

include causes ConstraintLayout animation crash

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

 vlc-android/res/layout/directory_browser.xml | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/vlc-android/res/layout/directory_browser.xml b/vlc-android/res/layout/directory_browser.xml
index 254c664f3..38c237383 100644
--- a/vlc-android/res/layout/directory_browser.xml
+++ b/vlc-android/res/layout/directory_browser.xml
@@ -14,13 +14,28 @@
         <android.support.constraint.ConstraintLayout
             android:layout_width="match_parent"
             android:layout_height="match_parent" >
-            <include layout="@layout/button_search"
-                android:layout_width="@dimen/default_content_width"
+            <!-- Extract from button_search.xml, include causes animation crash -->
+            <Button xmlns:android="http://schemas.android.com/apk/res/android"
+                xmlns:tools="http://schemas.android.com/tools"
+                android:id="@+id/searchButton"
+                android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 app:layout_constraintLeft_toLeftOf="parent"
                 app:layout_constraintRight_toRightOf="parent"
                 app:layout_constraintTop_toTopOf="parent"
-                android:background="?attr/background_default" />
+                tools:targetApi="11"
+                style="?android:attr/borderlessButtonStyle"
+                android:layout_marginTop="@dimen/default_margin"
+                android:layout_marginLeft="@dimen/default_margin"
+                android:layout_marginStart="@dimen/default_margin"
+                android:layout_marginRight="@dimen/default_margin"
+                android:layout_marginEnd="@dimen/default_margin"
+                android:text="@string/search_global"
+                android:gravity="center_horizontal"
+                android:textAppearance="@style/Result.Title"
+                android:focusable="true"
+                android:onClick="onClick"
+                android:visibility="gone" />
             <TextView
                 android:id="@+id/favorites_title"
                 android:layout_width="@dimen/default_content_width"



More information about the Android mailing list