Limit delayed loading of plugin content to AddonOverviewFragment

This commit is contained in:
David Eisner 2016-05-06 18:56:32 +01:00
parent 6eb1fcf167
commit 57f3dfd502
No known key found for this signature in database
GPG Key ID: 572A0C31753FF551
2 changed files with 3 additions and 1 deletions

View File

@ -85,6 +85,7 @@ public class AddonOverviewFragment extends Fragment {
MediaFileListFragment.FileLocation rootPath = new MediaFileListFragment.FileLocation(name, "plugin://" + path, true); MediaFileListFragment.FileLocation rootPath = new MediaFileListFragment.FileLocation(name, "plugin://" + path, true);
rootPath.setRootDir(true); rootPath.setRootDir(true);
content.putParcelable(MediaFileListFragment.ROOT_PATH, rootPath); content.putParcelable(MediaFileListFragment.ROOT_PATH, rootPath);
content.putBoolean(MediaFileListFragment.DELAY_LOAD, true);
return content; return content;
} }

View File

@ -65,6 +65,7 @@ public class MediaFileListFragment extends AbstractListFragment {
public static final String ROOT_PATH_CONTENTS = "rootPathContents"; public static final String ROOT_PATH_CONTENTS = "rootPathContents";
public static final String ROOT_VISITED = "rootVisited"; public static final String ROOT_VISITED = "rootVisited";
public static final String ROOT_PATH = "rootPath"; public static final String ROOT_PATH = "rootPath";
public static final String DELAY_LOAD = "delayLoad";
private static final String ADDON_SOURCE = "addons:"; private static final String ADDON_SOURCE = "addons:";
private HostManager hostManager; private HostManager hostManager;
@ -165,7 +166,7 @@ public class MediaFileListFragment extends AbstractListFragment {
else if (rootPath != null) { else if (rootPath != null) {
loadOnVisible = rootPath; loadOnVisible = rootPath;
// setUserVisibleHint may have already fired // setUserVisibleHint may have already fired
setUserVisibleHint(getUserVisibleHint()); setUserVisibleHint(getUserVisibleHint() || !args.getBoolean(DELAY_LOAD, false));
} }
else { else {
browseSources(); browseSources();