Skip to content
Snippets Groups Projects
Commit d4307d5e authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Do not store browsers content at root level

parent 83096da6
No related branches found
No related tags found
No related merge requests found
......@@ -201,11 +201,9 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
if (content != null)
mFoldersContentLists = content;
@SuppressWarnings("unchecked")
final List<MediaLibraryItem> mediaList = (List<MediaLibraryItem>) VLCApplication.getData(KEY_MEDIA_LIST + mMrl);
if (!Util.isListEmpty(mediaList))
mAdapter.update(mediaList);
else
mHandler.sendEmptyMessage(BrowserFragmentHandler.MSG_REFRESH);
final List<MediaLibraryItem> mediaList = mRoot ? null : (List<MediaLibraryItem>) VLCApplication.getData(KEY_MEDIA_LIST + mMrl);
if (!Util.isListEmpty(mediaList)) mAdapter.update(mediaList);
else mHandler.sendEmptyMessage(BrowserFragmentHandler.MSG_REFRESH);
}
@Override
......@@ -245,11 +243,9 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
public void onSaveInstanceState(Bundle outState){
outState.putString(KEY_MRL, mMrl);
outState.putParcelable(KEY_MEDIA, mCurrentMedia);
if (mAdapter != null)
VLCApplication.storeData(KEY_MEDIA_LIST+mMrl, mAdapter.getAll());
if (!mRoot && mAdapter != null) VLCApplication.storeData(KEY_MEDIA_LIST+mMrl, mAdapter.getAll());
VLCApplication.storeData(KEY_CONTENT_LIST+mMrl, mFoldersContentLists);
if (mRecyclerView != null)
outState.putInt(KEY_POSITION, mLayoutManager.findFirstCompletelyVisibleItemPosition());
if (mRecyclerView != null) outState.putInt(KEY_POSITION, mLayoutManager.findFirstCompletelyVisibleItemPosition());
super.onSaveInstanceState(outState);
}
......@@ -293,7 +289,7 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
final FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
final Fragment next = createFragment();
final Bundle args = new Bundle();
VLCApplication.storeData(KEY_MEDIA_LIST+mMrl, mAdapter.getAll());
if (!mRoot) VLCApplication.storeData(KEY_MEDIA_LIST+mMrl, mAdapter.getAll());
VLCApplication.storeData(KEY_CONTENT_LIST+ mMrl, mFoldersContentLists);
final List<MediaLibraryItem> list = mFoldersContentLists.get(media);
if (!Util.isListEmpty(list) && !(this instanceof StorageBrowserFragment))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment