Skip to content

Commit 891933d

Browse files
committed
Android 12 SplashScreen API has been implemented
1 parent f81b417 commit 891933d

File tree

5 files changed

+36
-4
lines changed

5 files changed

+36
-4
lines changed

owncloudApp/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ dependencies {
6161
// Preferences
6262
implementation 'androidx.preference:preference-ktx:1.1.1'
6363

64+
//SplashScreen
65+
implementation 'androidx.core:core-splashscreen:1.0.0-alpha02'
66+
6467
// Tests
6568
testImplementation project(':owncloudTestUtil')
6669
testImplementation "junit:junit:$junitVersion"

owncloudApp/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@
6767
android:supportsPictureInPicture="false"
6868
android:theme="@style/Theme.ownCloud.Toolbar"
6969
tools:targetApi="n">
70-
<activity android:name=".presentation.ui.settings.PrivacyPolicyActivity"></activity>
71-
<activity android:name=".presentation.ui.settings.SettingsActivity"></activity>
70+
<activity android:name=".presentation.ui.settings.PrivacyPolicyActivity"/>
71+
<activity android:name=".presentation.ui.settings.SettingsActivity"/>
7272
<activity
7373
android:name=".ui.activity.SplashActivity"
74-
android:theme="@style/Theme.ownCloud.Splash">
74+
android:theme="@style/Theme.App.Starting">
7575
<intent-filter>
7676
<action android:name="android.intent.action.MAIN" />
7777
<category android:name="android.intent.category.LAUNCHER" />

owncloudApp/src/main/java/com/owncloud/android/ui/activity/SplashActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ package com.owncloud.android.ui.activity
2323
import android.content.Intent
2424
import androidx.appcompat.app.AppCompatActivity
2525
import android.os.Bundle
26+
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
2627

2728
class SplashActivity : AppCompatActivity() {
2829

2930
override fun onCreate(savedInstanceState: Bundle?) {
3031
super.onCreate(savedInstanceState)
32+
installSplashScreen()
3133
startActivity(Intent(this, FileDisplayActivity::class.java))
3234
finish()
3335
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ ownCloud Android client application
4+
~
5+
~ @author Fernando Sanz Velasco
6+
~ Copyright (C) 2021 ownCloud GmbH.
7+
~
8+
~ This program is free software: you can redistribute it and/or modify
9+
~ it under the terms of the GNU General Public License version 2,
10+
~ as published by the Free Software Foundation.
11+
~
12+
~ This program is distributed in the hope that it will be useful,
13+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
~ GNU General Public License for more details.
16+
~
17+
~ You should have received a copy of the GNU General Public License
18+
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
~
20+
-->
21+
22+
<resources>
23+
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
24+
<item name="windowSplashScreenBackground">@color/splash_background</item>
25+
<item name="postSplashScreenTheme">@style/Theme.ownCloud.Toolbar.Drawer</item>
26+
</style>
27+
</resources>

owncloudApp/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
</style>
4949

5050
<!-- Splash Screen -->
51-
<style name="Theme.ownCloud.Splash">
51+
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
5252
<item name="android:windowBackground">@drawable/splash_screen</item>
5353
</style>
5454

0 commit comments

Comments
 (0)