mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Upping androidx.lifecycle to 2.4.0-rc01
This commit is contained in:
parent
e1cb580151
commit
e93e538600
2 changed files with 8 additions and 12 deletions
|
@ -117,9 +117,9 @@ dependencies {
|
||||||
|
|
||||||
implementation("com.google.firebase:firebase-core:19.0.1")
|
implementation("com.google.firebase:firebase-core:19.0.1")
|
||||||
|
|
||||||
val lifecycleVersion = "2.2.0"
|
val lifecycleVersion = "2.4.0-rc01"
|
||||||
implementation("androidx.lifecycle:lifecycle-extensions:$lifecycleVersion")
|
kapt("androidx.lifecycle:lifecycle-compiler:$lifecycleVersion")
|
||||||
implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion")
|
implementation("androidx.lifecycle:lifecycle-process:$lifecycleVersion")
|
||||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion")
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion")
|
||||||
|
|
||||||
// ReactiveX
|
// ReactiveX
|
||||||
|
|
|
@ -10,9 +10,8 @@ import android.content.IntentFilter
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.core.app.NotificationManagerCompat
|
import androidx.core.app.NotificationManagerCompat
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.DefaultLifecycleObserver
|
||||||
import androidx.lifecycle.LifecycleObserver
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import androidx.lifecycle.OnLifecycleEvent
|
|
||||||
import androidx.lifecycle.ProcessLifecycleOwner
|
import androidx.lifecycle.ProcessLifecycleOwner
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.multidex.MultiDex
|
import androidx.multidex.MultiDex
|
||||||
|
@ -43,7 +42,7 @@ import java.security.Security
|
||||||
// buildConfigClass = BuildConfig::class,
|
// buildConfigClass = BuildConfig::class,
|
||||||
// excludeMatchingSharedPreferencesKeys = [".*username.*", ".*password.*", ".*token.*"]
|
// excludeMatchingSharedPreferencesKeys = [".*username.*", ".*password.*", ".*token.*"]
|
||||||
// )
|
// )
|
||||||
open class App : Application(), LifecycleObserver {
|
open class App : Application(), DefaultLifecycleObserver {
|
||||||
|
|
||||||
val preferences: PreferencesHelper by injectLazy()
|
val preferences: PreferencesHelper by injectLazy()
|
||||||
|
|
||||||
|
@ -51,7 +50,7 @@ open class App : Application(), LifecycleObserver {
|
||||||
|
|
||||||
@SuppressLint("LaunchActivityFromNotification")
|
@SuppressLint("LaunchActivityFromNotification")
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super<Application>.onCreate()
|
||||||
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
|
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
|
||||||
|
|
||||||
// TLS 1.3 support for Android 10 and below
|
// TLS 1.3 support for Android 10 and below
|
||||||
|
@ -102,10 +101,7 @@ open class App : Application(), LifecycleObserver {
|
||||||
.launchIn(ProcessLifecycleOwner.get().lifecycleScope)
|
.launchIn(ProcessLifecycleOwner.get().lifecycleScope)
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
|
override fun onPause(owner: LifecycleOwner) {
|
||||||
@Suppress("unused")
|
|
||||||
fun onAppBackgrounded() {
|
|
||||||
// App in background
|
|
||||||
if (!SecureActivityDelegate.isAuthenticating && preferences.lockAfter().get() >= 0) {
|
if (!SecureActivityDelegate.isAuthenticating && preferences.lockAfter().get() >= 0) {
|
||||||
SecureActivityDelegate.locked = true
|
SecureActivityDelegate.locked = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue