Skip to content

Commit edc2787

Browse files
committed
Add splashing screen
1 parent b4b9e32 commit edc2787

File tree

18 files changed

+234
-6
lines changed

18 files changed

+234
-6
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ android {
2424
defaultConfig {
2525
applicationId "com.jerry.blescanner"
2626

27-
versionCode 5
28-
versionName "1.0.0"
27+
versionCode 7
28+
versionName "1.0.2"
2929

3030
buildConfigField "String", "BASE_URL", "\"https://api-proxy.ofcom.org.uk/\""
3131
buildConfigField "String", "KEY", "\"\""
@@ -94,6 +94,7 @@ android {
9494
dependencies {
9595
implementation project(":base-modiule")
9696
implementation project(":jetpack-design-lib")
97+
implementation project(":features:splash")
9798
implementation project(":features:bluetooth")
9899

99100
// LeakCanary //app only
@@ -104,7 +105,6 @@ dependencies {
104105
implementation("com.google.firebase:firebase-crashlytics-ktx")
105106
implementation("com.google.firebase:firebase-analytics-ktx")
106107

107-
108108
}
109109

110110
// Allow references to generated code {https://developer.android.com/training/dependency-injection/hilt-android}

app/src/main/AndroidManifest.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,26 @@
2828
android:label="@string/app_name"
2929
android:roundIcon="@mipmap/ic_launcher_round"
3030
android:supportsRtl="true"
31-
android:theme="@style/Theme.BleScanner"
31+
android:theme="@style/Theme.App.Starting"
3232
tools:targetApi="31">
33+
3334
<activity
34-
android:name="com.jerry.blescanner.features.bluetooth.presentation.BluetoothActivity"
35+
android:name="com.jerry.blescanner.features.splash.presentation.SplashActivity"
3536
android:exported="true"
3637
android:label="@string/app_name"
37-
android:theme="@style/Theme.BleScanner">
38+
android:theme="@style/Theme.App.Starting">
3839
<intent-filter>
3940
<action android:name="android.intent.action.MAIN" />
4041

4142
<category android:name="android.intent.category.LAUNCHER" />
4243
</intent-filter>
4344
</activity>
45+
46+
<activity
47+
android:name="com.jerry.blescanner.features.bluetooth.presentation.BluetoothActivity"
48+
android:exported="true"
49+
android:label="@string/app_name"
50+
android:theme="@style/Theme.BleScanner"/>
4451
</application>
4552

4653
</manifest>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:duration="1000">
4+
5+
<propertyValuesHolder
6+
android:propertyName="rotation"
7+
android:valueType="floatType"
8+
android:valueFrom="0.0"
9+
android:valueTo="360.0"/>
10+
11+
<propertyValuesHolder
12+
android:propertyName="scaleX"
13+
android:valueType="floatType"
14+
android:valueFrom="0.0"
15+
android:valueTo="0.4"/>
16+
17+
<propertyValuesHolder
18+
android:propertyName="scaleY"
19+
android:valueType="floatType"
20+
android:valueFrom="0.0"
21+
android:valueTo="0.4"/>
22+
23+
</objectAnimator>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:drawable="@drawable/logo">
4+
5+
<target
6+
android:animation="@animator/logo_animator"
7+
android:name="animationGroup"/>
8+
9+
</animated-vector>

app/src/main/res/drawable/logo.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<vector android:height="24dp" android:tint="#2334A2"
2+
android:viewportHeight="24" android:viewportWidth="24"
3+
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
4+
<!--animation-->
5+
<group
6+
android:name="animationGroup"
7+
android:pivotX="12"
8+
android:pivotY="12">
9+
<path android:fillColor="@android:color/white" android:pathData="M17.71,7.71L12,2h-1v7.59L6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 11,14.41L11,22h1l5.71,-5.71 -4.3,-4.29 4.3,-4.29zM13,5.83l1.88,1.88L13,9.59L13,5.83zM14.88,16.29L13,18.17v-3.76l1.88,1.88z"/>
10+
</group>
11+
</vector>

app/src/main/res/values/themes.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
<resources>
33

44
<style name="Theme.BleScanner" parent="android:Theme.Material.Light.NoActionBar" />
5+
6+
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
7+
<item name="windowSplashScreenBackground">@color/black</item>
8+
<item name="postSplashScreenTheme">@style/Theme.BleScanner</item>
9+
<item name="windowSplashScreenAnimatedIcon">@drawable/animated_logo</item>
10+
</style>
511
</resources>

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ buildscript {
6969
lifecycle_runtime_compose_version = "2.6.2"
7070

7171
jetpack_navigation_compose_version = "2.5.3"
72+
73+
core_splachscreen_version = '1.0.1'
7274
}
7375

7476
repositories {

common-library.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ dependencies {
4747

4848
//permission
4949
implementation "com.google.accompanist:accompanist-permissions:$permission_verion"
50+
51+
//splashscreen
52+
implementation "androidx.core:core-splashscreen:$core_splachscreen_version"
5053
}

features/splash/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

features/splash/build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
plugins {
2+
id 'com.android.library'
3+
id 'org.jetbrains.kotlin.android'
4+
id 'com.google.dagger.hilt.android'
5+
}
6+
7+
apply from: "$project.rootDir/common-android-version.gradle"
8+
apply from: "$project.rootDir/common-library.gradle"
9+
apply from: "$project.rootDir/jacoco.gradle"
10+
apply from: "$project.rootDir/jetpack-compose.gradle"
11+
12+
13+
android {
14+
namespace 'com.jerry.blescanner.features.splash'
15+
}
16+
17+
18+
dependencies {
19+
implementation project(":base-modiule")
20+
implementation project(":jetpack-design-lib")
21+
implementation project(":features:bluetooth")
22+
23+
// testImplementation project(":shared-test")
24+
// androidTestImplementation project(":shared-test")
25+
26+
}

0 commit comments

Comments
 (0)