Merge "Add flags for new unlock and smartspace transition." into sc-dev

This commit is contained in:
Josh Tsuji
2021-06-28 15:28:24 +00:00
committed by Android (Google) Code Review
3 changed files with 26 additions and 1 deletions

View File

@@ -36,6 +36,13 @@
<!-- The new animations to/from lockscreen and AOD! -->
<bool name="flag_lockscreen_animations">false</bool>
<!-- The new swipe to unlock animation, which shows the app/launcher behind the keyguard during
the swipe. -->
<bool name="flag_new_unlock_swipe_animation">true</bool>
<!-- The shared-element transition between lockscreen smartspace and launcher smartspace. -->
<bool name="flag_smartspace_shared_element_transition">false</bool>
<bool name="flag_pm_lite">true</bool>
<bool name="flag_charging_ripple">false</bool>

View File

@@ -31,6 +31,7 @@ import com.android.keyguard.KeyguardViewController
import com.android.systemui.animation.Interpolators
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.shared.system.smartspace.SmartspaceTransitionController
import com.android.systemui.statusbar.FeatureFlags
import com.android.systemui.statusbar.policy.KeyguardStateController
import dagger.Lazy
import javax.inject.Inject
@@ -89,7 +90,8 @@ class KeyguardUnlockAnimationController @Inject constructor(
private val keyguardStateController: KeyguardStateController,
private val keyguardViewMediator: Lazy<KeyguardViewMediator>,
private val keyguardViewController: KeyguardViewController,
private val smartspaceTransitionController: SmartspaceTransitionController
private val smartspaceTransitionController: SmartspaceTransitionController,
private val featureFlags: FeatureFlags
) : KeyguardStateController.Callback {
/**
@@ -346,6 +348,10 @@ class KeyguardUnlockAnimationController @Inject constructor(
* keyguard visible.
*/
private fun updateKeyguardViewMediatorIfThresholdsReached() {
if (!featureFlags.isNewKeyguardSwipeAnimationEnabled) {
return
}
val dismissAmount = keyguardStateController.dismissAmount
// Hide the keyguard if we're fully dismissed, or if we're swiping to dismiss and have
@@ -382,6 +388,10 @@ class KeyguardUnlockAnimationController @Inject constructor(
* know if it needs to do something as a result.
*/
private fun updateSmartSpaceTransition() {
if (!featureFlags.isSmartSpaceSharedElementTransitionEnabled) {
return
}
val dismissAmount = keyguardStateController.dismissAmount
// If we've begun a swipe, and are capable of doing the SmartSpace transition, start it!

View File

@@ -84,4 +84,12 @@ public class FeatureFlags {
public boolean isSmartspaceDedupingEnabled() {
return isSmartspaceEnabled() && mFlagReader.isEnabled(R.bool.flag_smartspace_deduping);
}
public boolean isNewKeyguardSwipeAnimationEnabled() {
return mFlagReader.isEnabled(R.bool.flag_new_unlock_swipe_animation);
}
public boolean isSmartSpaceSharedElementTransitionEnabled() {
return mFlagReader.isEnabled(R.bool.flag_smartspace_shared_element_transition);
}
}