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

feat(android): add splashFullScreen configuration option #2302

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions android/capacitor/src/main/java/com/getcapacitor/Splash.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public interface SplashListener {
public static final int DEFAULT_FADE_OUT_DURATION = 200;
public static final int DEFAULT_SHOW_DURATION = 3000;
public static final boolean DEFAULT_AUTO_HIDE = true;
public static final boolean DEFAULT_SPLASH_FULL_SCREEN = false;

private static ImageView splashImage;
private static ProgressBar spinnerBar;
Expand All @@ -52,7 +53,14 @@ private static void buildViews(Context c) {
}

splashImage = new ImageView(c);

// Hide status bar during splash screen.
Boolean splashFullScreen = Config.getBoolean(CONFIG_KEY_PREFIX + "splashFullScreen", DEFAULT_SPLASH_FULL_SCREEN);
if(splashFullScreen){
splashImage.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
}


// Stops flickers dead in their tracks
// https://stackoverflow.com/a/21847579/32140
splashImage.setDrawingCacheEnabled(true);
Expand Down