Skip to content

Commit

Permalink
use modern splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
newhinton committed Jan 31, 2024
1 parent 66ad67c commit ea1f139
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import de.felixnuesse.timedsilence.fragments.BluetoothFragment
import de.felixnuesse.timedsilence.fragments.CheckupFragment
import de.felixnuesse.timedsilence.fragments.KeywordFragment
import de.felixnuesse.timedsilence.fragments.ScheduleFragment
import de.felixnuesse.timedsilence.fragments.WifiConnectedFragment
import de.felixnuesse.timedsilence.fragments.graph.GraphFragment
import de.felixnuesse.timedsilence.fragments.settings.CalendarFragment
import de.felixnuesse.timedsilence.handler.*
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/ic_launcher_foreground_colored.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group android:scaleX="0.4251923"
android:scaleY="0.4251923"
android:translateX="6.708718"
android:translateY="6.897692">
<path
android:pathData="M4,2V8H2V2H4M2,22V16H4V22H2M5,12C5,13.11 4.11,14 3,14C1.9,14 1,13.11 1,12C1,10.9 1.9,10 3,10C4.11,10 5,10.9 5,12M16,4C20.42,4 24,7.58 24,12C24,16.42 20.42,20 16,20C12.4,20 9.36,17.62 8.35,14.35L6,12L8.35,9.65C9.36,6.38 12.4,4 16,4M16,6C12.69,6 10,8.69 10,12C10,15.31 12.69,18 16,18C19.31,18 22,15.31 22,12C22,8.69 19.31,6 16,6M15,13V8H16.5V12.2L19.5,14L18.68,15.26L15,13Z"
android:fillColor="?attr/colorOnPrimary"/>
</group>
</vector>
13 changes: 11 additions & 2 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">

<resources>
<style name="AppTheme" parent="Theme.Material3.Dark.NoActionBar">
<item name="colorPrimary">@color/md_theme_dark_primary</item>
<item name="colorOnPrimary">@color/md_theme_dark_onPrimary</item>
<item name="colorPrimaryContainer">@color/md_theme_dark_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/md_theme_dark_onPrimaryContainer</item>

<item name="colorSecondary">@color/md_theme_dark_secondary</item>
<item name="colorOnSecondary">@color/md_theme_dark_onSecondary</item>
<item name="colorSecondaryContainer">@color/md_theme_dark_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/md_theme_dark_onSecondaryContainer</item>

<item name="colorTertiary">@color/md_theme_dark_tertiary</item>
<item name="colorOnTertiary">@color/md_theme_dark_onTertiary</item>
<item name="colorTertiaryContainer">@color/md_theme_dark_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/md_theme_dark_onTertiaryContainer</item>

<item name="colorError">@color/md_theme_dark_error</item>
<item name="colorErrorContainer">@color/md_theme_dark_errorContainer</item>
<item name="colorOnError">@color/md_theme_dark_onError</item>
<item name="colorOnErrorContainer">@color/md_theme_dark_onErrorContainer</item>

<item name="android:colorBackground">@color/md_theme_dark_background</item>
<item name="colorOnBackground">@color/md_theme_dark_onBackground</item>
<item name="colorSurface">@color/md_theme_dark_surface</item>
Expand All @@ -27,6 +31,11 @@
<item name="colorOnSurfaceInverse">@color/md_theme_dark_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/md_theme_dark_inverseSurface</item>
<item name="colorPrimaryInverse">@color/md_theme_dark_inversePrimary</item>

<item name="android:windowSplashScreenAnimatedIcon" tools:targetApi="31">@drawable/ic_launcher_foreground_colored</item>
<item name="android:windowSplashScreenBackground" tools:targetApi="31">?attr/colorPrimary</item>

<item name="useDarkStatusbarText">false</item>
</style>


Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<attr name="useDarkStatusbarText" format="boolean"/>
</resources>
6 changes: 4 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
<item name="android:windowLightStatusBar">?attr/useDarkStatusbarText</item>



Expand All @@ -25,12 +25,14 @@
<style name="BaseStyle.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>

<item name="android:windowLightStatusBar">?attr/useDarkStatusbarText</item>
</style>

<style name="AboutStyle" parent="AppTheme">
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
<item name="android:windowLightStatusBar">?attr/useDarkStatusbarText</item>
</style>

<style name="BaseStyle.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">

<item name="colorPrimary">@color/md_theme_light_primary</item>
Expand Down Expand Up @@ -32,6 +32,10 @@
<item name="colorSurfaceInverse">@color/md_theme_light_inverseSurface</item>
<item name="colorPrimaryInverse">@color/md_theme_light_inversePrimary</item>

<item name="android:windowSplashScreenAnimatedIcon" tools:targetApi="31">@drawable/ic_launcher_foreground_colored</item>
<item name="android:windowSplashScreenBackground" tools:targetApi="31">?attr/colorPrimary</item>

<item name="useDarkStatusbarText">true</item>
</style>

<style name="AlertDialogCustom" parent="ThemeOverlay.Material3.Dialog">
Expand Down

0 comments on commit ea1f139

Please sign in to comment.