<div dir="ltr">No, but now it's done :)<div><br></div><div>I'm sorry I missed your mail.</div><div><br></div><div>I edited your patch, you forgot the itemView.setOnFocusChangeListener(this);</div><div><br></div><div>But now it's on master.</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 26, 2016 at 3:47 PM Chegou Junior KEITA <<a href="mailto:chegoujk@gmail.com">chegoujk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java | 4 ++++<br>
.../src/org/videolan/vlc/gui/video/VideoListAdapter.java | 11 ++++++++++-<br>
2 files changed, 14 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java b/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java<br>
index 6c59146..52e2aa2 100644<br>
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java<br>
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java<br>
@@ -34,6 +34,7 @@ import android.preference.PreferenceManager;<br>
import android.support.annotation.NonNull;<br>
import android.support.annotation.Nullable;<br>
import android.support.design.widget.Snackbar;<br>
+import android.support.v4.content.ContextCompat;<br>
import android.text.Html;<br>
import android.text.TextUtils;<br>
import android.util.DisplayMetrics;<br>
@@ -55,6 +56,9 @@ import java.util.concurrent.atomic.AtomicInteger;<br>
<br>
public class UiTools {<br>
<br>
+ public static final int ITEM_FOCUS_ON = ContextCompat.getColor(VLCApplication.getAppContext(), R.color.orange800);<br>
+ public static final int ITEM_FOCUS_OFF = ContextCompat.getColor(VLCApplication.getAppContext(), R.color.transparent);<br>
+<br>
private static final AtomicInteger sNextGeneratedId = new AtomicInteger(1);<br>
<br>
private static final Handler sHandler = new Handler(Looper.getMainLooper());<br>
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java<br>
index 4fe2880..029f098 100644<br>
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java<br>
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java<br>
@@ -42,6 +42,7 @@ import org.videolan.vlc.gui.SecondaryActivity;<br>
import org.videolan.vlc.gui.helpers.AsyncImageLoader;<br>
import org.videolan.vlc.gui.helpers.BitmapCache;<br>
import org.videolan.vlc.gui.helpers.BitmapUtil;<br>
+import org.videolan.vlc.gui.helpers.UiTools;<br>
import org.videolan.vlc.media.MediaGroup;<br>
import org.videolan.vlc.media.MediaWrapper;<br>
import org.videolan.vlc.util.Strings;<br>
@@ -340,7 +341,7 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View<br>
return super.getItemViewType(position);<br>
}<br>
<br>
- public class ViewHolder extends RecyclerView.ViewHolder implements View.OnLongClickListener {<br>
+ public class ViewHolder extends RecyclerView.ViewHolder implements View.OnLongClickListener, View.OnFocusChangeListener {<br>
boolean listmode;<br>
ViewDataBinding binding;<br>
<br>
@@ -376,5 +377,13 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View<br>
mFragment.mGridView.openContextMenu(getLayoutPosition());<br>
return true;<br>
}<br>
+<br>
+ @Override<br>
+ public void onFocusChange(View v, boolean hasFocus) {<br>
+ if (hasFocus)<br>
+ itemView.setBackgroundColor(UiTools.ITEM_FOCUS_ON);<br>
+ else<br>
+ itemView.setBackgroundColor(UiTools.ITEM_FOCUS_OFF);<br>
+ }<br>
}<br>
}<br>
--<br>
1.9.1<br>
<br>
_______________________________________________<br>
Android mailing list<br>
<a href="mailto:Android@videolan.org" target="_blank">Android@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/android" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/android</a><br>
</blockquote></div>