Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Honor prefs.json #21304

Open
paulrouget opened this issue Aug 1, 2018 · 0 comments
Open

[Android] Honor prefs.json #21304

paulrouget opened this issue Aug 1, 2018 · 0 comments
Labels

Comments

@paulrouget
Copy link
Contributor

paulrouget commented Aug 1, 2018

#20912 followup

Use:

  • shell.searchpage instead of the hardcoded reference to duckduckgo in MainActivity.java
  • shell.homepage as a default value for mInitialUri in ServoView.java
  • honor shell.keep_screen_on.enabled and shell.native-orientation

Snippet from the previous Android port:

        if (BuildConfig.FLAVOR.contains("vr")) {
            // Force fullscreen mode and keep screen on for VR experiences.
            keepScreenOn = true;
            mFullScreen = true;
        }
        else {
            keepScreenOn = preferences.optBoolean("shell.keep_screen_on.enabled", false);
            mFullScreen = !preferences.optBoolean("shell.native-titlebar.enabled", false);

            String orientation = preferences.optString("shell.native-orientation", "both");

            // Handle orientation preference
            if (orientation.equalsIgnoreCase("portrait")) {
                setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
            }
            else if (orientation.equalsIgnoreCase("landscape")) {
                setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
            }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant