sforkowany z mirror/meshtastic-android
				
			add splash screen
							rodzic
							
								
									a0d00a4287
								
							
						
					
					
						commit
						239a22c1bc
					
				| 
						 | 
				
			
			@ -196,5 +196,7 @@ dependencies {
 | 
			
		|||
    // implementation "androidx.work:work-runtime:$work_version"
 | 
			
		||||
    implementation "androidx.work:work-runtime-ktx:$work_version"
 | 
			
		||||
 | 
			
		||||
    implementation "androidx.core:core-splashscreen:1.0.0-beta01"
 | 
			
		||||
 | 
			
		||||
    implementation project(':geeksville-androidlib')
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -128,7 +128,7 @@
 | 
			
		|||
            android:label="@string/app_name"
 | 
			
		||||
            android:screenOrientation="portrait"
 | 
			
		||||
            android:windowSoftInputMode="stateAlwaysHidden"
 | 
			
		||||
            android:theme="@style/AppTheme"
 | 
			
		||||
            android:theme="@style/Theme.App.Starting"
 | 
			
		||||
            android:exported="true">
 | 
			
		||||
            <intent-filter>
 | 
			
		||||
                <action android:name="android.intent.action.MAIN" />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,6 +33,7 @@ import androidx.appcompat.app.AppCompatDelegate
 | 
			
		|||
import androidx.appcompat.widget.Toolbar
 | 
			
		||||
import androidx.core.app.ActivityCompat
 | 
			
		||||
import androidx.core.content.ContextCompat
 | 
			
		||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
 | 
			
		||||
import androidx.fragment.app.Fragment
 | 
			
		||||
import androidx.fragment.app.FragmentManager
 | 
			
		||||
import androidx.fragment.app.FragmentTransaction
 | 
			
		||||
| 
						 | 
				
			
			@ -477,6 +478,7 @@ class MainActivity : AppCompatActivity(), Logging,
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    override fun onCreate(savedInstanceState: Bundle?) {
 | 
			
		||||
        installSplashScreen()
 | 
			
		||||
        super.onCreate(savedInstanceState)
 | 
			
		||||
 | 
			
		||||
        binding = ActivityMainBinding.inflate(layoutInflater)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,4 +73,18 @@
 | 
			
		|||
        <item name="materialThemeOverlay">@style/MyThemeOverlay_Toolbar</item>
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
    <style name="Theme.App.Starting" parent="Theme.SplashScreen">
 | 
			
		||||
        // Set the splash screen background, animated icon, and animation duration.
 | 
			
		||||
        <item name="windowSplashScreenBackground">@color/selectedColor</item>
 | 
			
		||||
 | 
			
		||||
        // Use windowSplashScreenAnimatedIcon to add either a drawable or an
 | 
			
		||||
        // animated drawable. One of these is required.
 | 
			
		||||
        <item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher2_foreground</item>
 | 
			
		||||
         <item name="windowSplashScreenAnimationDuration">1000</item>  # Required for
 | 
			
		||||
        # animated icons
 | 
			
		||||
 | 
			
		||||
        // Set the theme of the Activity that directly follows your splash screen.
 | 
			
		||||
        <item name="postSplashScreenTheme">@style/AppTheme</item>  # Required.
 | 
			
		||||
    </style>
 | 
			
		||||
 | 
			
		||||
</resources>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue