[Android] Send button for MRL view

Geoffrey Métais git at videolan.org
Fri Feb 5 12:34:33 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb  5 11:56:13 2016 +0100| [07d584cf7c7a4d75758aa08c9ee4ca3efe152e4e] | committer: Geoffrey Métais

Send button for MRL view

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

 vlc-android/res/drawable-hdpi/ic_send.png                 | Bin 0 -> 481 bytes
 vlc-android/res/drawable-mdpi/ic_send.png                 | Bin 0 -> 324 bytes
 vlc-android/res/drawable-xhdpi/ic_send.png                | Bin 0 -> 550 bytes
 vlc-android/res/drawable-xxhdpi/ic_send.png               | Bin 0 -> 769 bytes
 vlc-android/res/drawable-xxxhdpi/ic_send.png              | Bin 0 -> 996 bytes
 vlc-android/res/layout/mrl_panel.xml                      |  10 ++++++++++
 .../org/videolan/vlc/gui/network/MRLPanelFragment.java    |  11 ++++++++++-
 7 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/vlc-android/res/drawable-hdpi/ic_send.png b/vlc-android/res/drawable-hdpi/ic_send.png
new file mode 100644
index 0000000..34aaeea
Binary files /dev/null and b/vlc-android/res/drawable-hdpi/ic_send.png differ
diff --git a/vlc-android/res/drawable-mdpi/ic_send.png b/vlc-android/res/drawable-mdpi/ic_send.png
new file mode 100644
index 0000000..8f09198
Binary files /dev/null and b/vlc-android/res/drawable-mdpi/ic_send.png differ
diff --git a/vlc-android/res/drawable-xhdpi/ic_send.png b/vlc-android/res/drawable-xhdpi/ic_send.png
new file mode 100644
index 0000000..427462e
Binary files /dev/null and b/vlc-android/res/drawable-xhdpi/ic_send.png differ
diff --git a/vlc-android/res/drawable-xxhdpi/ic_send.png b/vlc-android/res/drawable-xxhdpi/ic_send.png
new file mode 100644
index 0000000..3d3830b
Binary files /dev/null and b/vlc-android/res/drawable-xxhdpi/ic_send.png differ
diff --git a/vlc-android/res/drawable-xxxhdpi/ic_send.png b/vlc-android/res/drawable-xxxhdpi/ic_send.png
new file mode 100644
index 0000000..2a629b1
Binary files /dev/null and b/vlc-android/res/drawable-xxxhdpi/ic_send.png differ
diff --git a/vlc-android/res/layout/mrl_panel.xml b/vlc-android/res/layout/mrl_panel.xml
index f9470b5..a873be4 100644
--- a/vlc-android/res/layout/mrl_panel.xml
+++ b/vlc-android/res/layout/mrl_panel.xml
@@ -5,6 +5,7 @@
     <android.support.design.widget.TextInputLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_toLeftOf="@+id/send"
         android:id="@+id/mrl_edit">
         <EditText
             android:layout_width="match_parent"
@@ -16,6 +17,15 @@
             android:maxLines="2"
             android:imeOptions="actionGo"/>
     </android.support.design.widget.TextInputLayout>
+    <ImageView
+        android:id="@+id/send"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_alignBottom="@+id/mrl_edit"
+        android:layout_alignTop="@+id/mrl_edit"
+        android:scaleType="center"
+        android:src="@drawable/ic_send"/>
     <android.support.v7.widget.RecyclerView
         android:id="@+id/mrl_list"
         android:layout_width="match_parent"
diff --git a/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.java b/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.java
index 73bdc9a..1966a93 100644
--- a/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.java
@@ -32,6 +32,7 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.inputmethod.EditorInfo;
+import android.widget.ImageView;
 import android.widget.TextView;
 
 import org.videolan.vlc.R;
@@ -42,13 +43,14 @@ import org.videolan.vlc.media.MediaUtils;
 
 import java.util.ArrayList;
 
-public class MRLPanelFragment extends Fragment implements IHistory, View.OnKeyListener, TextView.OnEditorActionListener {
+public class MRLPanelFragment extends Fragment implements IHistory, View.OnKeyListener, TextView.OnEditorActionListener, View.OnClickListener {
     private static final String TAG = "VLC/MrlPanelFragment";
     private RecyclerView mRecyclerView;
     private MRLAdapter mAdapter;
     private RecyclerView.LayoutManager mLayoutManager;
     ArrayList<String> mHistory;
     TextInputLayout mEditText;
+    ImageView mSend;
     View mRootView;
 
     public MRLPanelFragment(){}
@@ -63,6 +65,7 @@ public class MRLPanelFragment extends Fragment implements IHistory, View.OnKeyLi
         View v = inflater.inflate(R.layout.mrl_panel, container, false);
         mRootView = v.findViewById(R.id.mrl_root);
         mEditText = (TextInputLayout) v.findViewById(R.id.mrl_edit);
+        mSend = (ImageView) v.findViewById(R.id.send);
         mEditText.getEditText().setOnKeyListener(this);
         mEditText.getEditText().setOnEditorActionListener(this);
         mEditText.setHint(getString(R.string.open_mrl_dialog_msg));
@@ -71,6 +74,7 @@ public class MRLPanelFragment extends Fragment implements IHistory, View.OnKeyLi
         mRecyclerView.setLayoutManager(mLayoutManager);
         mAdapter = new MRLAdapter(mHistory);
         mRecyclerView.setAdapter(mAdapter);
+        mSend.setOnClickListener(this);
 
         return v;
     }
@@ -130,4 +134,9 @@ public class MRLPanelFragment extends Fragment implements IHistory, View.OnKeyLi
     public boolean isEmpty(){
         return mAdapter.isEmpty();
     }
+
+    @Override
+    public void onClick(View v) {
+        processUri();
+    }
 }



More information about the Android mailing list