Skip to content
Snippets Groups Projects
Commit 07d584cf authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Send button for MRL view

parent 5c9a810a
No related branches found
No related tags found
No related merge requests found
vlc-android/res/drawable-hdpi/ic_send.png

481 B

vlc-android/res/drawable-mdpi/ic_send.png

324 B

vlc-android/res/drawable-xhdpi/ic_send.png

550 B

vlc-android/res/drawable-xxhdpi/ic_send.png

769 B

vlc-android/res/drawable-xxxhdpi/ic_send.png

996 B

......@@ -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"
......
......@@ -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();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment