Loading packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml +12 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentTop="true" android:layout_marginBottom="24dp" android:visibility="gone"> <com.android.keyguard.GradientTextClock android:id="@+id/gradient_clock_view" Loading @@ -88,4 +89,15 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/clock_view" /> <com.android.systemui.statusbar.phone.NotificationIconContainer android:id="@+id/left_aligned_notification_icon_container" android:paddingStart="16dp" android:paddingEnd="16dp" android:layout_width="match_parent" android:layout_height="@dimen/notification_shelf_height" android:layout_marginTop="@dimen/widget_vertical_padding" android:layout_below="@id/keyguard_status_area" android:visibility="gone" /> </com.android.keyguard.KeyguardClockSwitch> packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +26 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.WallpaperManager; import android.content.res.Resources; import android.text.format.DateFormat; import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; import com.android.internal.colorextraction.ColorExtractor; Loading @@ -29,6 +30,8 @@ import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.ClockPlugin; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.phone.NotificationIconAreaController; import com.android.systemui.statusbar.phone.NotificationIconContainer; import com.android.systemui.util.ViewController; import java.util.Locale; Loading @@ -47,6 +50,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private final SysuiColorExtractor mColorExtractor; private final ClockManager mClockManager; private final KeyguardSliceViewController mKeyguardSliceViewController; private final NotificationIconAreaController mNotificationIconAreaController; private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL; private final StatusBarStateController.StateListener mStateListener = new StatusBarStateController.StateListener() { Loading Loading @@ -79,13 +85,15 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS @Main Resources resources, StatusBarStateController statusBarStateController, SysuiColorExtractor colorExtractor, ClockManager clockManager, KeyguardSliceViewController keyguardSliceViewController) { KeyguardSliceViewController keyguardSliceViewController, NotificationIconAreaController notificationIconAreaController) { super(keyguardClockSwitch); mResources = resources; mStatusBarStateController = statusBarStateController; mColorExtractor = colorExtractor; mClockManager = clockManager; mKeyguardSliceViewController = keyguardSliceViewController; mNotificationIconAreaController = notificationIconAreaController; } /** Loading @@ -105,6 +113,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mStatusBarStateController.addCallback(mStateListener); mColorExtractor.addOnColorsChangedListener(mColorsListener); mView.updateColors(getGradientColors()); updateAodIcons(); } @Override Loading Loading @@ -174,7 +183,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS * Update lockscreen mode that may change clock display. */ void updateLockScreenMode(int mode) { mView.updateLockScreenMode(mode); mLockScreenMode = mode; mView.updateLockScreenMode(mLockScreenMode); updateAodIcons(); } void updateTimeZone(TimeZone timeZone) { Loading @@ -187,6 +198,19 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mView.setFormat24Hour(Patterns.sClockView24); } private void updateAodIcons() { NotificationIconContainer nic = (NotificationIconContainer) mView.findViewById( com.android.systemui.R.id.left_aligned_notification_icon_container); if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1) { // alt icon area is set in KeyguardClockSwitchController mNotificationIconAreaController.setupAodIcons(nic, mLockScreenMode); } else { nic.setVisibility(View.GONE); } } private void setClockPlugin(ClockPlugin plugin) { mView.setClockPlugin(plugin, mStatusBarStateController.getState()); } Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +21 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ 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.phone.NotificationIconAreaController; import com.android.systemui.statusbar.phone.NotificationIconContainer; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.ViewController; Loading @@ -50,8 +52,10 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV private final KeyguardStateController mKeyguardStateController; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final ConfigurationController mConfigurationController; private final NotificationIconAreaController mNotificationIconAreaController; private boolean mKeyguardStatusViewAnimating; private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL; @Inject public KeyguardStatusViewController( Loading @@ -60,13 +64,15 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV KeyguardClockSwitchController keyguardClockSwitchController, KeyguardStateController keyguardStateController, KeyguardUpdateMonitor keyguardUpdateMonitor, ConfigurationController configurationController) { ConfigurationController configurationController, NotificationIconAreaController notificationIconAreaController) { super(keyguardStatusView); mKeyguardSliceViewController = keyguardSliceViewController; mKeyguardClockSwitchController = keyguardClockSwitchController; mKeyguardStateController = keyguardStateController; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mConfigurationController = configurationController; mNotificationIconAreaController = notificationIconAreaController; } @Override Loading @@ -78,6 +84,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV protected void onViewAttached() { mKeyguardUpdateMonitor.registerCallback(mInfoCallback); mConfigurationController.addCallback(mConfigurationListener); updateAodIcons(); } @Override Loading Loading @@ -248,6 +255,17 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV mKeyguardClockSwitchController.refresh(); } private void updateAodIcons() { NotificationIconContainer nic = (NotificationIconContainer) mView.findViewById(com.android.systemui.R.id.clock_notification_icon_container); if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL) { // alternate icon area is set in KeyguardClockSwitchController mNotificationIconAreaController.setupAodIcons(nic, mLockScreenMode); } else { nic.setVisibility(View.GONE); } } private final ConfigurationController.ConfigurationListener mConfigurationListener = new ConfigurationController.ConfigurationListener() { @Override Loading @@ -265,8 +283,10 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() { @Override public void onLockScreenModeChanged(int mode) { mLockScreenMode = mode; mKeyguardClockSwitchController.updateLockScreenMode(mode); mKeyguardSliceViewController.updateLockScreenMode(mode); updateAodIcons(); } @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +35 −14 Original line number Diff line number Diff line Loading @@ -91,9 +91,7 @@ public class NotificationIconAreaController implements private boolean mAnimationsEnabled; private int mAodIconTint; private boolean mFullyHidden; private boolean mAodIconsVisible; private boolean mIsPulsing; private boolean mShowLowPriority = true; @VisibleForTesting Loading Loading @@ -158,22 +156,23 @@ public class NotificationIconAreaController implements } /** * Called by the StatusBar. The StatusBar passes the NotificationIconContainer which holds * the aod icons. * Called by the Keyguard*ViewController whose view contains the aod icons. */ void setupAodIcons(@NonNull NotificationIconContainer aodIcons) { public void setupAodIcons(@NonNull NotificationIconContainer aodIcons, int lockScreenMode) { boolean changed = mAodIcons != null; if (changed) { mAodIcons.setAnimationsEnabled(false); mAodIcons.removeAllViews(); } mAodIcons = aodIcons; mAodIcons.setOnLockScreen(true); mAodIcons.setOnLockScreen(true, lockScreenMode); updateAodIconsVisibility(false /* animate */); updateAnimations(); if (changed) { updateAodNotificationIcons(); } updateIconLayoutParams(mContext); } public void setupShelf(NotificationShelfController notificationShelfController) { Loading @@ -182,25 +181,33 @@ public class NotificationIconAreaController implements } public void onDensityOrFontScaleChanged(Context context) { updateIconLayoutParams(context); } private void updateIconLayoutParams(Context context) { reloadDimens(context); final FrameLayout.LayoutParams params = generateIconLayoutParams(); for (int i = 0; i < mNotificationIcons.getChildCount(); i++) { View child = mNotificationIcons.getChildAt(i); child.setLayoutParams(params); } for (int i = 0; i < mCenteredIcon.getChildCount(); i++) { View child = mCenteredIcon.getChildAt(i); child.setLayoutParams(params); } if (mShelfIcons != null) { for (int i = 0; i < mShelfIcons.getChildCount(); i++) { View child = mShelfIcons.getChildAt(i); child.setLayoutParams(params); } for (int i = 0; i < mCenteredIcon.getChildCount(); i++) { View child = mCenteredIcon.getChildAt(i); child.setLayoutParams(params); } if (mAodIcons != null) { for (int i = 0; i < mAodIcons.getChildCount(); i++) { View child = mAodIcons.getChildAt(i); child.setLayoutParams(params); } } } @NonNull private FrameLayout.LayoutParams generateIconLayoutParams() { Loading Loading @@ -358,6 +365,9 @@ public class NotificationIconAreaController implements } public void updateAodNotificationIcons() { if (mAodIcons == null) { return; } updateIconsForLayout(entry -> entry.getIcons().getAodIcon(), mAodIcons, false /* showAmbient */, true /* showLowPriority */, Loading Loading @@ -546,6 +556,9 @@ public class NotificationIconAreaController implements @Override public void onDozingChanged(boolean isDozing) { if (mAodIcons == null) { return; } boolean animate = mDozeParameters.getAlwaysOn() && !mDozeParameters.getDisplayNeedsBlanking(); mAodIcons.setDozing(isDozing, animate, 0); Loading @@ -564,7 +577,9 @@ public class NotificationIconAreaController implements private void updateAnimations() { boolean inShade = mStatusBarStateController.getState() == StatusBarState.SHADE; if (mAodIcons != null) { mAodIcons.setAnimationsEnabled(mAnimationsEnabled && !inShade); } mCenteredIcon.setAnimationsEnabled(mAnimationsEnabled && inShade); mNotificationIcons.setAnimationsEnabled(mAnimationsEnabled && inShade); } Loading @@ -575,6 +590,9 @@ public class NotificationIconAreaController implements } public void appearAodIcons() { if (mAodIcons == null) { return; } if (mDozeParameters.shouldControlScreenOff()) { mAodIcons.setTranslationY(-mAodIconAppearTranslation); mAodIcons.setAlpha(0); Loading Loading @@ -637,6 +655,9 @@ public class NotificationIconAreaController implements } private void updateAodIconsVisibility(boolean animate) { if (mAodIcons == null) { return; } boolean visible = mBypassController.getBypassEnabled() || mWakeUpCoordinator.getNotificationsFullyHidden(); if (mStatusBarStateController.getState() != StatusBarState.KEYGUARD) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +10 −2 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.view.animation.Interpolator; import androidx.collection.ArrayMap; import com.android.internal.statusbar.StatusBarIcon; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.statusbar.AlphaOptimizedFrameLayout; Loading Loading @@ -148,6 +149,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { private float mActualPaddingStart = NO_VALUE; private boolean mDozing; private boolean mOnLockScreen; private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL; private boolean mChangingViewPositions; private int mAddAnimationStartIndex = -1; private int mCannedAnimationStartIndex = -1; Loading Loading @@ -453,7 +455,8 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { mFirstVisibleIconState = mIconStates.get(getChildAt(0)); } boolean center = mOnLockScreen; boolean center = mOnLockScreen && mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL; if (center && translationX < getLayoutEnd()) { float initialTranslation = mFirstVisibleIconState == null ? 0 : mFirstVisibleIconState.xTranslation; Loading Loading @@ -686,8 +689,13 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { } } public void setOnLockScreen(boolean onLockScreen) { /** * Set whether the device is on the lockscreen and which lockscreen mode the device is * configured to. Depending on these values, the layout of the AOD icons change. */ public void setOnLockScreen(boolean onLockScreen, int lockScreenMode) { mOnLockScreen = onLockScreen; mLockScreenMode = lockScreenMode; } public class IconState extends ViewState { Loading Loading
packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml +12 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentTop="true" android:layout_marginBottom="24dp" android:visibility="gone"> <com.android.keyguard.GradientTextClock android:id="@+id/gradient_clock_view" Loading @@ -88,4 +89,15 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/clock_view" /> <com.android.systemui.statusbar.phone.NotificationIconContainer android:id="@+id/left_aligned_notification_icon_container" android:paddingStart="16dp" android:paddingEnd="16dp" android:layout_width="match_parent" android:layout_height="@dimen/notification_shelf_height" android:layout_marginTop="@dimen/widget_vertical_padding" android:layout_below="@id/keyguard_status_area" android:visibility="gone" /> </com.android.keyguard.KeyguardClockSwitch>
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +26 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.WallpaperManager; import android.content.res.Resources; import android.text.format.DateFormat; import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; import com.android.internal.colorextraction.ColorExtractor; Loading @@ -29,6 +30,8 @@ import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.ClockPlugin; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.phone.NotificationIconAreaController; import com.android.systemui.statusbar.phone.NotificationIconContainer; import com.android.systemui.util.ViewController; import java.util.Locale; Loading @@ -47,6 +50,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS private final SysuiColorExtractor mColorExtractor; private final ClockManager mClockManager; private final KeyguardSliceViewController mKeyguardSliceViewController; private final NotificationIconAreaController mNotificationIconAreaController; private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL; private final StatusBarStateController.StateListener mStateListener = new StatusBarStateController.StateListener() { Loading Loading @@ -79,13 +85,15 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS @Main Resources resources, StatusBarStateController statusBarStateController, SysuiColorExtractor colorExtractor, ClockManager clockManager, KeyguardSliceViewController keyguardSliceViewController) { KeyguardSliceViewController keyguardSliceViewController, NotificationIconAreaController notificationIconAreaController) { super(keyguardClockSwitch); mResources = resources; mStatusBarStateController = statusBarStateController; mColorExtractor = colorExtractor; mClockManager = clockManager; mKeyguardSliceViewController = keyguardSliceViewController; mNotificationIconAreaController = notificationIconAreaController; } /** Loading @@ -105,6 +113,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mStatusBarStateController.addCallback(mStateListener); mColorExtractor.addOnColorsChangedListener(mColorsListener); mView.updateColors(getGradientColors()); updateAodIcons(); } @Override Loading Loading @@ -174,7 +183,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS * Update lockscreen mode that may change clock display. */ void updateLockScreenMode(int mode) { mView.updateLockScreenMode(mode); mLockScreenMode = mode; mView.updateLockScreenMode(mLockScreenMode); updateAodIcons(); } void updateTimeZone(TimeZone timeZone) { Loading @@ -187,6 +198,19 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mView.setFormat24Hour(Patterns.sClockView24); } private void updateAodIcons() { NotificationIconContainer nic = (NotificationIconContainer) mView.findViewById( com.android.systemui.R.id.left_aligned_notification_icon_container); if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1) { // alt icon area is set in KeyguardClockSwitchController mNotificationIconAreaController.setupAodIcons(nic, mLockScreenMode); } else { nic.setVisibility(View.GONE); } } private void setClockPlugin(ClockPlugin plugin) { mView.setClockPlugin(plugin, mStatusBarStateController.getState()); } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +21 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ 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.phone.NotificationIconAreaController; import com.android.systemui.statusbar.phone.NotificationIconContainer; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.util.ViewController; Loading @@ -50,8 +52,10 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV private final KeyguardStateController mKeyguardStateController; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final ConfigurationController mConfigurationController; private final NotificationIconAreaController mNotificationIconAreaController; private boolean mKeyguardStatusViewAnimating; private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL; @Inject public KeyguardStatusViewController( Loading @@ -60,13 +64,15 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV KeyguardClockSwitchController keyguardClockSwitchController, KeyguardStateController keyguardStateController, KeyguardUpdateMonitor keyguardUpdateMonitor, ConfigurationController configurationController) { ConfigurationController configurationController, NotificationIconAreaController notificationIconAreaController) { super(keyguardStatusView); mKeyguardSliceViewController = keyguardSliceViewController; mKeyguardClockSwitchController = keyguardClockSwitchController; mKeyguardStateController = keyguardStateController; mKeyguardUpdateMonitor = keyguardUpdateMonitor; mConfigurationController = configurationController; mNotificationIconAreaController = notificationIconAreaController; } @Override Loading @@ -78,6 +84,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV protected void onViewAttached() { mKeyguardUpdateMonitor.registerCallback(mInfoCallback); mConfigurationController.addCallback(mConfigurationListener); updateAodIcons(); } @Override Loading Loading @@ -248,6 +255,17 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV mKeyguardClockSwitchController.refresh(); } private void updateAodIcons() { NotificationIconContainer nic = (NotificationIconContainer) mView.findViewById(com.android.systemui.R.id.clock_notification_icon_container); if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL) { // alternate icon area is set in KeyguardClockSwitchController mNotificationIconAreaController.setupAodIcons(nic, mLockScreenMode); } else { nic.setVisibility(View.GONE); } } private final ConfigurationController.ConfigurationListener mConfigurationListener = new ConfigurationController.ConfigurationListener() { @Override Loading @@ -265,8 +283,10 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() { @Override public void onLockScreenModeChanged(int mode) { mLockScreenMode = mode; mKeyguardClockSwitchController.updateLockScreenMode(mode); mKeyguardSliceViewController.updateLockScreenMode(mode); updateAodIcons(); } @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +35 −14 Original line number Diff line number Diff line Loading @@ -91,9 +91,7 @@ public class NotificationIconAreaController implements private boolean mAnimationsEnabled; private int mAodIconTint; private boolean mFullyHidden; private boolean mAodIconsVisible; private boolean mIsPulsing; private boolean mShowLowPriority = true; @VisibleForTesting Loading Loading @@ -158,22 +156,23 @@ public class NotificationIconAreaController implements } /** * Called by the StatusBar. The StatusBar passes the NotificationIconContainer which holds * the aod icons. * Called by the Keyguard*ViewController whose view contains the aod icons. */ void setupAodIcons(@NonNull NotificationIconContainer aodIcons) { public void setupAodIcons(@NonNull NotificationIconContainer aodIcons, int lockScreenMode) { boolean changed = mAodIcons != null; if (changed) { mAodIcons.setAnimationsEnabled(false); mAodIcons.removeAllViews(); } mAodIcons = aodIcons; mAodIcons.setOnLockScreen(true); mAodIcons.setOnLockScreen(true, lockScreenMode); updateAodIconsVisibility(false /* animate */); updateAnimations(); if (changed) { updateAodNotificationIcons(); } updateIconLayoutParams(mContext); } public void setupShelf(NotificationShelfController notificationShelfController) { Loading @@ -182,25 +181,33 @@ public class NotificationIconAreaController implements } public void onDensityOrFontScaleChanged(Context context) { updateIconLayoutParams(context); } private void updateIconLayoutParams(Context context) { reloadDimens(context); final FrameLayout.LayoutParams params = generateIconLayoutParams(); for (int i = 0; i < mNotificationIcons.getChildCount(); i++) { View child = mNotificationIcons.getChildAt(i); child.setLayoutParams(params); } for (int i = 0; i < mCenteredIcon.getChildCount(); i++) { View child = mCenteredIcon.getChildAt(i); child.setLayoutParams(params); } if (mShelfIcons != null) { for (int i = 0; i < mShelfIcons.getChildCount(); i++) { View child = mShelfIcons.getChildAt(i); child.setLayoutParams(params); } for (int i = 0; i < mCenteredIcon.getChildCount(); i++) { View child = mCenteredIcon.getChildAt(i); child.setLayoutParams(params); } if (mAodIcons != null) { for (int i = 0; i < mAodIcons.getChildCount(); i++) { View child = mAodIcons.getChildAt(i); child.setLayoutParams(params); } } } @NonNull private FrameLayout.LayoutParams generateIconLayoutParams() { Loading Loading @@ -358,6 +365,9 @@ public class NotificationIconAreaController implements } public void updateAodNotificationIcons() { if (mAodIcons == null) { return; } updateIconsForLayout(entry -> entry.getIcons().getAodIcon(), mAodIcons, false /* showAmbient */, true /* showLowPriority */, Loading Loading @@ -546,6 +556,9 @@ public class NotificationIconAreaController implements @Override public void onDozingChanged(boolean isDozing) { if (mAodIcons == null) { return; } boolean animate = mDozeParameters.getAlwaysOn() && !mDozeParameters.getDisplayNeedsBlanking(); mAodIcons.setDozing(isDozing, animate, 0); Loading @@ -564,7 +577,9 @@ public class NotificationIconAreaController implements private void updateAnimations() { boolean inShade = mStatusBarStateController.getState() == StatusBarState.SHADE; if (mAodIcons != null) { mAodIcons.setAnimationsEnabled(mAnimationsEnabled && !inShade); } mCenteredIcon.setAnimationsEnabled(mAnimationsEnabled && inShade); mNotificationIcons.setAnimationsEnabled(mAnimationsEnabled && inShade); } Loading @@ -575,6 +590,9 @@ public class NotificationIconAreaController implements } public void appearAodIcons() { if (mAodIcons == null) { return; } if (mDozeParameters.shouldControlScreenOff()) { mAodIcons.setTranslationY(-mAodIconAppearTranslation); mAodIcons.setAlpha(0); Loading Loading @@ -637,6 +655,9 @@ public class NotificationIconAreaController implements } private void updateAodIconsVisibility(boolean animate) { if (mAodIcons == null) { return; } boolean visible = mBypassController.getBypassEnabled() || mWakeUpCoordinator.getNotificationsFullyHidden(); if (mStatusBarStateController.getState() != StatusBarState.KEYGUARD) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +10 −2 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.view.animation.Interpolator; import androidx.collection.ArrayMap; import com.android.internal.statusbar.StatusBarIcon; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.statusbar.AlphaOptimizedFrameLayout; Loading Loading @@ -148,6 +149,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { private float mActualPaddingStart = NO_VALUE; private boolean mDozing; private boolean mOnLockScreen; private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL; private boolean mChangingViewPositions; private int mAddAnimationStartIndex = -1; private int mCannedAnimationStartIndex = -1; Loading Loading @@ -453,7 +455,8 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { mFirstVisibleIconState = mIconStates.get(getChildAt(0)); } boolean center = mOnLockScreen; boolean center = mOnLockScreen && mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL; if (center && translationX < getLayoutEnd()) { float initialTranslation = mFirstVisibleIconState == null ? 0 : mFirstVisibleIconState.xTranslation; Loading Loading @@ -686,8 +689,13 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { } } public void setOnLockScreen(boolean onLockScreen) { /** * Set whether the device is on the lockscreen and which lockscreen mode the device is * configured to. Depending on these values, the layout of the AOD icons change. */ public void setOnLockScreen(boolean onLockScreen, int lockScreenMode) { mOnLockScreen = onLockScreen; mLockScreenMode = lockScreenMode; } public class IconState extends ViewState { Loading