[Android] SavePlaylistDialog: use a TextInputLayout

Jean-Baptiste Kempf git at videolan.org
Fri Jun 12 22:52:40 CEST 2015


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jun 12 22:52:21 2015 +0200| [306648fb3296d88ad8e46cff0519bf4f1cd4991e] | committer: Jean-Baptiste Kempf

SavePlaylistDialog: use a TextInputLayout

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=306648fb3296d88ad8e46cff0519bf4f1cd4991e
---

 vlc-android/res/layout/dialog_playlist.xml              |   15 ++++++++++-----
 .../videolan/vlc/gui/dialogs/SavePlaylistDialog.java    |    5 ++++-
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/vlc-android/res/layout/dialog_playlist.xml b/vlc-android/res/layout/dialog_playlist.xml
index 8783a11..17e3cdc 100644
--- a/vlc-android/res/layout/dialog_playlist.xml
+++ b/vlc-android/res/layout/dialog_playlist.xml
@@ -3,14 +3,19 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent" android:layout_height="match_parent">
 
-    <EditText
+    <android.support.design.widget.TextInputLayout
         android:id="@+id/dialog_playlist_name"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_alignParentTop="true"
-        android:hint="@string/playlist_name_hint"
-        android:inputType="text"
-        android:imeOptions="actionSend"/>
+        android:hint="@string/playlist_name_hint">
+        <EditText
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentTop="true"
+            android:hint="@string/playlist_name_hint"
+            android:inputType="text"
+            android:imeOptions="actionSend"/>
+    </android.support.design.widget.TextInputLayout>
     <FrameLayout
         android:id="@+id/dialog_list_container"
         android:layout_width="match_parent"
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.java
index d6d5b10..6366052 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/SavePlaylistDialog.java
@@ -27,6 +27,7 @@ import android.app.Dialog;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.design.widget.TextInputLayout;
 import android.support.v4.app.DialogFragment;
 import android.support.v7.app.AppCompatDialog;
 import android.view.KeyEvent;
@@ -85,7 +86,9 @@ public class SavePlaylistDialog extends DialogFragment implements AdapterView.On
         mListView = (ListView) view.findViewById(android.R.id.list);
         mSaveButton = (Button) view.findViewById(R.id.dialog_playlist_save);
         mEmptyView = (TextView) view.findViewById(android.R.id.empty);
-        mEditText = (EditText) view.findViewById(R.id.dialog_playlist_name);
+        TextInputLayout mLayout = (TextInputLayout)view.findViewById(R.id.dialog_playlist_name);
+        mLayout.setHint(getString(R.string.playlist_name_hint));
+        mEditText = mLayout.getEditText();
         mListView.setOnItemClickListener(this);
         mSaveButton.setOnClickListener(this);
 



More information about the Android mailing list