Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
529
Issue boards
Milestones
Wiki
Code
Merge requests
15
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
5881f046
Commit
5881f046
authored
9 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Auto disable refresh icon after 5s
parent
f58308f8
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/browser/ExtensionBrowser.java
+36
-0
36 additions, 0 deletions
...id/src/org/videolan/vlc/gui/browser/ExtensionBrowser.java
with
36 additions
and
0 deletions
vlc-android/src/org/videolan/vlc/gui/browser/ExtensionBrowser.java
+
36
−
0
View file @
5881f046
...
...
@@ -2,6 +2,8 @@ package org.videolan.vlc.gui.browser;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.support.design.widget.FloatingActionButton
;
import
android.support.v4.app.Fragment
;
import
android.support.v7.app.AppCompatActivity
;
...
...
@@ -25,16 +27,25 @@ import org.videolan.vlc.gui.view.DividerItemDecoration;
import
org.videolan.vlc.gui.view.SwipeRefreshLayout
;
import
org.videolan.vlc.media.MediaUtils
;
import
org.videolan.vlc.media.MediaWrapper
;
import
org.videolan.vlc.util.WeakHandler
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
ExtensionBrowser
extends
Fragment
implements
View
.
OnClickListener
,
android
.
support
.
v4
.
widget
.
SwipeRefreshLayout
.
OnRefreshListener
{
public
static
final
String
TAG
=
"VLC/ExtensionBrowser"
;
public
static
final
String
KEY_ITEMS_LIST
=
"key_items_list"
;
public
static
final
String
KEY_SHOW_FAB
=
"key_fab"
;
public
static
final
String
KEY_TITLE
=
"key_title"
;
private
static
final
int
ACTION_HIDE_REFRESH
=
42
;
private
static
final
int
ACTION_SHOW_REFRESH
=
43
;
private
static
final
int
REFRESH_TIMEOUT
=
5000
;
private
String
mTitle
;
FloatingActionButton
mAddDirectoryFAB
;
ExtensionAdapter
mAdapter
;
...
...
@@ -146,6 +157,7 @@ public class ExtensionBrowser extends Fragment implements View.OnClickListener,
@Override
public
void
onRefresh
()
{
mExtensionManagerService
.
refresh
();
mHandler
.
sendEmptyMessageDelayed
(
ACTION_HIDE_REFRESH
,
REFRESH_TIMEOUT
);
}
RecyclerView
.
OnScrollListener
mScrollListener
=
new
RecyclerView
.
OnScrollListener
()
{
...
...
@@ -213,4 +225,28 @@ public class ExtensionBrowser extends Fragment implements View.OnClickListener,
}
}
private
Handler
mHandler
=
new
ExtensionBrowserHandler
(
this
);
private
class
ExtensionBrowserHandler
extends
WeakHandler
<
ExtensionBrowser
>
{
public
ExtensionBrowserHandler
(
ExtensionBrowser
owner
)
{
super
(
owner
);
}
@Override
public
void
handleMessage
(
Message
msg
)
{
switch
(
msg
.
what
)
{
case
ACTION_HIDE_REFRESH:
removeMessages
(
ACTION_SHOW_REFRESH
);
getOwner
().
mSwipeRefreshLayout
.
setRefreshing
(
false
);
break
;
case
ACTION_SHOW_REFRESH:
removeMessages
(
ACTION_HIDE_REFRESH
);
getOwner
().
mSwipeRefreshLayout
.
setRefreshing
(
true
);
sendEmptyMessageDelayed
(
ACTION_HIDE_REFRESH
,
REFRESH_TIMEOUT
);
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