Merge "Add flags for new unlock and smartspace transition." into sc-dev am: bba0b75b8a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15054108 Change-Id: I53b86fc67f27b2d102ab7728f9fd302bd1041461
This commit is contained in:
@@ -36,6 +36,13 @@
|
|||||||
<!-- The new animations to/from lockscreen and AOD! -->
|
<!-- The new animations to/from lockscreen and AOD! -->
|
||||||
<bool name="flag_lockscreen_animations">false</bool>
|
<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_pm_lite">true</bool>
|
||||||
|
|
||||||
<bool name="flag_charging_ripple">false</bool>
|
<bool name="flag_charging_ripple">false</bool>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import com.android.keyguard.KeyguardViewController
|
|||||||
import com.android.systemui.animation.Interpolators
|
import com.android.systemui.animation.Interpolators
|
||||||
import com.android.systemui.dagger.SysUISingleton
|
import com.android.systemui.dagger.SysUISingleton
|
||||||
import com.android.systemui.shared.system.smartspace.SmartspaceTransitionController
|
import com.android.systemui.shared.system.smartspace.SmartspaceTransitionController
|
||||||
|
import com.android.systemui.statusbar.FeatureFlags
|
||||||
import com.android.systemui.statusbar.policy.KeyguardStateController
|
import com.android.systemui.statusbar.policy.KeyguardStateController
|
||||||
import dagger.Lazy
|
import dagger.Lazy
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -89,7 +90,8 @@ class KeyguardUnlockAnimationController @Inject constructor(
|
|||||||
private val keyguardStateController: KeyguardStateController,
|
private val keyguardStateController: KeyguardStateController,
|
||||||
private val keyguardViewMediator: Lazy<KeyguardViewMediator>,
|
private val keyguardViewMediator: Lazy<KeyguardViewMediator>,
|
||||||
private val keyguardViewController: KeyguardViewController,
|
private val keyguardViewController: KeyguardViewController,
|
||||||
private val smartspaceTransitionController: SmartspaceTransitionController
|
private val smartspaceTransitionController: SmartspaceTransitionController,
|
||||||
|
private val featureFlags: FeatureFlags
|
||||||
) : KeyguardStateController.Callback {
|
) : KeyguardStateController.Callback {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -346,6 +348,10 @@ class KeyguardUnlockAnimationController @Inject constructor(
|
|||||||
* keyguard visible.
|
* keyguard visible.
|
||||||
*/
|
*/
|
||||||
private fun updateKeyguardViewMediatorIfThresholdsReached() {
|
private fun updateKeyguardViewMediatorIfThresholdsReached() {
|
||||||
|
if (!featureFlags.isNewKeyguardSwipeAnimationEnabled) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val dismissAmount = keyguardStateController.dismissAmount
|
val dismissAmount = keyguardStateController.dismissAmount
|
||||||
|
|
||||||
// Hide the keyguard if we're fully dismissed, or if we're swiping to dismiss and have
|
// 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.
|
* know if it needs to do something as a result.
|
||||||
*/
|
*/
|
||||||
private fun updateSmartSpaceTransition() {
|
private fun updateSmartSpaceTransition() {
|
||||||
|
if (!featureFlags.isSmartSpaceSharedElementTransitionEnabled) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val dismissAmount = keyguardStateController.dismissAmount
|
val dismissAmount = keyguardStateController.dismissAmount
|
||||||
|
|
||||||
// If we've begun a swipe, and are capable of doing the SmartSpace transition, start it!
|
// If we've begun a swipe, and are capable of doing the SmartSpace transition, start it!
|
||||||
|
|||||||
@@ -84,4 +84,12 @@ public class FeatureFlags {
|
|||||||
public boolean isSmartspaceDedupingEnabled() {
|
public boolean isSmartspaceDedupingEnabled() {
|
||||||
return isSmartspaceEnabled() && mFlagReader.isEnabled(R.bool.flag_smartspace_deduping);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user