Skip to content

Commit

Permalink
set windowBackground theme for the starting activity
Browse files Browse the repository at this point in the history
  • Loading branch information
pish11010 committed May 25, 2020
1 parent 1cc942d commit 1202c37
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/src/main/AndroidManifest.xml
@@ -1,18 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jumo.jumoexample">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/jumo/jumoexample/MainActivity.kt
Expand Up @@ -6,6 +6,7 @@ import android.os.Bundle
class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.AppTheme)
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/splash.xml
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/background_dark" />
<item
android:drawable="@mipmap/ic_launcher"
android:gravity="center" />

This comment has been minimized.

Copy link
@pish11010

pish11010 May 26, 2020

Author Member

Update for low version android

  <item>
    <bitmap
      android:src="@drawable/ic_launcher"
      android:gravity="center"/>
  </item>
</layer-list>
4 changes: 4 additions & 0 deletions app/src/main/res/values/styles.xml
Expand Up @@ -7,5 +7,9 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash</item>
</style>

</resources>

0 comments on commit 1202c37

Please sign in to comment.