[Android] Faster display for History
Geoffrey Métais
git at videolan.org
Fri Dec 18 11:01:47 CET 2015
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Dec 18 11:00:20 2015 +0100| [429d2b9ab268b896d3eb3a226fa1aeca007ad96e] | committer: Geoffrey Métais
Faster display for History
> https://code.videolan.org/videolan/vlc-android/commit/429d2b9ab268b896d3eb3a226fa1aeca007ad96e
---
vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index f82d876..e934b06 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -26,10 +26,7 @@ import android.os.Handler;
import android.os.Message;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
-import android.view.ContextMenu;
-import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
-import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -57,7 +54,9 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
private View mEmptyView;
/* All subclasses of Fragment must include a public empty constructor. */
- public HistoryFragment() { }
+ public HistoryFragment() {
+ mHistoryAdapter = new HistoryAdapter();
+ }
private void focusHelper(boolean idIsEmpty) {
MainActivity main = (MainActivity)getActivity();
@@ -69,7 +68,6 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
@Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
- mHistoryAdapter = new HistoryAdapter();
View v = inflater.inflate(R.layout.history_list, container, false);
mRecyclerView = (RecyclerView)v.findViewById(android.R.id.list);
@@ -113,7 +111,8 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
@Override
public void onResume() {
super.onResume();
- display();
+ if (mReadyToDisplay && mHistoryAdapter.isEmpty())
+ display();
}
@Override
More information about the Android
mailing list