[6.4.4][状态栏] 修正状态栏状态展示异常
This commit is contained in:
@@ -60,9 +60,9 @@ internal class StatusView(private val model: StatusModel, ctx: Context): Constra
|
||||
}
|
||||
}
|
||||
|
||||
onDetach {
|
||||
observer?.also { model.status.removeObserver(it) }
|
||||
}
|
||||
// onDetach {
|
||||
// observer?.also { model.status.removeObserver(it) }
|
||||
// }
|
||||
}
|
||||
|
||||
override fun onVisibilityChanged(changedView: View, visibility: Int) {
|
||||
|
||||
@@ -75,9 +75,10 @@ val <T: View> T.lifecycleOwner: LifecycleOwner
|
||||
|
||||
override fun onViewDetachedFromWindow(v: View) {
|
||||
lifecycle.let {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
||||
if (ViewCompat.isAttachedToWindow(v) && it.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
||||
this@lifecycleOwner.removeOnAttachStateChangeListener(this)
|
||||
it.currentState = Lifecycle.State.DESTROYED
|
||||
setTag(R.id.view_lifecycle_owner, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user