Migrate to new AndroidX-SplashScreen

This commit is contained in:
Julian Raufelder 2022-05-24 11:21:23 +02:00
parent 7e0916540d
commit e0f36dbead
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D
15 changed files with 31 additions and 140 deletions

View File

@ -111,6 +111,7 @@ ext {
androidxDocumentfileVersion = '1.0.1' androidxDocumentfileVersion = '1.0.1'
androidxBiometricVersion = '1.1.0' androidxBiometricVersion = '1.1.0'
androidxTestCoreVersion = '1.4.0' androidxTestCoreVersion = '1.4.0'
androidxSplashscreenVersion = '1.0.0-rc01'
jsonWebTokenApiVersion = '0.11.5' jsonWebTokenApiVersion = '0.11.5'
@ -126,6 +127,7 @@ ext {
androidxPreference : "androidx.preference:preference:${androidxPreferenceVersion}", androidxPreference : "androidx.preference:preference:${androidxPreferenceVersion}",
documentFile : "androidx.documentfile:documentfile:${androidxDocumentfileVersion}", documentFile : "androidx.documentfile:documentfile:${androidxDocumentfileVersion}",
recyclerView : "androidx.recyclerview:recyclerview:${androidxRecyclerViewVersion}", recyclerView : "androidx.recyclerview:recyclerview:${androidxRecyclerViewVersion}",
androidxSplashscreen : "androidx.core:core-splashscreen:${androidxSplashscreenVersion}",
androidxTestCore : "androidx.test:core:${androidxTestCoreVersion}", androidxTestCore : "androidx.test:core:${androidxTestCoreVersion}",
androidxTestJunitKtln : "androidx.test.ext:junit-ktx:${androidxTestJunitKtlnVersion}", androidxTestJunitKtln : "androidx.test.ext:junit-ktx:${androidxTestJunitKtlnVersion}",
commonsCodec : "commons-codec:commons-codec:${commonsCodecVersion}", commonsCodec : "commons-codec:commons-codec:${commonsCodecVersion}",

View File

@ -153,6 +153,7 @@ dependencies {
implementation dependencies.androidxCore implementation dependencies.androidxCore
implementation dependencies.androidxFragment implementation dependencies.androidxFragment
implementation dependencies.androidxViewpager implementation dependencies.androidxViewpager
implementation dependencies.androidxSplashscreen
implementation dependencies.androidxSwiperefresh implementation dependencies.androidxSwiperefresh
implementation dependencies.androidxPreference implementation dependencies.androidxPreference
implementation dependencies.androidxBiometric implementation dependencies.androidxBiometric

View File

@ -36,20 +36,17 @@
android:required="false" /> android:required="false" />
<activity <activity
android:name=".ui.activity.SplashActivity" android:name=".ui.activity.VaultListActivity"
android:exported="true" android:exported="true"
android:screenOrientation="portrait" android:theme="@style/AppTheme.Starting"
android:theme="@style/SplashTheme"> android:windowSoftInputMode="adjustPan">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".ui.activity.VaultListActivity"
android:exported="false"
android:windowSoftInputMode="adjustPan" />
<activity android:name=".ui.activity.ChooseCloudServiceActivity" /> <activity android:name=".ui.activity.ChooseCloudServiceActivity" />
<activity <activity
android:name=".ui.activity.CreateVaultActivity" android:name=".ui.activity.CreateVaultActivity"
@ -91,6 +88,7 @@
android:theme="@style/TransparentPopUp" /> android:theme="@style/TransparentPopUp" />
<!-- Cloud Services --> <!-- Cloud Services -->
<!-- TODO move out into custom manifest-->
<activity <activity
android:name="com.dropbox.core.android.AuthActivity" android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard" android:configChanges="orientation|keyboard"
@ -191,6 +189,7 @@
</intent-filter> </intent-filter>
</activity> </activity>
<!-- TODO move out into custom manifest-->
<activity <activity
android:name="com.microsoft.identity.client.BrowserTabActivity" android:name="com.microsoft.identity.client.BrowserTabActivity"
android:exported="true"> android:exported="true">

View File

@ -21,7 +21,6 @@ import org.cryptomator.presentation.ui.activity.S3AddOrChangeActivity;
import org.cryptomator.presentation.ui.activity.SetPasswordActivity; import org.cryptomator.presentation.ui.activity.SetPasswordActivity;
import org.cryptomator.presentation.ui.activity.SettingsActivity; import org.cryptomator.presentation.ui.activity.SettingsActivity;
import org.cryptomator.presentation.ui.activity.SharedFilesActivity; import org.cryptomator.presentation.ui.activity.SharedFilesActivity;
import org.cryptomator.presentation.ui.activity.SplashActivity;
import org.cryptomator.presentation.ui.activity.TextEditorActivity; import org.cryptomator.presentation.ui.activity.TextEditorActivity;
import org.cryptomator.presentation.ui.activity.UnlockVaultActivity; import org.cryptomator.presentation.ui.activity.UnlockVaultActivity;
import org.cryptomator.presentation.ui.activity.VaultListActivity; import org.cryptomator.presentation.ui.activity.VaultListActivity;
@ -51,8 +50,6 @@ public interface ActivityComponent {
Activity activity(); Activity activity();
void inject(SplashActivity splashActivity);
void inject(VaultListActivity vaultListActivity); void inject(VaultListActivity vaultListActivity);
void inject(SetPasswordActivity setPasswordActivity); void inject(SetPasswordActivity setPasswordActivity);

View File

@ -1,16 +0,0 @@
package org.cryptomator.presentation.presenter
import org.cryptomator.domain.di.PerView
import org.cryptomator.presentation.exception.ExceptionHandlers
import org.cryptomator.presentation.intent.Intents
import org.cryptomator.presentation.ui.activity.view.SplashView
import javax.inject.Inject
@PerView
class SplashPresenter @Inject constructor(exceptionMappings: ExceptionHandlers) : Presenter<SplashView>(exceptionMappings) {
override fun resumed() {
Intents.vaultListIntent().startActivity(this)
finish()
}
}

View File

@ -1,14 +0,0 @@
package org.cryptomator.presentation.ui.activity
import org.cryptomator.generator.Activity
import org.cryptomator.presentation.presenter.SplashPresenter
import org.cryptomator.presentation.ui.activity.view.SplashView
import javax.inject.Inject
@Activity(secure = false)
class SplashActivity : BaseActivity(), SplashView {
@Inject
lateinit var splashPresenter: SplashPresenter
}

View File

@ -2,7 +2,9 @@ package org.cryptomator.presentation.ui.activity
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Bundle
import android.view.View import android.view.View
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import org.cryptomator.generator.Activity import org.cryptomator.generator.Activity
import org.cryptomator.generator.InjectIntent import org.cryptomator.generator.InjectIntent
@ -47,6 +49,11 @@ class VaultListActivity : BaseActivity(), //
@InjectIntent @InjectIntent
lateinit var vaultListIntent: VaultListIntent lateinit var vaultListIntent: VaultListIntent
override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
super.onCreate(savedInstanceState)
}
override fun onWindowFocusChanged(hasFocus: Boolean) { override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus) super.onWindowFocusChanged(hasFocus)
vaultListPresenter.onWindowFocusChanged(hasFocus) vaultListPresenter.onWindowFocusChanged(hasFocus)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorPrimary" />
<item android:drawable="@drawable/ic_clear" />
</layer-list>

View File

@ -1,87 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="1110dp"
android:height="942dp"
android:viewportWidth="1108.1"
android:viewportHeight="940.2">
<path
android:pathData="m552.7,0c-169.1,0 -262.5,143.5 -262.5,283.5h524.9c0,-140.1 -105.3,-283.5 -262.5,-283.5z"
android:fillColor="#cfcfcf"/>
<path
android:pathData="m552.7,53.2c-137.4,0 -213.2,116.5 -213.2,230.3l213.2,24.2 213.2,-24.2c0,-113.8 -85.6,-230.3 -213.2,-230.3z"
android:fillColor="#585e62"/>
<path
android:pathData="m89.8,739.5a20,20 0,0 1,-2.2 -39.9,42.8 42.8,0 1,0 -42.2,-21.8 20,20 0,0 1,-35 19.3,82.8 82.8,0 1,1 81.8,42.3 21.8,21.8 0,0 1,-2.3 0.1z"
android:fillColor="#585e62"/>
<path
android:pathData="M172.8,474.6L178,477.2A49.4,49.4 72.1,0 1,199.5 543.7L178.9,584.1A49.4,49.4 72.1,0 1,112.4 605.6L107.2,602.9A49.4,49.4 72.1,0 1,85.7 536.4L106.3,496.1A49.4,49.4 72.1,0 1,172.8 474.6z"
android:fillColor="#cfcfcf"/>
<path
android:pathData="m181.6,393.9l55.9,28.6a0,0 0,0 1,0 0l-43.1,84.2a31.4,31.4 72.1,0 1,-42.3 13.7,31.4 31.4,72.1 0,1 -13.7,-42.3l43.1,-84.2a0,0 0,0 1,0 0z"
android:fillColor="#585e62"/>
<path
android:pathData="M222.6,387.5m-75.1,0a75.1,75.1 0,1 1,150.1 0a75.1,75.1 0,1 1,-150.1 0"
android:fillColor="#cfcfcf"/>
<path
android:pathData="m258.1,321.8a75.1,75.1 0,0 0,-91.2 14.6,75.1 75.1,0 0,1 51.6,126.1 75.1,75.1 0,0 0,39.7 -140.7z"
android:fillColor="#b1b1b1"/>
<path
android:pathData="m1018.3,739.5a22.1,22.1 0,0 1,-2.3 -0.1,82.8 82.8,0 1,1 81.8,-42.3 20,20 0,1 1,-35 -19.3,42.8 42.8,0 1,0 -42.2,21.8 20,20 0,0 1,-2.2 39.9z"
android:fillColor="#585e62"/>
<path
android:pathData="M1000.9,603L995.7,605.6A49.4,49.4 107.9,0 1,929.2 584.2L908.6,543.8A49.4,49.4 107.9,0 1,930.1 477.3L935.3,474.6A49.4,49.4 107.9,0 1,1001.8 496.1L1022.4,536.5A49.4,49.4 107.9,0 1,1000.9 603z"
android:fillColor="#cfcfcf"/>
<path
android:pathData="m955.9,520.4a31.4,31.4 107.9,0 1,-42.3 -13.7l-43.1,-84.2a0,0 0,0 1,-0 0l55.9,-28.6a0,0 0,0 1,-0 0l43.1,84.2a31.4,31.4 107.9,0 1,-13.7 42.3z"
android:fillColor="#585e62"/>
<path
android:pathData="M885.5,387.5m-75.1,0a75.1,75.1 0,1 1,150.1 0a75.1,75.1 0,1 1,-150.1 0"
android:fillColor="#cfcfcf"/>
<path
android:pathData="m850,321.8a75.1,75.1 0,0 1,91.2 14.6,75.1 75.1,0 0,0 -51.5,126.1 75.1,75.1 0,0 1,-39.7 -140.7z"
android:fillColor="#b1b1b1"/>
<path
android:pathData="m248.8,940.2c-36.7,0 -67,-39.8 -75.5,-99.2 -4.6,-31.8 -2.3,-65.2 6.5,-94 9.4,-31 25.5,-53.6 45.3,-63.7a51.7,51.7 0,0 1,23.7 -5.8h103.5v262.7z"
android:fillColor="#585e62"/>
<path
android:pathData="m351.4,940.2c-21.3,0 -38.8,-39.8 -43.8,-99.2 -2.6,-31.8 -1.3,-65.2 3.8,-94 5.4,-31 14.8,-53.6 26.3,-63.7 4.4,-3.9 9,-5.8 13.7,-5.8s9.3,2 13.8,5.8l49.7,43.8c17.4,15.3 23.4,64 20.2,102 -2.4,29.3 -10,52.2 -20.2,61.3l-49.7,43.8c-4.4,4 -9.1,6 -13.8,6z"
android:fillColor="#585e62"/>
<path
android:pathData="m360.6,699 l49.7,43.8c11.2,9.9 17.8,47.5 14.8,83.9 -2,24.3 -7.8,42 -14.8,48.1l-49.7,43.8c-18.6,16.4 -37.8,-19.4 -42.8,-80.1s6,-123.1 24.6,-139.5c6.2,-5.4 12.5,-5 18.2,-0z"
android:fillColor="#35393b"/>
<path
android:pathData="m850.7,940.2c36.7,0 67,-39.8 75.5,-99.2 4.6,-31.8 2.3,-65.2 -6.5,-94 -9.4,-31 -25.5,-53.6 -45.3,-63.7a51.7,51.7 0,0 0,-23.7 -5.8h-103.5v262.7z"
android:fillColor="#585e62"/>
<path
android:pathData="m748.1,940.2c21.3,0 38.8,-39.8 43.8,-99.2 2.6,-31.8 1.3,-65.2 -3.8,-94 -5.4,-31 -14.8,-53.6 -26.3,-63.7 -4.4,-3.9 -9,-5.8 -13.7,-5.8s-9.3,2 -13.8,5.8l-49.7,43.8c-17.4,15.3 -23.4,64 -20.2,102 2.4,29.3 10,52.2 20.2,61.3l49.7,43.8c4.4,4 9.1,6 13.8,6z"
android:fillColor="#585e62"/>
<path
android:pathData="m738.9,699 l-49.7,43.8c-11.2,9.9 -17.8,47.4 -14.8,83.9 2,24.3 7.8,42 14.8,48.1l49.7,43.8c18.6,16.4 37.8,-19.4 42.8,-80.1s-6,-123.1 -24.6,-139.5c-6.2,-5.4 -12.5,-5 -18.2,0z"
android:fillColor="#35393b"/>
<path
android:pathData="m848.6,451.4a83.6,83.6 0,0 1,-0.6 -45.6c14.7,-53.1 5.1,-111.8 5.1,-111.8 -185.1,-57.8 -300.1,-0.5 -300.1,-0.5s-114.8,-57.6 -300,-0.4c0,0 -9.9,58.6 4.7,111.8a83.7,83.7 0,0 1,-0.7 45.6c-5.1,17.6 -10.7,44.5 -10.8,78.8 -0.4,249 306,326.1 306,326.1s306.6,-76.2 307,-325.2c0,-34.3 -5.5,-61.2 -10.6,-78.8z"
android:fillColor="#cfcfcf"/>
<path
android:pathData="m552.3,808.9c-50.7,-15.9 -261.7,-93.3 -261.4,-279.5 0,-29.6 4.9,-52.4 9,-66.3a128.3,128.3 0,0 0,0.9 -70c-6.2,-22.6 -6.9,-47.1 -6.2,-65.3 40.5,-10.2 80.2,-15.4 118.4,-15.3 75.7,0.1 119.9,21 120.3,21.2l20.4,10.2 19.2,-10.3c0.1,0 44.4,-20.8 120,-20.6 38.2,0.1 77.9,5.3 118.4,15.7 0.7,18.1 -0.1,42.7 -6.4,65.3a128.3,128.3 0,0 0,0.7 70c4,13.9 8.8,36.7 8.8,66.3 -0.3,187.1 -211.3,263.1 -262.1,278.7z"
android:fillColor="#49b04a"/>
<path
android:pathData="m610.2,478.8a57.5,57.5 0,1 0,-70.2 55.9l-32.3,135.5 44.7,12.9 44.7,-12.7 -31.8,-135.6a57.5,57.5 0,0 0,44.9 -56z"
android:fillColor="#35393b"/>
<path
android:pathData="m454.9,131.1a60.6,60.6 0,0 0,-60.6 60.6h121.3a60.6,60.6 0,0 0,-60.6 -60.6z"
android:fillColor="#49b04a"/>
<path
android:pathData="m642.4,131.1a60.6,60.6 0,0 0,-60.6 60.6h121.3a60.6,60.6 0,0 0,-60.6 -60.6z"
android:fillColor="#49b04a"/>
<path
android:pathData="M483.2,229.4m-11.5,0a11.5,11.5 0,1 1,23 0a11.5,11.5 0,1 1,-23 0"
android:fillColor="#49b04a"/>
<path
android:pathData="M528.5,229.4m-11.5,0a11.5,11.5 0,1 1,23 0a11.5,11.5 0,1 1,-23 0"
android:fillColor="#49b04a"/>
<path
android:pathData="M573.8,229.4m-11.5,0a11.5,11.5 0,1 1,23 0a11.5,11.5 0,1 1,-23 0"
android:fillColor="#49b04a"/>
<path
android:pathData="M619.1,229.4m-11.5,0a11.5,11.5 0,1 1,23 0a11.5,11.5 0,1 1,-23 0"
android:fillColor="#49b04a"/>
</vector>

View File

@ -19,6 +19,13 @@
<item name="android:fontFamily">@font/open_sans</item> <item name="android:fontFamily">@font/open_sans</item>
</style> </style>
<style name="AppTheme.Starting" parent="Theme.SplashScreen.IconBackground">
<item name="windowSplashScreenBackground">@color/colorPrimary</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<item name="windowSplashScreenIconBackgroundColor">@color/material_grey_850</item>
<item name="postSplashScreenTheme">@style/AppTheme</item>
</style>
<style name="PreferenceTheme" parent="PreferenceThemeOverlay"> <style name="PreferenceTheme" parent="PreferenceThemeOverlay">
<item name="android:textColor">@color/textColorWhite</item> <item name="android:textColor">@color/textColorWhite</item>
<item name="android:textColorPrimary">@color/colorPrimary</item> <item name="android:textColorPrimary">@color/colorPrimary</item>
@ -33,10 +40,6 @@
<item name="colorAccent">@color/textColorWhite</item> <item name="colorAccent">@color/textColorWhite</item>
</style> </style>
<style name="SplashTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
</style>
<style name="AppTheme.Hint"> <style name="AppTheme.Hint">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>

View File

@ -8,6 +8,7 @@
<color name="textColorWhite">#F7F7F7</color> <color name="textColorWhite">#F7F7F7</color>
<color name="textColorLight">#9E9E9E</color> <color name="textColorLight">#9E9E9E</color>
<color name="textColorError">#E74C3C</color> <color name="textColorError">#E74C3C</color>
<color name="colorWhite">#FFFFFF</color>
<color name="colorBlackTransparent">#50000000</color> <color name="colorBlackTransparent">#50000000</color>
<color name="colorBlack">#000000</color> <color name="colorBlack">#000000</color>

View File

@ -19,6 +19,13 @@
<item name="android:fontFamily">@font/open_sans</item> <item name="android:fontFamily">@font/open_sans</item>
</style> </style>
<style name="AppTheme.Starting" parent="Theme.SplashScreen.IconBackground">
<item name="windowSplashScreenBackground">@color/colorPrimary</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<item name="windowSplashScreenIconBackgroundColor">@color/colorWhite</item>
<item name="postSplashScreenTheme">@style/AppTheme</item>
</style>
<style name="PreferenceTheme" parent="PreferenceThemeOverlay"> <style name="PreferenceTheme" parent="PreferenceThemeOverlay">
<item name="android:textColor">@color/textColorPrimary</item> <item name="android:textColor">@color/textColorPrimary</item>
<item name="android:textColorPrimary">@color/colorPrimary</item> <item name="android:textColorPrimary">@color/colorPrimary</item>
@ -33,10 +40,6 @@
<item name="colorAccent">@color/textColorWhite</item> <item name="colorAccent">@color/textColorWhite</item>
</style> </style>
<style name="SplashTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
</style>
<style name="AppTheme.Hint"> <style name="AppTheme.Hint">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>