Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
f0926eee
Commit
f0926eee
authored
8 years ago
by
Chegou Junior KEITA
Committed by
Geoffrey Métais
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Focus on item in main video screen
Signed-off-by:
Geoffrey Métais
<
geoffrey.metais@gmail.com
>
parent
fda3c813
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java
+4
-0
4 additions, 0 deletions
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java
vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+11
-1
11 additions, 1 deletion
...roid/src/org/videolan/vlc/gui/video/VideoListAdapter.java
with
15 additions
and
1 deletion
vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.java
+
4
−
0
View file @
f0926eee
...
...
@@ -34,6 +34,7 @@ import android.preference.PreferenceManager;
import
android.support.annotation.NonNull
;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.Snackbar
;
import
android.support.v4.content.ContextCompat
;
import
android.text.Html
;
import
android.text.TextUtils
;
import
android.util.DisplayMetrics
;
...
...
@@ -55,6 +56,9 @@ import java.util.concurrent.atomic.AtomicInteger;
public
class
UiTools
{
public
static
final
int
ITEM_FOCUS_ON
=
ContextCompat
.
getColor
(
VLCApplication
.
getAppContext
(),
R
.
color
.
orange800
);
public
static
final
int
ITEM_FOCUS_OFF
=
ContextCompat
.
getColor
(
VLCApplication
.
getAppContext
(),
R
.
color
.
transparent
);
private
static
final
AtomicInteger
sNextGeneratedId
=
new
AtomicInteger
(
1
);
private
static
final
Handler
sHandler
=
new
Handler
(
Looper
.
getMainLooper
());
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+
11
−
1
View file @
f0926eee
...
...
@@ -37,6 +37,7 @@ import org.videolan.vlc.R;
import
org.videolan.vlc.VLCApplication
;
import
org.videolan.vlc.gui.MainActivity
;
import
org.videolan.vlc.gui.SecondaryActivity
;
import
org.videolan.vlc.gui.helpers.UiTools
;
import
org.videolan.vlc.media.MediaGroup
;
import
org.videolan.vlc.media.MediaWrapper
;
import
org.videolan.vlc.util.Strings
;
...
...
@@ -294,7 +295,7 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View
return
super
.
getItemViewType
(
position
);
}
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
implements
View
.
OnLongClickListener
{
public
class
ViewHolder
extends
RecyclerView
.
ViewHolder
implements
View
.
OnLongClickListener
,
View
.
OnFocusChangeListener
{
boolean
listmode
;
public
ViewDataBinding
binding
;
...
...
@@ -304,6 +305,7 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View
this
.
listmode
=
listMode
;
binding
.
setVariable
(
BR
.
holder
,
this
);
itemView
.
setOnLongClickListener
(
this
);
itemView
.
setOnFocusChangeListener
(
this
);
}
public
void
onClick
(
View
v
){
...
...
@@ -330,5 +332,13 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View
mFragment
.
mGridView
.
openContextMenu
(
getLayoutPosition
());
return
true
;
}
@Override
public
void
onFocusChange
(
View
v
,
boolean
hasFocus
)
{
if
(
hasFocus
)
itemView
.
setBackgroundColor
(
UiTools
.
ITEM_FOCUS_ON
);
else
itemView
.
setBackgroundColor
(
UiTools
.
ITEM_FOCUS_OFF
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment