Delay loading plugin content
Some plugins trigger UI when you Kore attempts to browse. We don't want the Content tab to cause this when the user has only opened the Overview tab. For the tabs pinned to the addons view (AddonListContainerFragment), loading by the usual OffScreenPageLimit rules probably makes sense, as you can avoid pinning tabs that don't work well.
This commit is contained in:
parent
9bb35cb8cc
commit
6eb1fcf167
|
@ -78,6 +78,7 @@ public class MediaFileListFragment extends AbstractListFragment {
|
|||
int playlistId = PlaylistType.MUSIC_PLAYLISTID; // this is the ID of the music player
|
||||
// private MediaFileListAdapter adapter = null;
|
||||
boolean browseRootAlready = false;
|
||||
FileLocation loadOnVisible = null;
|
||||
|
||||
ArrayList<FileLocation> rootFileLocation = new ArrayList<FileLocation>();
|
||||
Queue<FileLocation> mediaQueueFileLocation = new LinkedList<>();
|
||||
|
@ -162,8 +163,9 @@ public class MediaFileListFragment extends AbstractListFragment {
|
|||
((MediaFileListAdapter) getAdapter()).setFilelistItems(list);
|
||||
}
|
||||
else if (rootPath != null) {
|
||||
browseRootAlready = true;
|
||||
browseDirectory(rootPath);
|
||||
loadOnVisible = rootPath;
|
||||
// setUserVisibleHint may have already fired
|
||||
setUserVisibleHint(getUserVisibleHint());
|
||||
}
|
||||
else {
|
||||
browseSources();
|
||||
|
@ -171,6 +173,17 @@ public class MediaFileListFragment extends AbstractListFragment {
|
|||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserVisibleHint (boolean isVisibleToUser) {
|
||||
super.setUserVisibleHint(isVisibleToUser);
|
||||
if (isVisibleToUser && loadOnVisible != null) {
|
||||
FileLocation rootPath = loadOnVisible;
|
||||
loadOnVisible = null;
|
||||
browseRootAlready = true;
|
||||
browseDirectory(rootPath);
|
||||
}
|
||||
}
|
||||
|
||||
void handleFileSelect(FileLocation f) {
|
||||
// if selection is a directory, browse the the level below
|
||||
if (f.isDirectory) {
|
||||
|
|
Loading…
Reference in New Issue