mirror of
https://github.com/IllusionMan1212/NPS-Browser.git
synced 2026-10-24 02:12:37 +00:00
refactor: switch to SplashScreen API
This commit is contained in:
@@ -1,29 +1,31 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:usesCleartextTraffic="true"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:supportsRtl="true"
|
||||||
android:supportsRtl="true"
|
android:theme="@style/NPSTheme"
|
||||||
android:theme="@style/NPSTheme">
|
android:usesCleartextTraffic="true">
|
||||||
<activity android:name=".activities.SplashActivity" android:theme="@style/NPSTheme.Splash"
|
<activity
|
||||||
android:exported="true">
|
android:name=".activities.MainActivity"
|
||||||
<intent-filter>
|
android:configChanges="screenSize|screenLayout|keyboardHidden|orientation"
|
||||||
<action android:name="android.intent.action.MAIN" />
|
android:exported="true"
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
android:theme="@style/NPSTheme.Splash"
|
||||||
</intent-filter>
|
>
|
||||||
</activity>
|
<intent-filter>
|
||||||
<activity android:name=".activities.MainActivity"
|
<action android:name="android.intent.action.MAIN" />
|
||||||
android:configChanges="screenSize|screenLayout|keyboardHidden|orientation">
|
|
||||||
</activity>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</application>
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -2,6 +2,7 @@ package com.illusionware.npsbrowser.activities
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import com.illusionware.npsbrowser.R
|
import com.illusionware.npsbrowser.R
|
||||||
import com.illusionware.npsbrowser.fragments.mainactivity.MainActivityFragment
|
import com.illusionware.npsbrowser.fragments.mainactivity.MainActivityFragment
|
||||||
@@ -9,6 +10,8 @@ import com.illusionware.npsbrowser.fragments.mainactivity.MainActivityFragment
|
|||||||
class MainActivity : BaseActivity(), FragmentManager.OnBackStackChangedListener {
|
class MainActivity : BaseActivity(), FragmentManager.OnBackStackChangedListener {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
installSplashScreen()
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setTheme(R.style.NPSTheme)
|
setTheme(R.style.NPSTheme)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
package com.illusionware.npsbrowser.activities
|
|
||||||
|
|
||||||
import android.content.Intent
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.view.View
|
|
||||||
|
|
||||||
class SplashActivity : BaseActivity() {
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
|
|
||||||
startActivity(Intent(this, MainActivity::class.java))
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
|
||||||
super.onWindowFocusChanged(hasFocus)
|
|
||||||
if (hasFocus) hideSystemUI()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun hideSystemUI() {
|
|
||||||
// Enables regular immersive mode.
|
|
||||||
// For "lean back" mode, remove SYSTEM_UI_FLAG_IMMERSIVE.
|
|
||||||
// Or for "sticky immersive," replace it with SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
|
||||||
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE
|
|
||||||
// Set the content to appear under the system bars so that the
|
|
||||||
// content doesn't resize when the system bars hide and show.
|
|
||||||
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
||||||
or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
||||||
or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
||||||
// Hide the nav bar and status bar
|
|
||||||
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
||||||
or View.SYSTEM_UI_FLAG_FULLSCREEN)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
android:fontFamily="sans-serif-light"
|
android:fontFamily="sans-serif-light"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/colorAccent"
|
android:textColor="@color/colorError"
|
||||||
android:textSize="24sp"
|
android:textSize="24sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
<color name="colorSecondaryDark">#515151</color>
|
<color name="colorSecondaryDark">#515151</color>
|
||||||
<color name="colorOnSecondary">#DFFFFFFF</color>
|
<color name="colorOnSecondary">#DFFFFFFF</color>
|
||||||
<color name="colorAmoled">#000000</color>
|
<color name="colorAmoled">#000000</color>
|
||||||
<color name="colorAccent">#F93422</color>
|
<color name="colorError">#F93422</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -7,5 +7,6 @@
|
|||||||
<color name="colorSecondaryDark">#888888</color>
|
<color name="colorSecondaryDark">#888888</color>
|
||||||
<color name="colorOnSecondary">#111111</color>
|
<color name="colorOnSecondary">#111111</color>
|
||||||
<color name="colorAmoled">#FFFFFF</color>
|
<color name="colorAmoled">#FFFFFF</color>
|
||||||
<color name="colorAccent">#F93422</color>
|
<color name="colorError">#F93422</color>
|
||||||
|
<color name="colorAccent">#545FBF</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,34 +1,35 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">NPS Browser</string>
|
<string name="app_name">NPS Browser</string>
|
||||||
<string name="title_activity_settings">Settings</string>
|
<string name="title_activity_settings">Settings</string>
|
||||||
<string name="search">Search</string>
|
<string name="search">Search</string>
|
||||||
<string name="download">Download</string>
|
<string name="download">Download</string>
|
||||||
<string name="copy_zrif">Copy zRIF</string>
|
<string name="copy_zrif">Copy zRIF</string>
|
||||||
<string name="content_id">Content ID</string>
|
<string name="content_id">Content ID</string>
|
||||||
<string name="size">Size</string>
|
<string name="size">Size</string>
|
||||||
<string name="minfw">Minimum Firmware Version</string>
|
<string name="minfw">Minimum Firmware Version</string>
|
||||||
<string name="single_app_icon">Single app icon</string>
|
<string name="single_app_icon">Single app icon</string>
|
||||||
<string name="no_license">Warning: No license was provided for this content.</string>
|
<string name="no_license">Warning: No license was provided for this content.</string>
|
||||||
<string name="cart_only">CART ONLY GAME</string>
|
<string name="cart_only">CART ONLY GAME</string>
|
||||||
<string name="no_download_link">Warning: No download link was provided for this content.</string>
|
<string name="no_download_link">Warning: No download link was provided for this content.</string>
|
||||||
<string name="downloading">Downloading...</string>
|
<string name="downloading">Downloading...</string>
|
||||||
<string name="download_error">An error occurred while downloading. please try again</string>
|
<string name="download_error">An error occurred while downloading. please try again</string>
|
||||||
<string name="pkg_url_copied">PKG URL Copied to Clipboard</string>
|
<string name="pkg_url_copied">PKG URL Copied to Clipboard</string>
|
||||||
<string name="zrif_copied">zRIF Copied to Clipboard</string>
|
<string name="zrif_copied">zRIF Copied to Clipboard</string>
|
||||||
<string name="content_id_copied">Content ID Copied to Clipboard</string>
|
<string name="content_id_copied">Content ID Copied to Clipboard</string>
|
||||||
<string name="appearance">Appearance</string>
|
<string name="appearance">Appearance</string>
|
||||||
<string name="theme">Theme</string>
|
<string name="theme">Theme</string>
|
||||||
<string name="layout">Layout</string>
|
<string name="layout">Layout</string>
|
||||||
|
|
||||||
<string-array name="app_theme">
|
<string-array name="app_theme">
|
||||||
<item>Light</item>
|
<item>Light</item>
|
||||||
<item>Dark</item>
|
<item>Dark</item>
|
||||||
<item>Use System Default</item>
|
<item>Use System Default</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="layout_type">
|
<string-array name="layout_type">
|
||||||
<item>List</item>
|
<item>List</item>
|
||||||
<item>Grid</item>
|
<item>Grid</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
<string name="title_activity_thing">thing</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -30,9 +30,13 @@
|
|||||||
<item name="windowNoTitle">true</item>
|
<item name="windowNoTitle">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="NPSTheme.Splash" parent="NPSTheme">
|
<style name="NPSTheme.Splash" parent="Theme.SplashScreen">
|
||||||
<item name="android:statusBarColor">#FF00A7FF</item>
|
<item name="windowSplashScreenBackground">@color/colorAccent</item>
|
||||||
<item name="android:windowBackground">@drawable/splash</item>
|
|
||||||
|
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_nps_fg_no_shadow</item>
|
||||||
|
<item name="windowSplashScreenAnimationDuration">500</item>
|
||||||
|
|
||||||
|
<item name="postSplashScreenTheme">@style/NPSTheme</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="NPSTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
<style name="NPSTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||||
|
|||||||
Reference in New Issue
Block a user