[dev_arch_opt_3.0] 优化TextView频繁调用setText导致的频繁绘制问题; 优化状态栏上工控机相关状态的处理逻辑
This commit is contained in:
@@ -39,16 +39,18 @@ val <T: View> T.lifecycleOwner: LifecycleOwner
|
||||
init {
|
||||
if (ViewCompat.isAttachedToWindow(this@lifecycleOwner)) {
|
||||
lifecycle.let {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.INITIALIZED)) {
|
||||
it.currentState = Lifecycle.State.CREATED
|
||||
}
|
||||
post {
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.INITIALIZED)) {
|
||||
it.currentState = Lifecycle.State.CREATED
|
||||
}
|
||||
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.CREATED)) {
|
||||
it.currentState = Lifecycle.State.STARTED
|
||||
}
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.CREATED)) {
|
||||
it.currentState = Lifecycle.State.STARTED
|
||||
}
|
||||
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.STARTED)) {
|
||||
it.currentState = Lifecycle.State.RESUMED
|
||||
if (it.currentState.isAtLeast(Lifecycle.State.STARTED)) {
|
||||
it.currentState = Lifecycle.State.RESUMED
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user