Loading packages/SystemUI/src/com/android/systemui/util/animation/TransitionLayout.kt +14 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ class TransitionLayout @JvmOverloads constructor( private var measureAsConstraint: Boolean = false private var currentState: TransitionViewState = TransitionViewState() private var updateScheduled = false private var isPreDrawApplicatorRegistered = false private var desiredMeasureWidth = 0 private var desiredMeasureHeight = 0 Loading Loading @@ -74,6 +75,7 @@ class TransitionLayout @JvmOverloads constructor( override fun onPreDraw(): Boolean { updateScheduled = false viewTreeObserver.removeOnPreDrawListener(this) isPreDrawApplicatorRegistered = false applyCurrentState() return true } Loading @@ -94,6 +96,14 @@ class TransitionLayout @JvmOverloads constructor( } } override fun onDetachedFromWindow() { super.onDetachedFromWindow() if (isPreDrawApplicatorRegistered) { viewTreeObserver.removeOnPreDrawListener(preDrawApplicator) isPreDrawApplicatorRegistered = false } } /** * Apply the current state to the view and its widgets */ Loading Loading @@ -158,7 +168,10 @@ class TransitionLayout @JvmOverloads constructor( private fun applyCurrentStateOnPredraw() { if (!updateScheduled) { updateScheduled = true if (!isPreDrawApplicatorRegistered) { viewTreeObserver.addOnPreDrawListener(preDrawApplicator) isPreDrawApplicatorRegistered = true } } } Loading Loading
packages/SystemUI/src/com/android/systemui/util/animation/TransitionLayout.kt +14 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ class TransitionLayout @JvmOverloads constructor( private var measureAsConstraint: Boolean = false private var currentState: TransitionViewState = TransitionViewState() private var updateScheduled = false private var isPreDrawApplicatorRegistered = false private var desiredMeasureWidth = 0 private var desiredMeasureHeight = 0 Loading Loading @@ -74,6 +75,7 @@ class TransitionLayout @JvmOverloads constructor( override fun onPreDraw(): Boolean { updateScheduled = false viewTreeObserver.removeOnPreDrawListener(this) isPreDrawApplicatorRegistered = false applyCurrentState() return true } Loading @@ -94,6 +96,14 @@ class TransitionLayout @JvmOverloads constructor( } } override fun onDetachedFromWindow() { super.onDetachedFromWindow() if (isPreDrawApplicatorRegistered) { viewTreeObserver.removeOnPreDrawListener(preDrawApplicator) isPreDrawApplicatorRegistered = false } } /** * Apply the current state to the view and its widgets */ Loading Loading @@ -158,7 +168,10 @@ class TransitionLayout @JvmOverloads constructor( private fun applyCurrentStateOnPredraw() { if (!updateScheduled) { updateScheduled = true if (!isPreDrawApplicatorRegistered) { viewTreeObserver.addOnPreDrawListener(preDrawApplicator) isPreDrawApplicatorRegistered = true } } } Loading