[Android] Fix MRLPanels editText style
Habib Kazemi
git at videolan.org
Mon Aug 6 16:18:22 CEST 2018
vlc-android | branch: master | Habib Kazemi <kazemihabib1996 at gmail.com> | Sun Jul 29 16:15:03 2018 +0430| [93638339afe812083d22e202774ea16e6b392de6] | committer: Geoffrey Métais
Fix MRLPanels editText style
Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>
> https://code.videolan.org/videolan/vlc-android/commit/93638339afe812083d22e202774ea16e6b392de6
---
vlc-android/res/drawable/cursor_o.xml | 6 ++++
.../res/drawable/edittext_bottom_border.xml | 35 ++++++++++++++++++++++
vlc-android/res/layout/mrl_panel.xml | 19 +++++++-----
3 files changed, 53 insertions(+), 7 deletions(-)
diff --git a/vlc-android/res/drawable/cursor_o.xml b/vlc-android/res/drawable/cursor_o.xml
new file mode 100644
index 000000000..d4bcea7fb
--- /dev/null
+++ b/vlc-android/res/drawable/cursor_o.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle" >
+ <solid android:color="?colorPrimary" />
+ <size android:width="1.8dp" />
+</shape>
diff --git a/vlc-android/res/drawable/edittext_bottom_border.xml b/vlc-android/res/drawable/edittext_bottom_border.xml
new file mode 100644
index 000000000..d3cc3e6eb
--- /dev/null
+++ b/vlc-android/res/drawable/edittext_bottom_border.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ * edittext_bottom_border.xml
+ ~ *****************************************************************************
+ ~ Copyright © 2018 VLC authors and VideoLAN
+ ~
+ ~ 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.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="rectangle">
+ <stroke android:width="2dp" android:color="@color/orange700"/>
+ </shape>
+ </item>
+
+ <!--Hide all borders except bottom border-->
+ <item android:bottom="2dp">
+ <shape android:shape="rectangle">
+ <solid android:color="?background_default_darker"/>
+ </shape>
+ </item>
+</layer-list>
+
diff --git a/vlc-android/res/layout/mrl_panel.xml b/vlc-android/res/layout/mrl_panel.xml
index 2c39bed52..22d6f98b6 100644
--- a/vlc-android/res/layout/mrl_panel.xml
+++ b/vlc-android/res/layout/mrl_panel.xml
@@ -15,7 +15,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/background_default_darker"
- android:padding="@dimen/default_margin"
+ android:padding="32dp"
android:layoutDirection="ltr">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
@@ -23,17 +23,26 @@
android:layout_toLeftOf="@+id/send"
android:layout_toStartOf="@+id/send"
android:layout_marginTop="5dip"
+ android:layout_marginBottom="16dp"
android:id="@+id/mrl_edit">
+
+ <!--android:paddingTop ==> Space between cursor and top hint-->
+ <!--android:paddingBottom ==> Space between cursor and bottom border-->
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
- android:layout_margin="10dp"
android:hint="@string/open_mrl_dialog_msg"
android:inputType="textUri"
android:text="@{viewmodel.observableSearchText}"
+ android:textColor="?font_default"
android:afterTextChanged="@{viewmodel::afterSearchTextChanged}"
android:maxLines="2"
+ android:layout_marginRight="8dp"
+ android:paddingTop="10dp"
+ android:paddingBottom="5dp"
+ android:textCursorDrawable="@drawable/cursor_o"
+ android:background="@drawable/edittext_bottom_border"
android:imeOptions="actionGo"/>
</android.support.design.widget.TextInputLayout>
<ImageView
@@ -45,15 +54,11 @@
android:layout_alignBottom="@+id/mrl_edit"
android:layout_alignTop="@+id/mrl_edit"
android:scaleType="center"
- android:src="@drawable/ic_send"
- android:layout_marginRight="10dp"
- android:layout_marginEnd="10dp"/>
+ android:src="@drawable/ic_send"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/mrl_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginRight="15dp"
- android:layout_marginLeft="15dp"
android:layout_below="@+id/mrl_edit"
android:background="?attr/background_default"/>
</RelativeLayout>
More information about the Android
mailing list