-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1416 from openMF/feature/spalsh
Feature SplashScreen using SplashAPI
- Loading branch information
Showing
13 changed files
with
95 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
25 changes: 0 additions & 25 deletions
25
mifospay/src/main/java/org/mifos/mobilewallet/mifospay/SplashScreenActivity.java
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
mifospay/src/main/java/org/mifos/mobilewallet/mifospay/SplashScreenActivity.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.mifos.mobilewallet.mifospay | ||
|
||
import android.annotation.SuppressLint | ||
import android.content.Intent | ||
import android.content.pm.ActivityInfo | ||
import android.os.Build | ||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen | ||
import androidx.lifecycle.lifecycleScope | ||
import kotlinx.coroutines.delay | ||
import kotlinx.coroutines.launch | ||
import org.mifos.mobilewallet.mifospay.auth.ui.LoginActivity | ||
|
||
@SuppressLint("CustomSplashScreen") | ||
class SplashScreenActivity : ComponentActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S){ | ||
val splashScreen = installSplashScreen() | ||
splashScreen.setKeepOnScreenCondition { true } | ||
} | ||
super.onCreate(savedInstanceState) | ||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED | ||
lifecycleScope.launch { | ||
delay(2000) | ||
startActivity(Intent(this@SplashScreenActivity, LoginActivity::class.java)) | ||
finish() | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<color android:color="@color/black" /> | ||
</item> | ||
<item> | ||
<bitmap | ||
android:gravity="center" | ||
android:src="@drawable/splash_icon" /> | ||
</item> | ||
</layer-list> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<color android:color="@color/black" /> | ||
</item> | ||
|
||
<item | ||
android:width="100dp" | ||
android:height="100dp" | ||
android:drawable="@drawable/splash_icon" | ||
android:gravity="center" /> | ||
</layer-list> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<style name="SplashScreenTheme" parent="Theme.SplashScreen"> | ||
<item name="windowSplashScreenBackground">@color/black</item> | ||
<item name="windowSplashScreenAnimatedIcon">@drawable/bg_splash_12</item> | ||
<item name="windowSplashScreenAnimationDuration">3000</item> | ||
<item name="postSplashScreenTheme">@style/AppTheme</item> | ||
</style> | ||
|
||
</resources> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<resources> | ||
|
||
<style name="Theme.SplashScreen.MySplash" parent="Theme.SplashScreen"> | ||
<item name="windowSplashScreenBackground">#FFD0BCFF</item> | ||
<!--<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>--> | ||
<style name="Theme.SplashScreen.MifosSplash" parent="Theme.SplashScreen"> | ||
<item name="windowSplashScreenBackground">#000000</item> | ||
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon</item> | ||
<item name="postSplashScreenTheme">@style/Theme.SplashScreen</item> | ||
</style> | ||
</resources> | ||
</resources> |
This file contains 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