Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt +38 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import android.view.HapticFeedbackConstants import android.view.InputDevice import android.view.MotionEvent import android.view.View import android.view.View.GONE import android.view.View.INVISIBLE import android.view.View.OnLayoutChangeListener import android.view.View.VISIBLE import android.view.ViewGroup Loading Loading @@ -304,8 +306,9 @@ object KeyguardRootViewBinder { if (isVisible.value) { blueprintViewModel.refreshBlueprint() } childViews[aodPromotedNotificationId] ?.setAodNotifIconContainerIsVisible(isVisible) childViews[aodPromotedNotificationId]?.setAodPromotedNotifIsVisible( isVisible ) } } Loading @@ -313,7 +316,7 @@ object KeyguardRootViewBinder { shadeInteractor.isAnyFullyExpanded.collect { isFullyAnyExpanded -> view.visibility = if (isFullyAnyExpanded) { View.INVISIBLE INVISIBLE } else { View.VISIBLE } Loading Loading @@ -524,10 +527,10 @@ object KeyguardRootViewBinder { visibility = if (isVisible.value) { alpha = 1f View.VISIBLE VISIBLE } else { alpha = 0f View.INVISIBLE INVISIBLE } } Loading @@ -541,6 +544,36 @@ object KeyguardRootViewBinder { } } private fun View.setAodPromotedNotifIsVisible(isVisible: AnimatedValue<Boolean>) { animate().cancel() val animatorListener = object : AnimatorListenerAdapter() { override fun onAnimationEnd(animation: Animator) { isVisible.stopAnimating() } } if (isVisible.isAnimating) { if (isVisible.value) { alpha = 0f visibility = VISIBLE CrossFadeHelper.fadeIn(this, animatorListener) } else { CrossFadeHelper.fadeOut(this, animatorListener) } } else { if (isVisible.value) { alpha = 1f visibility = VISIBLE } else { // Hide with GONE, not INVISIBLE, so there won't be a redundant bottom // margin between the smart space and the shelf. alpha = 0f visibility = GONE } } } private fun MotionEvent.isTouchscreenSource(): Boolean { return device?.supportsSource(InputDevice.SOURCE_TOUCHSCREEN) == true } Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardRootViewBinder.kt +38 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import android.view.HapticFeedbackConstants import android.view.InputDevice import android.view.MotionEvent import android.view.View import android.view.View.GONE import android.view.View.INVISIBLE import android.view.View.OnLayoutChangeListener import android.view.View.VISIBLE import android.view.ViewGroup Loading Loading @@ -304,8 +306,9 @@ object KeyguardRootViewBinder { if (isVisible.value) { blueprintViewModel.refreshBlueprint() } childViews[aodPromotedNotificationId] ?.setAodNotifIconContainerIsVisible(isVisible) childViews[aodPromotedNotificationId]?.setAodPromotedNotifIsVisible( isVisible ) } } Loading @@ -313,7 +316,7 @@ object KeyguardRootViewBinder { shadeInteractor.isAnyFullyExpanded.collect { isFullyAnyExpanded -> view.visibility = if (isFullyAnyExpanded) { View.INVISIBLE INVISIBLE } else { View.VISIBLE } Loading Loading @@ -524,10 +527,10 @@ object KeyguardRootViewBinder { visibility = if (isVisible.value) { alpha = 1f View.VISIBLE VISIBLE } else { alpha = 0f View.INVISIBLE INVISIBLE } } Loading @@ -541,6 +544,36 @@ object KeyguardRootViewBinder { } } private fun View.setAodPromotedNotifIsVisible(isVisible: AnimatedValue<Boolean>) { animate().cancel() val animatorListener = object : AnimatorListenerAdapter() { override fun onAnimationEnd(animation: Animator) { isVisible.stopAnimating() } } if (isVisible.isAnimating) { if (isVisible.value) { alpha = 0f visibility = VISIBLE CrossFadeHelper.fadeIn(this, animatorListener) } else { CrossFadeHelper.fadeOut(this, animatorListener) } } else { if (isVisible.value) { alpha = 1f visibility = VISIBLE } else { // Hide with GONE, not INVISIBLE, so there won't be a redundant bottom // margin between the smart space and the shelf. alpha = 0f visibility = GONE } } } private fun MotionEvent.isTouchscreenSource(): Boolean { return device?.supportsSource(InputDevice.SOURCE_TOUCHSCREEN) == true } Loading