Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
12
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
390a3898
There was an error fetching the commit references. Please try again later.
Commit
390a3898
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Fix fastscroller stuck on top and bottom
Fix
#382
parent
d4bbac97
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/res/layout/audio_browser.xml
+2
-1
2 additions, 1 deletion
vlc-android/res/layout/audio_browser.xml
vlc-android/src/org/videolan/vlc/gui/view/FastScroller.java
+8
-12
8 additions, 12 deletions
vlc-android/src/org/videolan/vlc/gui/view/FastScroller.java
with
10 additions
and
13 deletions
vlc-android/res/layout/audio_browser.xml
+
2
−
1
View file @
390a3898
...
...
@@ -64,7 +64,8 @@
android:id=
"@+id/songs_fast_scroller"
android:layout_width=
"wrap_content"
android:layout_height=
"0dp"
android:layout_marginTop=
"@dimen/default_margin"
android:layout_marginTop=
"16dp"
android:layout_marginBottom=
"16dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"@+id/swipeLayout"
app:layout_constraintTop_toTopOf=
"@+id/swipeLayout"
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/gui/view/FastScroller.java
+
8
−
12
View file @
390a3898
...
...
@@ -27,6 +27,7 @@ import android.animation.Animator;
import
android.animation.AnimatorListenerAdapter
;
import
android.animation.AnimatorSet
;
import
android.animation.ObjectAnimator
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.content.Context
;
import
android.os.Build
;
...
...
@@ -58,7 +59,6 @@ public class FastScroller extends LinearLayout {
private
static
final
int
HANDLE_ANIMATION_DURATION
=
100
;
private
static
final
int
HANDLE_HIDE_DELAY
=
1000
;
private
static
final
int
SCROLLER_HIDE_DELAY
=
3000
;
private
static
final
int
TRACK_SNAP_RANGE
=
5
;
private
static
final
int
HIDE_HANDLE
=
0
;
private
static
final
int
HIDE_SCROLLER
=
1
;
...
...
@@ -196,14 +196,7 @@ public class FastScroller extends LinearLayout {
private
void
setRecyclerViewPosition
(
float
y
)
{
if
(
mRecyclerView
!=
null
)
{
float
proportion
;
if
(
handle
.
getY
()
==
0
)
{
proportion
=
0
f
;
}
else
if
(
handle
.
getY
()
+
handle
.
getHeight
()
>=
mHeight
-
TRACK_SNAP_RANGE
)
{
proportion
=
1
f
;
}
else
{
proportion
=
y
/
(
float
)
mHeight
;
}
final
float
proportion
=
y
/
(
float
)
mHeight
;
final
int
targetPos
=
getValueInRange
(
0
,
mItemCount
-
1
,
Math
.
round
(
proportion
*
(
float
)
mItemCount
));
if
(
targetPos
==
mCurrentPosition
)
return
;
mCurrentPosition
=
targetPos
;
...
...
@@ -248,18 +241,21 @@ public class FastScroller extends LinearLayout {
}
}
@SuppressLint
(
"HandlerLeak"
)
private
final
Handler
mHandler
=
new
FastScrollerHandler
(
this
)
{
@Override
public
void
handleMessage
(
Message
msg
)
{
final
FastScroller
fs
=
getOwner
();
if
(
fs
==
null
)
return
;
switch
(
msg
.
what
)
{
case
HIDE_HANDLE:
hideBubble
();
fs
.
hideBubble
();
break
;
case
HIDE_SCROLLER:
FastScroller
.
thi
s
.
setVisibility
(
INVISIBLE
);
f
s
.
setVisibility
(
INVISIBLE
);
break
;
case
SHOW_SCROLLER:
FastScroller
.
thi
s
.
setVisibility
(
VISIBLE
);
f
s
.
setVisibility
(
VISIBLE
);
mHandler
.
removeMessages
(
HIDE_SCROLLER
);
mHandler
.
sendEmptyMessageDelayed
(
HIDE_SCROLLER
,
SCROLLER_HIDE_DELAY
);
break
;
...
...
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