From 8388a8a5fca622593c948d69ab2fd4b4d209b85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Borcz?= Date: Mon, 1 Mar 2021 22:57:47 +0100 Subject: [PATCH] Fix calling of binding outside lifecycle (#1169) --- .../github/wulkanowy/utils/LifecycleAwareVariable.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/github/wulkanowy/utils/LifecycleAwareVariable.kt b/app/src/main/java/io/github/wulkanowy/utils/LifecycleAwareVariable.kt index b96faeb2..d2a8908c 100644 --- a/app/src/main/java/io/github/wulkanowy/utils/LifecycleAwareVariable.kt +++ b/app/src/main/java/io/github/wulkanowy/utils/LifecycleAwareVariable.kt @@ -1,5 +1,7 @@ package io.github.wulkanowy.utils +import android.os.Handler +import android.os.Looper import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import androidx.lifecycle.Lifecycle @@ -28,7 +30,8 @@ class LifecycleAwareVariable : ReadWriteProperty, Lifecycl } } -class LifecycleAwareVariableActivity : ReadWriteProperty, LifecycleObserver { +class LifecycleAwareVariableActivity : ReadWriteProperty, + LifecycleObserver { private var _value: T? = null @@ -44,11 +47,12 @@ class LifecycleAwareVariableActivity : ReadWriteProperty Fragment.lifecycleAwareVariable() = LifecycleAwareVariable()