mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
feat: implemented custom splashscreen
This commit is contained in:
parent
684fd00ed2
commit
0101e0685b
6 changed files with 87 additions and 1 deletions
|
|
@ -65,6 +65,7 @@ dependencies {
|
|||
implementation 'androidx.room:room-runtime:2.5.1'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.core:core-splashscreen:1.0.1'
|
||||
|
||||
// Google GMS
|
||||
implementation 'com.google.android.gms:play-services-cast-framework:21.3.0'
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:theme="@style/AppTheme.SplashScreen"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:allowBackup="false">
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import android.os.Handler;
|
|||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.splashscreen.SplashScreen;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.media3.common.Player;
|
||||
|
|
@ -52,6 +53,8 @@ public class MainActivity extends BaseActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
SplashScreen.installSplashScreen(this);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
bind = ActivityMainBinding.inflate(getLayoutInflater());
|
||||
|
|
|
|||
61
app/src/main/res/drawable/ic_splash_logo.xml
Normal file
61
app/src/main/res/drawable/ic_splash_logo.xml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="442.73dp"
|
||||
android:height="608.82dp"
|
||||
android:viewportWidth="442.73"
|
||||
android:viewportHeight="608.82">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M221.37,221.37m-221.37,0a221.37,221.37 0,1 1,442.74 0a221.37,221.37 0,1 1,-442.74 0"/>
|
||||
<path
|
||||
android:pathData="M221.37,221.37m-221.37,0a221.37,221.37 0,1 1,442.74 0a221.37,221.37 0,1 1,-442.74 0"
|
||||
android:fillColor="#f24b6a"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M213.29,301.38h16.14v307.44h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M181.01,325.59h16.14v226.74h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M148.73,349.8h16.14v92.93h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M51.88,349.8h16.14v72.64h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M374.71,349.8h16.14v72.64h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M116.45,325.59h16.14v121.06h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M310.14,325.59h16.14v121.06h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M84.16,301.38h16.14v169.49h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M342.43,301.38h16.14v169.49h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M277.86,349.8h16.14v92.93h-16.14z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M245.58,325.59h16.14v226.74h-16.14z"/>
|
||||
<path
|
||||
android:pathData="m118.64,168.51v14.59h-24.66v67.82h-17.33v-67.82h-24.77v-14.59h66.76Z"
|
||||
android:fillColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m160.22,233.04c-0.41,3.62 -2.29,7.29 -5.65,11.02 -5.22,5.93 -12.53,8.89 -21.92,8.89 -7.75,0 -14.59,-2.5 -20.52,-7.49 -5.93,-4.99 -8.89,-13.12 -8.89,-24.38 0,-10.55 2.67,-18.64 8.02,-24.27 5.35,-5.63 12.29,-8.44 20.83,-8.44 5.07,0 9.64,0.95 13.7,2.85 4.06,1.9 7.42,4.9 10.06,9 2.39,3.62 3.93,7.81 4.64,12.58 0.41,2.8 0.58,6.82 0.5,12.08h-41.71c0.22,6.11 2.14,10.4 5.76,12.86 2.2,1.53 4.85,2.29 7.94,2.29 3.28,0 5.95,-0.93 8,-2.8 1.12,-1.01 2.11,-2.4 2.96,-4.19h16.27ZM144.45,214.36c-0.26,-4.21 -1.54,-7.41 -3.83,-9.59 -2.29,-2.18 -5.14,-3.27 -8.53,-3.27 -3.69,0 -6.55,1.16 -8.58,3.47 -2.03,2.31 -3.31,5.44 -3.83,9.39h24.77Z"
|
||||
android:fillColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m202.87,206.76c-1.34,-2.94 -3.97,-4.42 -7.88,-4.42 -4.55,0 -7.6,1.47 -9.17,4.42 -0.86,1.68 -1.29,4.18 -1.29,7.49v36.68h-16.16v-60.84h15.49v8.89c1.98,-3.17 3.84,-5.42 5.59,-6.77 3.09,-2.39 7.1,-3.58 12.02,-3.58 4.66,0 8.42,1.03 11.29,3.08 2.31,1.9 4.06,4.34 5.26,7.32 2.09,-3.58 4.68,-6.21 7.77,-7.88 3.28,-1.68 6.93,-2.52 10.96,-2.52 2.68,0 5.33,0.52 7.94,1.57 2.61,1.04 4.98,2.87 7.1,5.48 1.71,2.12 2.87,4.73 3.47,7.83 0.37,2.05 0.56,5.05 0.56,9l-0.11,38.41h-16.33v-38.81c0,-2.31 -0.37,-4.21 -1.12,-5.7 -1.42,-2.83 -4.03,-4.25 -7.83,-4.25 -4.4,0 -7.44,1.83 -9.11,5.48 -0.86,1.94 -1.29,4.27 -1.29,6.99v36.29h-16.05v-36.29c0,-3.62 -0.37,-6.24 -1.12,-7.88Z"
|
||||
android:fillColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m315.61,196.53c4.92,5.26 7.38,12.97 7.38,23.15 0,10.74 -2.41,18.92 -7.24,24.55 -4.83,5.63 -11.04,8.44 -18.65,8.44 -4.85,0 -8.87,-1.21 -12.08,-3.63 -1.75,-1.34 -3.47,-3.3 -5.14,-5.87v31.76h-15.77v-84.93h15.26v9c1.71,-2.65 3.54,-4.73 5.48,-6.26 3.54,-2.72 7.75,-4.08 12.64,-4.08 7.12,0 13.16,2.63 18.12,7.88ZM306.55,220.46c0,-4.7 -1.07,-8.85 -3.22,-12.47 -2.14,-3.62 -5.62,-5.42 -10.43,-5.42 -5.78,0 -9.75,2.74 -11.91,8.22 -1.12,2.91 -1.68,6.6 -1.68,11.07 0,7.08 1.88,12.06 5.65,14.93 2.24,1.68 4.88,2.52 7.94,2.52 4.44,0 7.82,-1.71 10.15,-5.14 2.33,-3.43 3.49,-8 3.49,-13.7Z"
|
||||
android:fillColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m383.13,197.7c5.14,6.45 7.72,14.07 7.72,22.87s-2.57,16.6 -7.72,22.95c-5.14,6.36 -12.95,9.53 -23.43,9.53s-18.28,-3.18 -23.43,-9.53c-5.14,-6.36 -7.72,-14.01 -7.72,-22.95s2.57,-16.42 7.72,-22.87c5.14,-6.45 12.95,-9.67 23.43,-9.67s18.28,3.22 23.43,9.67ZM359.65,201.5c-4.66,0 -8.25,1.65 -10.76,4.95 -2.52,3.3 -3.77,8.01 -3.77,14.12s1.26,10.83 3.77,14.15c2.52,3.32 6.1,4.98 10.76,4.98s8.24,-1.66 10.74,-4.98c2.5,-3.32 3.75,-8.03 3.75,-14.15s-1.25,-10.82 -3.75,-14.12c-2.5,-3.3 -6.08,-4.95 -10.74,-4.95Z"
|
||||
android:fillColor="#fff"/>
|
||||
</group>
|
||||
</vector>
|
||||
14
app/src/main/res/drawable/ui_splash_screen.xml
Normal file
14
app/src/main/res/drawable/ui_splash_screen.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:width="288dp"
|
||||
android:height="288dp"
|
||||
android:drawable="@android:color/transparent"
|
||||
android:gravity="center" />
|
||||
|
||||
<item
|
||||
android:width="240dp"
|
||||
android:height="240dp"
|
||||
android:drawable="@drawable/ic_splash_logo"
|
||||
android:gravity="center" />
|
||||
</layer-list>
|
||||
|
|
@ -1,5 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="AppTheme.SplashScreen" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">#f24b6a</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ui_splash_screen</item>
|
||||
<item name="postSplashScreenTheme">@style/AppTheme</item>
|
||||
<item name="windowSplashScreenAnimationDuration">100</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/md_theme_light_primary</item>
|
||||
<item name="colorOnPrimary">@color/md_theme_light_onPrimary</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue