Last active
March 18, 2020 14:56
-
-
Save trinnguyen/dd24d22bdd3ca887ebca57a1d530cbf7 to your computer and use it in GitHub Desktop.
Android style for Splash screen with status bar and navigation bar are transparent, API 21+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style name="AppTheme.Splash"> | |
<item name="windowActionBar">false</item> | |
<item name="windowNoTitle">true</item> | |
<item name="android:statusBarColor">@android:color/transparent</item> | |
<item name="android:navigationBarColor">@android:color/transparent</item> | |
<item name="android:windowDrawsSystemBarBackgrounds">true</item> | |
</style> |
Ensure no android:fitsSystemWindows="true"
in Root Layout
Example:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frame_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="0dp"
android:background="#ff00ff"
tools:context="com.trinnguyen.emptysplash.MainActivity">
<SurfaceView
android:id="@+id/surface_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff0000" />
</FrameLayout>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update UI flags on activity: