[Android] Improve loading visual feedback in browsers
Geoffrey Métais
git at videolan.org
Tue Feb 21 14:44:32 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 21 14:43:58 2017 +0100| [a60523d829fd37dbf3da67d1c2c64f26aa2f92ba] | committer: Geoffrey Métais
Improve loading visual feedback in browsers
> https://code.videolan.org/videolan/vlc-android/commit/a60523d829fd37dbf3da67d1c2c64f26aa2f92ba
---
.../src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index 7cbda82..f5ac334 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -287,7 +287,7 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
* Update views visibility and emptiness info
*/
protected void updateEmptyView() {
- if (mAdapter.isEmpty()){
+ if (mAdapter.isEmpty()) {
if (mSwipeRefreshLayout.isRefreshing()) {
mEmptyView.setText(R.string.loading);
mEmptyView.setVisibility(View.VISIBLE);
@@ -296,12 +296,10 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
mEmptyView.setText(R.string.directory_empty);
mEmptyView.setVisibility(View.VISIBLE);
mRecyclerView.setVisibility(View.GONE);
- mSwipeRefreshLayout.setRefreshing(false);
}
} else if (mEmptyView.getVisibility() == View.VISIBLE) {
mEmptyView.setVisibility(View.GONE);
mRecyclerView.setVisibility(View.VISIBLE);
- mSwipeRefreshLayout.setRefreshing(false);
}
}
@@ -749,8 +747,9 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
}
public void onUpdateFinished(RecyclerView.Adapter adapter) {
- parseSubDirectories();
+ mHandler.sendEmptyMessage(BrowserFragmentHandler.MSG_HIDE_LOADING);
updateEmptyView();
+ parseSubDirectories();
if (!mAdapter.isEmpty()) {
if (mSavedPosition > 0) {
mLayoutManager.scrollToPositionWithOffset(mSavedPosition, 0);
More information about the Android
mailing list