Close #561, add launch page selector
This commit is contained in:
1 parent
13eb9e2f16
commit
5dc6446d64
9 files changed
+44
-3
No files matched your search
@@ -28,6 +28,7 @@ import com.hippo.ehviewer.client.EhConfig;
|
||||
import com.hippo.ehviewer.client.EhUtils;
|
||||
import com.hippo.ehviewer.client.data.FavListUrlBuilder;
|
||||
import com.hippo.ehviewer.ui.CommonOperations;
|
||||
import com.hippo.ehviewer.ui.scene.GalleryListScene;
|
||||
import com.hippo.glgallery.GalleryView;
|
||||
import com.hippo.unifile.UniFile;
|
||||
import com.hippo.util.ExceptionUtils;
|
||||
@@ -278,6 +279,22 @@ public class Settings {
|
||||
putIntToStr(KEY_GALLERY_SITE, value);
|
||||
}
|
||||
|
||||
private static final String KEY_LAUNCH_PAGE = "launch_page";
|
||||
private static final int DEFAULT_LAUNCH_PAGE = 0;
|
||||
|
||||
public static String getLaunchPageGalleryListSceneAction() {
|
||||
int value = getIntFromStr(KEY_LAUNCH_PAGE, DEFAULT_LAUNCH_PAGE);
|
||||
switch (value) {
|
||||
default:
|
||||
case 0:
|
||||
return GalleryListScene.ACTION_HOMEPAGE;
|
||||
case 1:
|
||||
return GalleryListScene.ACTION_SUBSCRIPTION;
|
||||
case 2:
|
||||
return GalleryListScene.ACTION_WHATS_HOT;
|
||||
}
|
||||
}
|
||||
|
||||
public static final String KEY_LIST_MODE = "list_mode";
|
||||
private static final int DEFAULT_LIST_MODE = 0;
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ public final class MainActivity extends StageActivity
|
||||
return new Announcer(SelectSiteScene.class);
|
||||
} else {
|
||||
Bundle args = new Bundle();
|
||||
args.putString(GalleryListScene.KEY_ACTION, GalleryListScene.ACTION_HOMEPAGE);
|
||||
args.putString(GalleryListScene.KEY_ACTION, Settings.getLaunchPageGalleryListSceneAction());
|
||||
return new Announcer(GalleryListScene.class).setArgs(args);
|
||||
}
|
||||
}
|
||||
@@ -309,7 +309,7 @@ public final class MainActivity extends StageActivity
|
||||
finish();
|
||||
} else {
|
||||
Bundle args = new Bundle();
|
||||
args.putString(GalleryListScene.KEY_ACTION, GalleryListScene.ACTION_HOMEPAGE);
|
||||
args.putString(GalleryListScene.KEY_ACTION, Settings.getLaunchPageGalleryListSceneAction());
|
||||
startScene(processAnnouncer(new Announcer(GalleryListScene.class).setArgs(args)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class SolidScene extends BaseScene {
|
||||
startScene(new Announcer(clazz).setArgs(targetArgs));
|
||||
} else {
|
||||
Bundle newArgs = new Bundle();
|
||||
newArgs.putString(GalleryListScene.KEY_ACTION, GalleryListScene.ACTION_HOMEPAGE);
|
||||
newArgs.putString(GalleryListScene.KEY_ACTION, Settings.getLaunchPageGalleryListSceneAction());
|
||||
startScene(new Announcer(GalleryListScene.class).setArgs(newArgs));
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user