-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create animated splash screen for Android 12 and later
- Loading branch information
1 parent
9c83226
commit f850523
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
app/src/main/res/drawable-v31/animated_splash_foreground.xml
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,29 @@ | ||
<animated-vector | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:drawable="@drawable/splash_foreground"> | ||
|
||
<target android:name="translationGroup"> | ||
<aapt:attr name="android:animation"> | ||
<objectAnimator | ||
android:propertyName="translateX" | ||
android:duration="500" | ||
android:valueFrom="-10" | ||
android:valueTo="21.5" | ||
android:valueType="floatType" | ||
android:interpolator="@android:anim/accelerate_decelerate_interpolator"/> | ||
</aapt:attr> | ||
</target> | ||
<target android:name="splashForeground"> | ||
<aapt:attr name="android:animation"> | ||
<objectAnimator | ||
android:propertyName="alpha" | ||
android:duration="500" | ||
android:valueFrom="0" | ||
android:valueTo="1" | ||
android:valueType="floatType" | ||
android:interpolator="@android:anim/accelerate_decelerate_interpolator"/> | ||
</aapt:attr> | ||
</target> | ||
|
||
</animated-vector> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<style name="Base.SplashTheme" parent="Theme.SplashScreen.IconBackground"> | ||
<item name="windowSplashScreenIconBackgroundColor">@color/dark_youtube_primary_color</item> | ||
<item name="windowSplashScreenAnimatedIcon">@drawable/animated_splash_foreground</item> | ||
<item name="postSplashScreenTheme">@style/Base.DarkTheme</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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
<style name="Base.SplashTheme" parent="Theme.SplashScreen.IconBackground"> | ||
<item name="windowSplashScreenIconBackgroundColor">@color/light_youtube_primary_color</item> | ||
<item name="windowSplashScreenAnimatedIcon">@drawable/animated_splash_foreground</item> | ||
<item name="postSplashScreenTheme">@style/Base.LightTheme</item> | ||
</style> | ||
|
||
</resources> |