-
-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use new SplashScreen API on Android 12 and newer (API level 31 …
…and up) (#4871) This PR implements the new SplashScreen API on Android 12 and newer, provides backwards compatibility using the Splash Screen compat library (on API < 31, the old splash screen is shown). The implementation works both with light and dark themes. Tested on API 29 (backwards compatible) and API 32 (uses the new API).
- Loading branch information
Showing
4 changed files
with
77 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<style name="OFFTheme" parent="Theme.MaterialComponents.DayNight.Bridge"> | ||
<!--<item name="colorPrimary">@color/material_blue_500</item>--> | ||
<!--<item name="statusBarColor">@color/grey_300</item>--> | ||
<!--<item name="colorBackground">@color/grey_50</item>--> | ||
<item name="colorAccent">@color/brand_red</item> | ||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> | ||
<item name="searchViewStyle">@style/customSearchView</item> | ||
|
||
<item name="android:textColorLink">@color/brand_light_blue</item> | ||
|
||
<!-- Material drawer --> | ||
<item name="material_drawer_background">@color/material_drawer_dark_background</item> | ||
<item name="material_drawer_primary_text">@color/material_drawer_dark_primary_text</item> | ||
<item name="material_drawer_primary_icon">@color/material_drawer_dark_primary_icon</item> | ||
<item name="material_drawer_secondary_text">@color/material_drawer_dark_secondary_text</item> | ||
<item name="material_drawer_hint_text">@color/material_drawer_dark_hint_text</item> | ||
<item name="material_drawer_divider">@color/material_drawer_dark_divider</item> | ||
<item name="material_drawer_selected">@color/material_drawer_dark_selected</item> <!-- Material 2 defines 12% alpha, primary color --> | ||
<item name="material_drawer_selected_legacy">@color/material_drawer_dark_selected | ||
</item> <!-- Defines the color if legacy style (Material 1, is enabled) --> | ||
<item name="material_drawer_selected_text">@color/material_drawer_dark_selected_text</item> | ||
<item name="material_drawer_header_selection_text">@color/material_drawer_dark_header_selection_text</item> | ||
<item name="material_drawer_header_selection_subtext">@color/material_drawer_header_selection_subtext</item> | ||
<item name="material_drawer_legacy_style">false</item> <!-- Enables legacy Material 1 style --> | ||
</style> | ||
|
||
<style name="ButtonBorder" parent="ButtonRounded"> | ||
<item name="android:background">@drawable/rounded_button_shape</item> | ||
<item name="android:textColor">@color/brand_light_blue</item> | ||
<item name="android:textStyle">bold</item> | ||
<item name="android:paddingLeft">@dimen/spacing_small</item> | ||
<item name="android:paddingRight">@dimen/spacing_small</item> | ||
<item name="android:paddingTop">@dimen/spacing_tiny</item> | ||
<item name="android:paddingBottom">@dimen/spacing_tiny</item> | ||
<item name="android:shadowColor">@android:color/transparent</item> | ||
</style> | ||
|
||
<style name="PreferenceThemeOverlay.v14" tools:override="true"> | ||
<item name="android:textColor">?android:textColorPrimary</item> | ||
<item name="android:textColorSecondary">@color/grey_500</item> | ||
</style> | ||
|
||
<style name="BrandedFloatingActionButton" parent="Widget.Design.FloatingActionButton"> | ||
<item name="backgroundTint">@color/brand_light_blue</item> | ||
<item name="android:tint">@color/grey_200</item> | ||
</style> | ||
|
||
<style name="SplashTheme" parent="Theme.SplashScreen.IconBackground"> | ||
<item name="windowSplashScreenBackground">@color/grey_800</item> | ||
<item name="windowSplashScreenIconBackgroundColor">@color/grey_400</item> | ||
<item name="postSplashScreenTheme">@style/Theme.AppCompat.DayNight</item> | ||
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher_round</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