[Android] Queue update calls
Geoffrey Métais
git at videolan.org
Tue Dec 6 19:01:19 CET 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Dec 6 18:13:25 2016 +0100| [ffb72cd44f28973275e9ec36b5ddbfbcb604685a] | committer: Geoffrey Métais
Queue update calls
> https://code.videolan.org/videolan/vlc-android/commit/ffb72cd44f28973275e9ec36b5ddbfbcb604685a
---
.../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java | 10 +++-------
.../src/org/videolan/vlc/gui/video/VideoGridFragment.java | 2 +-
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 32f3291..9beaed9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -229,7 +229,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDis
mMediaLibrary.setMediaUpdatedCb(this, Medialibrary.FLAG_MEDIA_UPDATED_AUDIO_EMPTY);
if (mArtistsAdapter.isEmpty() || mGenresAdapter.isEmpty() ||
mAlbumsAdapter.isEmpty() || mSongsAdapter.isEmpty())
- updateLists();
+ mHandler.sendEmptyMessage(UPDATE_LIST);
else {
updateEmptyView(mViewPager.getCurrentItem());
updatePlaylists();
@@ -669,6 +669,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDis
private void updateLists() {
mTabLayout.setVisibility(View.VISIBLE);
mHandler.sendEmptyMessageDelayed(MSG_LOADING, 300);
+ mHandler.removeMessages(UPDATE_LIST);
VLCApplication.runBackground(new Runnable() {
@Override
@@ -741,12 +742,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDis
public void onParsingStatsUpdated(int percent) {
mParsing = percent < 100;
if (percent == 100) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- updateLists();
- }
- });
+ mHandler.sendEmptyMessage(UPDATE_LIST);
hideProgressBar();
} else if (!mSwipeRefreshLayout.isRefreshing())
mHandler.sendEmptyMessage(SET_REFRESHING);
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 3d04fdf..69fd6f6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -144,7 +144,7 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
mMediaLibrary.setMediaAddedCb(this, Medialibrary.FLAG_MEDIA_ADDED_VIDEO);
mMediaLibrary.addDeviceDiscoveryCb(this);
updateViewMode();
- updateList();
+ mHandler.sendEmptyMessage(UPDATE_LIST);
}
@Override
More information about the Android
mailing list