Moving smartspace to the right on the lockscreen for split shade
There is a new view managed by ConstraintLayout guidelines that serves as container for smartspace and is placed on the right. It's visible only in split shade and then it contains Smartspace. Smartspace view is switching between the default (current) view container and the new split shade container. Switching Smartspace view and visibility of its containers is managed by LockscreenSmartspaceController. Bug: 193654214 Test: KeyguardClockSwitchControllerTest, LockscreenSmartspaceControllerTest, KeyguardClockPositionAlgorithmTest Change-Id: I1afcdf7f3c750c36b995f1d6fd9d4393eee8cbef
This commit is contained in:
@@ -68,6 +68,16 @@
|
||||
lockScreenWeight="400"
|
||||
/>
|
||||
</FrameLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/keyguard_smartspace_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/below_clock_padding_start"
|
||||
android:paddingEnd="@dimen/below_clock_padding_end"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@id/lockscreen_clock_view"
|
||||
/>
|
||||
<!-- either keyguard_status_area or keyguard_smartspace_container is visible -->
|
||||
<include layout="@layout/keyguard_status_area"
|
||||
android:id="@+id/keyguard_status_area"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -92,6 +92,18 @@
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/split_shade_smartspace_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/notification_side_paddings"
|
||||
android:paddingEnd="@dimen/notification_side_paddings"
|
||||
systemui:layout_constraintStart_toStartOf="@id/qs_edge_guideline"
|
||||
systemui:layout_constraintEnd_toEndOf="parent"
|
||||
systemui:layout_constraintTop_toTopOf="parent"
|
||||
android:visibility="gone">
|
||||
</FrameLayout>
|
||||
|
||||
<include layout="@layout/dock_info_overlay"/>
|
||||
|
||||
<FrameLayout
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
package com.android.keyguard;
|
||||
|
||||
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
import static com.android.keyguard.KeyguardClockSwitch.LARGE;
|
||||
|
||||
import android.app.WallpaperManager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
@@ -93,8 +93,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
||||
|
||||
private final ClockManager.ClockChangedListener mClockChangedListener = this::setClockPlugin;
|
||||
|
||||
// If set, will replace keyguard_status_area
|
||||
private View mSmartspaceView;
|
||||
private ViewGroup mSmartspaceContainer;
|
||||
|
||||
private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
|
||||
private SmartspaceTransitionController mSmartspaceTransitionController;
|
||||
@@ -139,6 +138,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
||||
|
||||
mClockFrame = mView.findViewById(R.id.lockscreen_clock_view);
|
||||
mLargeClockFrame = mView.findViewById(R.id.lockscreen_clock_view_large);
|
||||
mSmartspaceContainer = mView.findViewById(R.id.keyguard_smartspace_container);
|
||||
mSmartspaceController.setKeyguardStatusContainer(mSmartspaceContainer);
|
||||
|
||||
mClockViewController =
|
||||
new AnimatableClockController(
|
||||
@@ -170,35 +171,25 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
||||
mView.updateColors(getGradientColors());
|
||||
updateAodIcons();
|
||||
|
||||
if (mSmartspaceController.isEnabled()) {
|
||||
mSmartspaceView = mSmartspaceController.buildAndConnectView(mView);
|
||||
if (mSmartspaceController.isSmartspaceEnabled()) {
|
||||
// "Enabled" doesn't mean smartspace is displayed here - inside mSmartspaceContainer -
|
||||
// it might be a part of another view when in split shade. But it means that it CAN be
|
||||
// displayed here, so we want to hide keyguard_status_area and set views relations
|
||||
// accordingly.
|
||||
|
||||
View ksa = mView.findViewById(R.id.keyguard_status_area);
|
||||
int ksaIndex = mView.indexOfChild(ksa);
|
||||
// we show either keyguard_status_area or smartspace, so when smartspace can be visible,
|
||||
// keyguard_status_area should be hidden
|
||||
ksa.setVisibility(View.GONE);
|
||||
|
||||
// Place smartspace view below normal clock...
|
||||
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
|
||||
MATCH_PARENT, WRAP_CONTENT);
|
||||
lp.addRule(RelativeLayout.BELOW, R.id.lockscreen_clock_view);
|
||||
|
||||
mView.addView(mSmartspaceView, ksaIndex, lp);
|
||||
int startPadding = getContext().getResources()
|
||||
.getDimensionPixelSize(R.dimen.below_clock_padding_start);
|
||||
int endPadding = getContext().getResources()
|
||||
.getDimensionPixelSize(R.dimen.below_clock_padding_end);
|
||||
mSmartspaceView.setPaddingRelative(startPadding, 0, endPadding, 0);
|
||||
|
||||
updateClockLayout();
|
||||
|
||||
View nic = mView.findViewById(
|
||||
R.id.left_aligned_notification_icon_container);
|
||||
lp = (RelativeLayout.LayoutParams) nic.getLayoutParams();
|
||||
lp.addRule(RelativeLayout.BELOW, mSmartspaceView.getId());
|
||||
View nic = mView.findViewById(R.id.left_aligned_notification_icon_container);
|
||||
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) nic.getLayoutParams();
|
||||
lp.addRule(RelativeLayout.BELOW, mSmartspaceContainer.getId());
|
||||
nic.setLayoutParams(lp);
|
||||
|
||||
mView.setSmartspaceView(mSmartspaceView);
|
||||
mSmartspaceTransitionController.setLockscreenSmartspace(mSmartspaceView);
|
||||
mView.setSmartspaceView(mSmartspaceContainer);
|
||||
mSmartspaceTransitionController.setLockscreenSmartspace(mSmartspaceContainer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,10 +212,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
||||
// instance of this class. In order to fix this, we need to modify the plugin so that
|
||||
// (a) we get a new view each time and (b) we can properly clean up an old view by making
|
||||
// it unregister itself as a plugin listener.
|
||||
if (mSmartspaceView != null) {
|
||||
mView.removeView(mSmartspaceView);
|
||||
mSmartspaceView = null;
|
||||
}
|
||||
mSmartspaceContainer.removeAllViews();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,7 +225,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
||||
}
|
||||
|
||||
private void updateClockLayout() {
|
||||
if (mSmartspaceController.isEnabled()) {
|
||||
if (mSmartspaceController.isSmartspaceEnabled()) {
|
||||
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT,
|
||||
MATCH_PARENT);
|
||||
lp.topMargin = getContext().getResources().getDimensionPixelSize(
|
||||
@@ -302,8 +290,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
||||
PropertyAnimator.setProperty(mLargeClockFrame, AnimatableProperty.SCALE_Y,
|
||||
scale, props, animate);
|
||||
|
||||
if (mSmartspaceView != null) {
|
||||
PropertyAnimator.setProperty(mSmartspaceView, AnimatableProperty.TRANSLATION_X,
|
||||
if (mSmartspaceContainer != null) {
|
||||
PropertyAnimator.setProperty(mSmartspaceContainer, AnimatableProperty.TRANSLATION_X,
|
||||
x, props, animate);
|
||||
|
||||
// If we're unlocking with the SmartSpace shared element transition, let the controller
|
||||
@@ -321,8 +309,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
||||
public void setChildrenAlphaExcludingSmartspace(float alpha) {
|
||||
final Set<View> excludedViews = new HashSet<>();
|
||||
|
||||
if (mSmartspaceView != null) {
|
||||
excludedViews.add(mSmartspaceView);
|
||||
if (mSmartspaceContainer != null) {
|
||||
excludedViews.add(mSmartspaceContainer);
|
||||
}
|
||||
|
||||
setChildrenAlphaExcluding(alpha, excludedViews);
|
||||
|
||||
@@ -31,6 +31,8 @@ import android.os.Handler
|
||||
import android.os.UserHandle
|
||||
import android.provider.Settings
|
||||
import android.view.View
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.ViewGroup
|
||||
import com.android.settingslib.Utils
|
||||
import com.android.systemui.R
|
||||
@@ -44,14 +46,21 @@ import com.android.systemui.plugins.FalsingManager
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController
|
||||
import com.android.systemui.settings.UserTracker
|
||||
import com.android.systemui.flags.FeatureFlags
|
||||
import com.android.systemui.statusbar.StatusBarState
|
||||
import com.android.systemui.statusbar.notification.AnimatableProperty
|
||||
import com.android.systemui.statusbar.notification.PropertyAnimator
|
||||
import com.android.systemui.statusbar.notification.stack.AnimationProperties
|
||||
import com.android.systemui.statusbar.notification.stack.StackStateAnimator
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController
|
||||
import com.android.systemui.util.concurrency.Execution
|
||||
import com.android.systemui.util.settings.SecureSettings
|
||||
import java.lang.RuntimeException
|
||||
import java.util.Optional
|
||||
import java.util.concurrent.Executor
|
||||
import javax.inject.Inject
|
||||
|
||||
private val ANIMATION_PROPERTIES = AnimationProperties()
|
||||
.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD.toLong())
|
||||
|
||||
/**
|
||||
* Controller for managing the smartspace view on the lockscreen
|
||||
*/
|
||||
@@ -72,10 +81,15 @@ class LockscreenSmartspaceController @Inject constructor(
|
||||
@Main private val handler: Handler,
|
||||
optionalPlugin: Optional<BcSmartspaceDataPlugin>
|
||||
) {
|
||||
|
||||
var splitShadeContainer: ViewGroup? = null
|
||||
private var singlePaneContainer: ViewGroup? = null
|
||||
|
||||
private var session: SmartspaceSession? = null
|
||||
private val plugin: BcSmartspaceDataPlugin? = optionalPlugin.orElse(null)
|
||||
private lateinit var smartspaceView: SmartspaceView
|
||||
|
||||
// smartspace casted to View
|
||||
lateinit var view: View
|
||||
private set
|
||||
|
||||
@@ -83,12 +97,60 @@ class LockscreenSmartspaceController @Inject constructor(
|
||||
private var showSensitiveContentForManagedUser = false
|
||||
private var managedUserHandle: UserHandle? = null
|
||||
|
||||
fun isEnabled(): Boolean {
|
||||
private var isAod = false
|
||||
private var isSplitShade = false
|
||||
|
||||
fun isSmartspaceEnabled(): Boolean {
|
||||
execution.assertIsMainThread()
|
||||
|
||||
return featureFlags.isSmartspaceEnabled && plugin != null
|
||||
}
|
||||
|
||||
fun setKeyguardStatusContainer(container: ViewGroup) {
|
||||
singlePaneContainer = container
|
||||
// reattach smartspace if necessary as this might be a new container
|
||||
updateSmartSpaceContainer()
|
||||
}
|
||||
|
||||
fun onSplitShadeChanged(splitShade: Boolean) {
|
||||
isSplitShade = splitShade
|
||||
updateSmartSpaceContainer()
|
||||
}
|
||||
|
||||
private fun updateSmartSpaceContainer() {
|
||||
if (!isSmartspaceEnabled()) return
|
||||
// in AOD we always want to show smartspace on the left i.e. in singlePaneContainer
|
||||
if (isSplitShade && !isAod) {
|
||||
switchContainerVisibility(
|
||||
newParent = splitShadeContainer,
|
||||
oldParent = singlePaneContainer)
|
||||
} else {
|
||||
switchContainerVisibility(
|
||||
newParent = singlePaneContainer,
|
||||
oldParent = splitShadeContainer)
|
||||
}
|
||||
requestSmartspaceUpdate()
|
||||
}
|
||||
|
||||
private fun switchContainerVisibility(newParent: ViewGroup?, oldParent: ViewGroup?) {
|
||||
// it might be the case that smartspace was already attached and we just needed to update
|
||||
// visibility, e.g. going from lockscreen -> unlocked -> lockscreen
|
||||
if (newParent?.childCount == 0) {
|
||||
oldParent?.removeAllViews()
|
||||
newParent.addView(buildAndConnectView(newParent))
|
||||
}
|
||||
oldParent?.visibility = GONE
|
||||
newParent?.visibility = VISIBLE
|
||||
}
|
||||
|
||||
fun setSplitShadeSmartspaceAlpha(alpha: Float) {
|
||||
// the other container's alpha is modified as a part of keyguard status view, so we don't
|
||||
// have to do that here
|
||||
if (splitShadeContainer?.visibility == VISIBLE) {
|
||||
splitShadeContainer?.alpha = alpha
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the smartspace view and connects it to the smartspace service. Subsequent calls
|
||||
* are idempotent until [disconnect] is called.
|
||||
@@ -96,7 +158,7 @@ class LockscreenSmartspaceController @Inject constructor(
|
||||
fun buildAndConnectView(parent: ViewGroup): View {
|
||||
execution.assertIsMainThread()
|
||||
|
||||
if (!isEnabled()) {
|
||||
if (!isSmartspaceEnabled()) {
|
||||
throw RuntimeException("Cannot build view when not enabled")
|
||||
}
|
||||
|
||||
@@ -182,7 +244,6 @@ class LockscreenSmartspaceController @Inject constructor(
|
||||
userTracker.removeCallback(userTrackerCallback)
|
||||
contentResolver.unregisterContentObserver(settingsObserver)
|
||||
configurationController.removeCallback(configChangeListener)
|
||||
statusBarStateController.removeCallback(statusBarStateListener)
|
||||
session = null
|
||||
|
||||
plugin?.onTargetsAvailable(emptyList())
|
||||
@@ -198,6 +259,13 @@ class LockscreenSmartspaceController @Inject constructor(
|
||||
plugin?.unregisterListener(listener)
|
||||
}
|
||||
|
||||
fun shiftSplitShadeSmartspace(y: Int, animate: Boolean) {
|
||||
if (splitShadeContainer?.visibility == VISIBLE) {
|
||||
PropertyAnimator.setProperty(splitShadeContainer, AnimatableProperty.Y, y.toFloat(),
|
||||
ANIMATION_PROPERTIES, animate)
|
||||
}
|
||||
}
|
||||
|
||||
private val sessionListener = SmartspaceSession.OnTargetsAvailableListener { targets ->
|
||||
execution.assertIsMainThread()
|
||||
val filteredTargets = targets.filter(::filterSmartspaceTarget)
|
||||
@@ -233,6 +301,23 @@ class LockscreenSmartspaceController @Inject constructor(
|
||||
execution.assertIsMainThread()
|
||||
smartspaceView.setDozeAmount(eased)
|
||||
}
|
||||
|
||||
override fun onDozingChanged(isDozing: Boolean) {
|
||||
isAod = isDozing
|
||||
updateSmartSpaceContainer()
|
||||
}
|
||||
|
||||
override fun onStateChanged(newState: Int) {
|
||||
if (newState == StatusBarState.KEYGUARD) {
|
||||
if (isSmartspaceEnabled()) {
|
||||
updateSmartSpaceContainer()
|
||||
}
|
||||
} else {
|
||||
splitShadeContainer?.visibility = GONE
|
||||
singlePaneContainer?.visibility = GONE
|
||||
disconnect()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun filterSmartspaceTarget(t: SmartspaceTarget): Boolean {
|
||||
|
||||
@@ -32,23 +32,11 @@ import com.android.systemui.statusbar.policy.KeyguardUserSwitcherListView;
|
||||
* Utility class to calculate the clock position and top padding of notifications on Keyguard.
|
||||
*/
|
||||
public class KeyguardClockPositionAlgorithm {
|
||||
/**
|
||||
* How much the clock height influences the shade position.
|
||||
* 0 means nothing, 1 means move the shade up by the height of the clock
|
||||
* 0.5f means move the shade up by half of the size of the clock.
|
||||
*/
|
||||
private static float CLOCK_HEIGHT_WEIGHT = 0.7f;
|
||||
|
||||
/**
|
||||
* Margin between the bottom of the status view and the notification shade.
|
||||
*/
|
||||
private int mStatusViewBottomMargin;
|
||||
|
||||
/**
|
||||
* Height of the parent view - display size in px.
|
||||
*/
|
||||
private int mHeight;
|
||||
|
||||
/**
|
||||
* Height of {@link KeyguardStatusView}.
|
||||
*/
|
||||
@@ -67,21 +55,6 @@ public class KeyguardClockPositionAlgorithm {
|
||||
*/
|
||||
private int mUserSwitchPreferredY;
|
||||
|
||||
/**
|
||||
* Whether or not there is a custom clock face on keyguard.
|
||||
*/
|
||||
private boolean mHasCustomClock;
|
||||
|
||||
/**
|
||||
* Whether or not the NSSL contains any visible notifications.
|
||||
*/
|
||||
private boolean mHasVisibleNotifs;
|
||||
|
||||
/**
|
||||
* Height of notification stack: Sum of height of each notification.
|
||||
*/
|
||||
private int mNotificationStackHeight;
|
||||
|
||||
/**
|
||||
* Minimum top margin to avoid overlap with status bar, lock icon, or multi-user switcher
|
||||
* avatar.
|
||||
@@ -148,6 +121,7 @@ public class KeyguardClockPositionAlgorithm {
|
||||
private int mUnlockedStackScrollerPadding;
|
||||
|
||||
private boolean mIsSplitShade;
|
||||
private int mSplitShadeSmartspaceHeight;
|
||||
|
||||
/**
|
||||
* Refreshes the dimension values.
|
||||
@@ -170,28 +144,25 @@ public class KeyguardClockPositionAlgorithm {
|
||||
* Sets up algorithm values.
|
||||
*/
|
||||
public void setup(int keyguardStatusBarHeaderHeight, int maxShadeBottom,
|
||||
int notificationStackHeight, float panelExpansion, int parentHeight,
|
||||
int keyguardStatusHeight, int userSwitchHeight, int userSwitchPreferredY,
|
||||
boolean hasCustomClock, boolean hasVisibleNotifs, float dark,
|
||||
float panelExpansion,
|
||||
int keyguardStatusHeight, int userSwitchHeight, int userSwitchPreferredY, float dark,
|
||||
float overStrechAmount, boolean bypassEnabled, int unlockedStackScrollerPadding,
|
||||
float qsExpansion, int cutoutTopInset, boolean isSplitShade) {
|
||||
float qsExpansion, int cutoutTopInset, int splitShadeSmartspaceHeight,
|
||||
boolean isSplitShade) {
|
||||
mMinTopMargin = keyguardStatusBarHeaderHeight + Math.max(mContainerTopPadding,
|
||||
userSwitchHeight);
|
||||
mMaxShadeBottom = maxShadeBottom;
|
||||
mNotificationStackHeight = notificationStackHeight;
|
||||
mPanelExpansion = panelExpansion;
|
||||
mHeight = parentHeight;
|
||||
mKeyguardStatusHeight = keyguardStatusHeight + mStatusViewBottomMargin;
|
||||
mUserSwitchHeight = userSwitchHeight;
|
||||
mUserSwitchPreferredY = userSwitchPreferredY;
|
||||
mHasCustomClock = hasCustomClock;
|
||||
mHasVisibleNotifs = hasVisibleNotifs;
|
||||
mDarkAmount = dark;
|
||||
mOverStretchAmount = overStrechAmount;
|
||||
mBypassEnabled = bypassEnabled;
|
||||
mUnlockedStackScrollerPadding = unlockedStackScrollerPadding;
|
||||
mQsExpansion = qsExpansion;
|
||||
mCutoutTopInset = cutoutTopInset;
|
||||
mSplitShadeSmartspaceHeight = splitShadeSmartspaceHeight;
|
||||
mIsSplitShade = isSplitShade;
|
||||
}
|
||||
|
||||
@@ -213,7 +184,7 @@ public class KeyguardClockPositionAlgorithm {
|
||||
if (mBypassEnabled) {
|
||||
return (int) (mUnlockedStackScrollerPadding + mOverStretchAmount);
|
||||
} else if (mIsSplitShade) {
|
||||
return clockYPosition;
|
||||
return clockYPosition + mSplitShadeSmartspaceHeight;
|
||||
} else {
|
||||
return clockYPosition + mKeyguardStatusHeight;
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||
import com.android.systemui.statusbar.VibratorHelper;
|
||||
import com.android.systemui.statusbar.events.PrivacyDotViewController;
|
||||
import com.android.systemui.statusbar.lockscreen.LockscreenSmartspaceController;
|
||||
import com.android.systemui.statusbar.notification.AnimatableProperty;
|
||||
import com.android.systemui.statusbar.notification.ConversationNotificationManager;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
@@ -239,6 +240,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
private final HeightListener mHeightListener = new HeightListener();
|
||||
private final ConfigurationListener mConfigurationListener = new ConfigurationListener();
|
||||
private final SettingsChangeObserver mSettingsChangeObserver;
|
||||
private final LockscreenSmartspaceController mLockscreenSmartspaceController;
|
||||
|
||||
@VisibleForTesting final StatusBarStateListener mStatusBarStateListener =
|
||||
new StatusBarStateListener();
|
||||
@@ -372,6 +374,8 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
private IdleHostViewController mIdleHostViewController;
|
||||
private LockIconViewController mLockIconViewController;
|
||||
private NotificationsQuickSettingsContainer mNotificationContainerParent;
|
||||
private FrameLayout mSplitShadeSmartspaceContainer;
|
||||
|
||||
private boolean mAnimateNextPositionUpdate;
|
||||
private float mQuickQsOffsetHeight;
|
||||
private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
|
||||
@@ -776,6 +780,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
@Main Executor uiExecutor,
|
||||
SecureSettings secureSettings,
|
||||
SplitShadeHeaderController splitShadeHeaderController,
|
||||
LockscreenSmartspaceController lockscreenSmartspaceController,
|
||||
UnlockedScreenOffAnimationController unlockedScreenOffAnimationController,
|
||||
NotificationRemoteInputManager remoteInputManager,
|
||||
ControlsComponent controlsComponent) {
|
||||
@@ -809,6 +814,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mQSDetailDisplayer = qsDetailDisplayer;
|
||||
mFragmentService = fragmentService;
|
||||
mSettingsChangeObserver = new SettingsChangeObserver(handler);
|
||||
mLockscreenSmartspaceController = lockscreenSmartspaceController;
|
||||
mShouldUseSplitNotificationShade =
|
||||
Utils.shouldUseSplitNotificationShade(mResources);
|
||||
mView.setWillNotDraw(!DEBUG);
|
||||
@@ -905,6 +911,9 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mKeyguardStatusBar = mView.findViewById(R.id.keyguard_header);
|
||||
mBigClockContainer = mView.findViewById(R.id.big_clock_container);
|
||||
mCommunalView = mView.findViewById(R.id.communal_host);
|
||||
mSplitShadeSmartspaceContainer = mView.findViewById(R.id.split_shade_smartspace_container);
|
||||
mLockscreenSmartspaceController.setSplitShadeContainer(mSplitShadeSmartspaceContainer);
|
||||
mLockscreenSmartspaceController.onSplitShadeChanged(mShouldUseSplitNotificationShade);
|
||||
|
||||
UserAvatarView userAvatarView = null;
|
||||
KeyguardUserSwitcherView keyguardUserSwitcherView = null;
|
||||
@@ -1134,7 +1143,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mNotificationContainerParent.setSplitShadeEnabled(mShouldUseSplitNotificationShade);
|
||||
|
||||
updateKeyguardStatusViewAlignment(false /* animate */);
|
||||
|
||||
mLockscreenSmartspaceController.onSplitShadeChanged(mShouldUseSplitNotificationShade);
|
||||
mKeyguardMediaController.refreshMediaPosition();
|
||||
}
|
||||
|
||||
@@ -1398,16 +1407,15 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
? 1.0f : mInterpolatedDarkAmount;
|
||||
mClockPositionAlgorithm.setup(mStatusBarHeaderHeightKeyguard,
|
||||
totalHeight - bottomPadding,
|
||||
mNotificationStackScrollLayoutController.getIntrinsicContentHeight(),
|
||||
expandedFraction,
|
||||
totalHeight,
|
||||
mKeyguardStatusViewController.getLockscreenHeight(),
|
||||
userIconHeight,
|
||||
userSwitcherPreferredY, hasCustomClock(),
|
||||
hasVisibleNotifications, darkamount, mOverStretchAmount,
|
||||
userSwitcherPreferredY,
|
||||
darkamount, mOverStretchAmount,
|
||||
bypassEnabled, getUnlockedStackScrollerPadding(),
|
||||
computeQsExpansionFraction(),
|
||||
mDisplayTopInset,
|
||||
mSplitShadeSmartspaceContainer.getHeight(),
|
||||
mShouldUseSplitNotificationShade);
|
||||
mClockPositionAlgorithm.run(mClockPositionResult);
|
||||
boolean animate = mNotificationStackScrollLayoutController.isAddOrRemoveAnimationPending();
|
||||
@@ -1427,6 +1435,9 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mClockPositionResult.userSwitchY,
|
||||
animateClock);
|
||||
}
|
||||
// no need to translate in X axis - horizontal position is determined by constraints
|
||||
mLockscreenSmartspaceController
|
||||
.shiftSplitShadeSmartspace(mClockPositionResult.clockY, animateClock);
|
||||
updateNotificationTranslucency();
|
||||
updateClock();
|
||||
}
|
||||
@@ -1602,6 +1613,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
if (mKeyguardUserSwitcherController != null) {
|
||||
mKeyguardUserSwitcherController.setAlpha(alpha);
|
||||
}
|
||||
mLockscreenSmartspaceController.setSplitShadeSmartspaceAlpha(alpha);
|
||||
}
|
||||
|
||||
public void animateToFullShade(long delay) {
|
||||
@@ -3783,6 +3795,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
public void dozeTimeTick() {
|
||||
mKeyguardBottomArea.dozeTimeTick();
|
||||
mKeyguardStatusViewController.dozeTimeTick();
|
||||
mLockscreenSmartspaceController.requestSmartspaceUpdate();
|
||||
if (mInterpolatedDarkAmount > 0) {
|
||||
positionClockAndNotifications();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.android.keyguard;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.times;
|
||||
@@ -29,6 +28,7 @@ import static org.mockito.Mockito.when;
|
||||
import android.content.res.Resources;
|
||||
import android.testing.AndroidTestingRunner;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
@@ -104,6 +104,8 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase {
|
||||
private AnimatableClockView mLargeClockView;
|
||||
@Mock
|
||||
private FrameLayout mLargeClockFrame;
|
||||
@Mock
|
||||
private ViewGroup mSmartspaceContainer;
|
||||
|
||||
private final View mFakeSmartspaceView = new View(mContext);
|
||||
|
||||
@@ -123,6 +125,8 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase {
|
||||
when(mView.findViewById(R.id.animatable_clock_view)).thenReturn(mClockView);
|
||||
when(mView.findViewById(R.id.animatable_clock_view_large)).thenReturn(mLargeClockView);
|
||||
when(mView.findViewById(R.id.lockscreen_clock_view_large)).thenReturn(mLargeClockFrame);
|
||||
when(mView.findViewById(R.id.keyguard_smartspace_container))
|
||||
.thenReturn(mSmartspaceContainer);
|
||||
when(mClockView.getContext()).thenReturn(getContext());
|
||||
when(mLargeClockView.getContext()).thenReturn(getContext());
|
||||
|
||||
@@ -210,7 +214,7 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void testSmartspaceEnabledRemovesKeyguardStatusArea() {
|
||||
when(mSmartspaceController.isEnabled()).thenReturn(true);
|
||||
when(mSmartspaceController.isSmartspaceEnabled()).thenReturn(true);
|
||||
when(mSmartspaceController.buildAndConnectView(any())).thenReturn(mFakeSmartspaceView);
|
||||
mController.init();
|
||||
|
||||
@@ -219,7 +223,7 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void testSmartspaceDisabledShowsKeyguardStatusArea() {
|
||||
when(mSmartspaceController.isEnabled()).thenReturn(false);
|
||||
when(mSmartspaceController.isSmartspaceEnabled()).thenReturn(false);
|
||||
mController.init();
|
||||
|
||||
assertEquals(View.VISIBLE, mStatusArea.getVisibility());
|
||||
@@ -227,17 +231,16 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void testDetachRemovesSmartspaceView() {
|
||||
when(mSmartspaceController.isEnabled()).thenReturn(true);
|
||||
when(mSmartspaceController.isSmartspaceEnabled()).thenReturn(true);
|
||||
when(mSmartspaceController.buildAndConnectView(any())).thenReturn(mFakeSmartspaceView);
|
||||
mController.init();
|
||||
verify(mView).addView(eq(mFakeSmartspaceView), anyInt(), any());
|
||||
|
||||
ArgumentCaptor<View.OnAttachStateChangeListener> listenerArgumentCaptor =
|
||||
ArgumentCaptor.forClass(View.OnAttachStateChangeListener.class);
|
||||
verify(mView).addOnAttachStateChangeListener(listenerArgumentCaptor.capture());
|
||||
|
||||
listenerArgumentCaptor.getValue().onViewDetachedFromWindow(mView);
|
||||
verify(mView).removeView(mFakeSmartspaceView);
|
||||
verify(mSmartspaceContainer).removeAllViews();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -389,7 +389,6 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() {
|
||||
verify(userTracker).removeCallback(userListener)
|
||||
verify(contentResolver).unregisterContentObserver(settingsObserver)
|
||||
verify(configurationController).removeCallback(configChangeListener)
|
||||
verify(statusBarStateController).removeCallback(statusBarStateListener)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -38,35 +38,27 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
private static final float ZERO_DRAG = 0.f;
|
||||
private static final float OPAQUE = 1.f;
|
||||
private static final float TRANSPARENT = 0.f;
|
||||
private static final boolean HAS_CUSTOM_CLOCK = false;
|
||||
private static final boolean HAS_VISIBLE_NOTIFS = false;
|
||||
|
||||
private KeyguardClockPositionAlgorithm mClockPositionAlgorithm;
|
||||
private KeyguardClockPositionAlgorithm.Result mClockPosition;
|
||||
private int mNotificationStackHeight;
|
||||
private float mPanelExpansion;
|
||||
private int mKeyguardStatusHeight;
|
||||
private float mDark;
|
||||
private boolean mHasCustomClock;
|
||||
private boolean mHasVisibleNotifs;
|
||||
private float mQsExpansion;
|
||||
private int mCutoutTopInset = 0; // in pixels
|
||||
private int mCutoutTopInsetPx = 0;
|
||||
private int mSplitShadeSmartspaceHeightPx = 0;
|
||||
private boolean mIsSplitShade = false;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mClockPositionAlgorithm = new KeyguardClockPositionAlgorithm();
|
||||
mClockPosition = new KeyguardClockPositionAlgorithm.Result();
|
||||
|
||||
mHasCustomClock = HAS_CUSTOM_CLOCK;
|
||||
mHasVisibleNotifs = HAS_VISIBLE_NOTIFS;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clockPositionTopOfScreenOnAOD() {
|
||||
// GIVEN on AOD and both stack scroll and clock have 0 height
|
||||
// GIVEN on AOD and clock has 0 height
|
||||
givenAOD();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
// WHEN the clock position algorithm is run
|
||||
positionClock();
|
||||
@@ -79,11 +71,10 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void clockPositionBelowCutout() {
|
||||
// GIVEN on AOD and both stack scroll and clock have 0 height
|
||||
// GIVEN on AOD and clock has 0 height
|
||||
givenAOD();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
mCutoutTopInset = 300;
|
||||
mCutoutTopInsetPx = 300;
|
||||
// WHEN the clock position algorithm is run
|
||||
positionClock();
|
||||
// THEN the clock Y position is below the cutout
|
||||
@@ -97,7 +88,6 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
public void clockPositionAdjustsForKeyguardStatusOnAOD() {
|
||||
// GIVEN on AOD with a clock of height 100
|
||||
givenAOD();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = 100;
|
||||
// WHEN the clock position algorithm is run
|
||||
positionClock();
|
||||
@@ -112,7 +102,6 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
public void clockPositionLargeClockOnAOD() {
|
||||
// GIVEN on AOD with a full screen clock
|
||||
givenAOD();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = SCREEN_HEIGHT;
|
||||
// WHEN the clock position algorithm is run
|
||||
positionClock();
|
||||
@@ -125,9 +114,8 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void clockPositionTopOfScreenOnLockScreen() {
|
||||
// GIVEN on lock screen with stack scroll and clock of 0 height
|
||||
// GIVEN on lock screen with clock of 0 height
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
// WHEN the clock position algorithm is run
|
||||
positionClock();
|
||||
@@ -137,25 +125,10 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
assertThat(mClockPosition.clockX).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clockPositionWithStackScrollExpandOnLockScreen() {
|
||||
// GIVEN on lock screen with stack scroll of height 500
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = 500;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
// WHEN the clock position algorithm is run
|
||||
positionClock();
|
||||
// THEN the clock Y position stays to the top
|
||||
assertThat(mClockPosition.clockY).isEqualTo(0);
|
||||
// AND the clock is positioned on the left.
|
||||
assertThat(mClockPosition.clockX).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clockPositionWithPartialDragOnLockScreen() {
|
||||
// GIVEN dragging up on lock screen
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
mPanelExpansion = 0.5f;
|
||||
// WHEN the clock position algorithm is run
|
||||
@@ -171,7 +144,6 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
public void clockPositionWithFullDragOnLockScreen() {
|
||||
// GIVEN the lock screen is dragged up
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
mPanelExpansion = 0.f;
|
||||
// WHEN the clock position algorithm is run
|
||||
@@ -184,7 +156,6 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
public void largeClockOnLockScreenIsTransparent() {
|
||||
// GIVEN on lock screen with a full screen clock
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = SCREEN_HEIGHT;
|
||||
// WHEN the clock position algorithm is run
|
||||
positionClock();
|
||||
@@ -194,9 +165,8 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void notifPositionTopOfScreenOnAOD() {
|
||||
// GIVEN on AOD and both stack scroll and clock have 0 height
|
||||
// GIVEN on AOD and clock has 0 height
|
||||
givenAOD();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
@@ -208,7 +178,6 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
public void notifPositionIndependentOfKeyguardStatusHeightOnAOD() {
|
||||
// GIVEN on AOD and clock has a nonzero height
|
||||
givenAOD();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = 100;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
@@ -220,7 +189,6 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
public void notifPositionWithLargeClockOnAOD() {
|
||||
// GIVEN on AOD and clock has a nonzero height
|
||||
givenAOD();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = SCREEN_HEIGHT;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
@@ -230,9 +198,8 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void notifPositionMiddleOfScreenOnLockScreen() {
|
||||
// GIVEN on lock screen and both stack scroll and clock have 0 height
|
||||
// GIVEN on lock screen and clock has 0 height
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
@@ -240,59 +207,43 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notifPositionAdjustsForStackHeightOnLockScreen() {
|
||||
// GIVEN on lock screen and stack scroller has a nonzero height
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = 500;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
// THEN the notif padding adjusts for keyguard status height
|
||||
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notifPositionAdjustsForClockHeightOnLockScreen() {
|
||||
// GIVEN on lock screen and stack scroller has a nonzero height
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = 200;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
// THEN the notif padding adjusts for both clock and notif stack.
|
||||
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(200);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notifPositionAdjustsForStackHeightAndClockHeightOnLockScreen() {
|
||||
// GIVEN on lock screen and stack scroller has a nonzero height
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = 500;
|
||||
mKeyguardStatusHeight = 200;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
// THEN the notifs are placed below the statusview
|
||||
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(200);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notifPositionAlignedWithClockInSplitShadeMode() {
|
||||
// GIVEN on lock screen and split shade mode
|
||||
givenLockScreen();
|
||||
mIsSplitShade = true;
|
||||
mHasCustomClock = true;
|
||||
mKeyguardStatusHeight = 200;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
// THEN the notif padding DOESN'T adjust for keyguard status height.
|
||||
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notifPositionAdjustedBySmartspaceHeightInSplitShadeMode() {
|
||||
givenLockScreen();
|
||||
mSplitShadeSmartspaceHeightPx = 200;
|
||||
mIsSplitShade = true;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
|
||||
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(200);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notifPositionWithLargeClockOnLockScreen() {
|
||||
// GIVEN on lock screen and clock has a nonzero height
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = SCREEN_HEIGHT;
|
||||
// WHEN the position algorithm is run
|
||||
positionClock();
|
||||
@@ -304,7 +255,6 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
public void notifPositionWithFullDragOnLockScreen() {
|
||||
// GIVEN the lock screen is dragged up
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = EMPTY_HEIGHT;
|
||||
mPanelExpansion = 0.f;
|
||||
// WHEN the clock position algorithm is run
|
||||
@@ -317,19 +267,18 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
public void notifPositionWithLargeClockFullDragOnLockScreen() {
|
||||
// GIVEN the lock screen is dragged up and a full screen clock
|
||||
givenLockScreen();
|
||||
mNotificationStackHeight = EMPTY_HEIGHT;
|
||||
mKeyguardStatusHeight = SCREEN_HEIGHT;
|
||||
mPanelExpansion = 0.f;
|
||||
// WHEN the clock position algorithm is run
|
||||
positionClock();
|
||||
// THEN the notif padding is zero.
|
||||
|
||||
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(
|
||||
(int) (mKeyguardStatusHeight * .667f));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clockHiddenWhenQsIsExpanded() {
|
||||
// GIVEN on the lock screen with a custom clock and visible notifications
|
||||
// GIVEN on the lock screen with visible notifications
|
||||
givenLockScreen();
|
||||
mQsExpansion = 1;
|
||||
// WHEN the clock position algorithm is run
|
||||
@@ -349,12 +298,12 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
||||
}
|
||||
|
||||
private void positionClock() {
|
||||
mClockPositionAlgorithm.setup(EMPTY_MARGIN, SCREEN_HEIGHT, mNotificationStackHeight,
|
||||
mPanelExpansion, SCREEN_HEIGHT, mKeyguardStatusHeight,
|
||||
mClockPositionAlgorithm.setup(EMPTY_MARGIN, SCREEN_HEIGHT,
|
||||
mPanelExpansion, mKeyguardStatusHeight,
|
||||
0 /* userSwitchHeight */, 0 /* userSwitchPreferredY */,
|
||||
mHasCustomClock, mHasVisibleNotifs, mDark, ZERO_DRAG, false /* bypassEnabled */,
|
||||
mDark, ZERO_DRAG, false /* bypassEnabled */,
|
||||
0 /* unlockedStackScrollerPadding */, mQsExpansion,
|
||||
mCutoutTopInset, mIsSplitShade);
|
||||
mCutoutTopInsetPx, mSplitShadeSmartspaceHeightPx, mIsSplitShade);
|
||||
mClockPositionAlgorithm.run(mClockPosition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ import android.view.ViewPropertyAnimator;
|
||||
import android.view.ViewStub;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
@@ -119,6 +120,7 @@ import com.android.systemui.statusbar.StatusBarStateControllerImpl;
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||
import com.android.systemui.statusbar.VibratorHelper;
|
||||
import com.android.systemui.statusbar.events.PrivacyDotViewController;
|
||||
import com.android.systemui.statusbar.lockscreen.LockscreenSmartspaceController;
|
||||
import com.android.systemui.statusbar.notification.ConversationNotificationManager;
|
||||
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
@@ -326,6 +328,10 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
private RecordingController mRecordingController;
|
||||
@Mock
|
||||
private ControlsComponent mControlsComponent;
|
||||
@Mock
|
||||
private LockscreenSmartspaceController mLockscreenSmartspaceController;
|
||||
@Mock
|
||||
private FrameLayout mSplitShadeSmartspaceContainer;
|
||||
|
||||
private SysuiStatusBarStateController mStatusBarStateController;
|
||||
private NotificationPanelViewController mNotificationPanelViewController;
|
||||
@@ -376,6 +382,8 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
when(mView.findViewById(R.id.qs_frame)).thenReturn(mQsFrame);
|
||||
when(mView.findViewById(R.id.keyguard_status_view))
|
||||
.thenReturn(mock(KeyguardStatusView.class));
|
||||
when(mView.findViewById(R.id.split_shade_smartspace_container))
|
||||
.thenReturn(mSplitShadeSmartspaceContainer);
|
||||
mNotificationContainerParent = new NotificationsQuickSettingsContainer(getContext(), null);
|
||||
mNotificationContainerParent.addView(newViewWithId(R.id.qs_frame));
|
||||
mNotificationContainerParent.addView(newViewWithId(R.id.notification_stack_scroller));
|
||||
@@ -479,6 +487,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
new FakeExecutor(new FakeSystemClock()),
|
||||
mSecureSettings,
|
||||
mSplitShadeHeaderController,
|
||||
mLockscreenSmartspaceController,
|
||||
mUnlockedScreenOffAnimationController,
|
||||
mNotificationRemoteInputManager,
|
||||
mControlsComponent);
|
||||
|
||||
Reference in New Issue
Block a user