Loading packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +2 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import com.android.systemui.shared.system.smartspace.SmartspaceTransitionControl import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.QsFrameTranslateModule; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotifPipeline; Loading Loading @@ -112,6 +113,7 @@ import dagger.Provides; LogModule.class, PeopleHubModule.class, PluginModule.class, QsFrameTranslateModule.class, ScreenshotModule.class, SensorModule.class, SettingsModule.class, Loading packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateController.java 0 → 100644 +48 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar; import android.view.View; import com.android.systemui.plugins.qs.QS; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.phone.StatusBar; /** * Calculates and moves the QS frame vertically. */ public abstract class QsFrameTranslateController { protected StatusBar mStatusBar; public QsFrameTranslateController(StatusBar statusBar) { mStatusBar = statusBar; } /** * Calculate and translate the QS Frame on the Y-axis. */ public abstract void translateQsFrame(View qsFrame, QS qs, float overExpansion, float qsTranslationForFullShadeTransition); /** * Calculate the top padding for notifications panel. This could be the supplied * @param expansionHeight or recalculate it for a different value. */ public abstract float getNotificationsTopPadding(float expansionHeight, NotificationStackScrollLayoutController controller); } packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateImpl.java 0 → 100644 +50 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar; import android.view.View; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.plugins.qs.QS; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.phone.StatusBar; import javax.inject.Inject; /** * Default implementation of QS Translation. This by default does not do much. */ @SysUISingleton public class QsFrameTranslateImpl extends QsFrameTranslateController { @Inject public QsFrameTranslateImpl(StatusBar statusBar) { super(statusBar); } @Override public void translateQsFrame(View qsFrame, QS qs, float overExpansion, float qsTranslationForFullShadeTransition) { } @Override public float getNotificationsTopPadding(float expansionHeight, NotificationStackScrollLayoutController controller) { return expansionHeight; } } packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateModule.java 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar; import com.android.systemui.dagger.SysUISingleton; import dagger.Binds; import dagger.Module; @Module public interface QsFrameTranslateModule { @Binds @SysUISingleton QsFrameTranslateController bindQsFrameTranslateController(QsFrameTranslateImpl impl); } packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +9 −6 Original line number Diff line number Diff line Loading @@ -157,6 +157,7 @@ import com.android.systemui.statusbar.NotificationRemoteInputManager; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShelfController; import com.android.systemui.statusbar.PulseExpansionHandler; import com.android.systemui.statusbar.QsFrameTranslateController; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.SysuiStatusBarStateController; Loading Loading @@ -339,6 +340,7 @@ public class NotificationPanelViewController extends PanelViewController { private KeyguardStatusBarViewController mKeyguardStatusBarViewController; @VisibleForTesting QS mQs; private FrameLayout mQsFrame; private QsFrameTranslateController mQsFrameTranslateController; @Nullable private CommunalHostViewController mCommunalViewController; private KeyguardStatusViewController mKeyguardStatusViewController; Loading Loading @@ -775,7 +777,8 @@ public class NotificationPanelViewController extends PanelViewController { NotificationRemoteInputManager remoteInputManager, Optional<SysUIUnfoldComponent> unfoldComponent, ControlsComponent controlsComponent, InteractionJankMonitor interactionJankMonitor) { InteractionJankMonitor interactionJankMonitor, QsFrameTranslateController qsFrameTranslateController) { super(view, falsingManager, dozeLog, Loading Loading @@ -900,7 +903,6 @@ public class NotificationPanelViewController extends PanelViewController { mMaxKeyguardNotifications = resources.getInteger(R.integer.keyguard_max_notification_count); mKeyguardUnfoldTransition = unfoldComponent.map(c -> c.getKeyguardUnfoldTransition()); mCommunalSourceCallback = () -> { mUiExecutor.execute(() -> setCommunalSource(null /*source*/)); }; Loading @@ -908,7 +910,7 @@ public class NotificationPanelViewController extends PanelViewController { mCommunalSourceMonitorCallback = (source) -> { mUiExecutor.execute(() -> setCommunalSource(source)); }; mQsFrameTranslateController = qsFrameTranslateController; updateUserSwitcherFlags(); onFinishInflate(); } Loading Loading @@ -2667,7 +2669,8 @@ public class NotificationPanelViewController extends PanelViewController { (float) (mQsMaxExpansionHeight), computeQsExpansionFraction()); } else { return mQsExpansionHeight; return mQsFrameTranslateController.getNotificationsTopPadding(mQsExpansionHeight, mNotificationStackScrollLayoutController); } } Loading Loading @@ -3251,8 +3254,8 @@ public class NotificationPanelViewController extends PanelViewController { } private void updateQsFrameTranslation() { float translation = mOverExpansion / 2.0f + mQsTranslationForFullShadeTransition; mQsFrame.setTranslationY(translation); mQsFrameTranslateController.translateQsFrame(mQsFrame, mQs, mOverExpansion, mQsTranslationForFullShadeTransition); } @Override Loading Loading
packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +2 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import com.android.systemui.shared.system.smartspace.SmartspaceTransitionControl import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.QsFrameTranslateModule; import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotifPipeline; Loading Loading @@ -112,6 +113,7 @@ import dagger.Provides; LogModule.class, PeopleHubModule.class, PluginModule.class, QsFrameTranslateModule.class, ScreenshotModule.class, SensorModule.class, SettingsModule.class, Loading
packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateController.java 0 → 100644 +48 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar; import android.view.View; import com.android.systemui.plugins.qs.QS; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.phone.StatusBar; /** * Calculates and moves the QS frame vertically. */ public abstract class QsFrameTranslateController { protected StatusBar mStatusBar; public QsFrameTranslateController(StatusBar statusBar) { mStatusBar = statusBar; } /** * Calculate and translate the QS Frame on the Y-axis. */ public abstract void translateQsFrame(View qsFrame, QS qs, float overExpansion, float qsTranslationForFullShadeTransition); /** * Calculate the top padding for notifications panel. This could be the supplied * @param expansionHeight or recalculate it for a different value. */ public abstract float getNotificationsTopPadding(float expansionHeight, NotificationStackScrollLayoutController controller); }
packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateImpl.java 0 → 100644 +50 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar; import android.view.View; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.plugins.qs.QS; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.phone.StatusBar; import javax.inject.Inject; /** * Default implementation of QS Translation. This by default does not do much. */ @SysUISingleton public class QsFrameTranslateImpl extends QsFrameTranslateController { @Inject public QsFrameTranslateImpl(StatusBar statusBar) { super(statusBar); } @Override public void translateQsFrame(View qsFrame, QS qs, float overExpansion, float qsTranslationForFullShadeTransition) { } @Override public float getNotificationsTopPadding(float expansionHeight, NotificationStackScrollLayoutController controller) { return expansionHeight; } }
packages/SystemUI/src/com/android/systemui/statusbar/QsFrameTranslateModule.java 0 → 100644 +30 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar; import com.android.systemui.dagger.SysUISingleton; import dagger.Binds; import dagger.Module; @Module public interface QsFrameTranslateModule { @Binds @SysUISingleton QsFrameTranslateController bindQsFrameTranslateController(QsFrameTranslateImpl impl); }
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +9 −6 Original line number Diff line number Diff line Loading @@ -157,6 +157,7 @@ import com.android.systemui.statusbar.NotificationRemoteInputManager; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShelfController; import com.android.systemui.statusbar.PulseExpansionHandler; import com.android.systemui.statusbar.QsFrameTranslateController; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.SysuiStatusBarStateController; Loading Loading @@ -339,6 +340,7 @@ public class NotificationPanelViewController extends PanelViewController { private KeyguardStatusBarViewController mKeyguardStatusBarViewController; @VisibleForTesting QS mQs; private FrameLayout mQsFrame; private QsFrameTranslateController mQsFrameTranslateController; @Nullable private CommunalHostViewController mCommunalViewController; private KeyguardStatusViewController mKeyguardStatusViewController; Loading Loading @@ -775,7 +777,8 @@ public class NotificationPanelViewController extends PanelViewController { NotificationRemoteInputManager remoteInputManager, Optional<SysUIUnfoldComponent> unfoldComponent, ControlsComponent controlsComponent, InteractionJankMonitor interactionJankMonitor) { InteractionJankMonitor interactionJankMonitor, QsFrameTranslateController qsFrameTranslateController) { super(view, falsingManager, dozeLog, Loading Loading @@ -900,7 +903,6 @@ public class NotificationPanelViewController extends PanelViewController { mMaxKeyguardNotifications = resources.getInteger(R.integer.keyguard_max_notification_count); mKeyguardUnfoldTransition = unfoldComponent.map(c -> c.getKeyguardUnfoldTransition()); mCommunalSourceCallback = () -> { mUiExecutor.execute(() -> setCommunalSource(null /*source*/)); }; Loading @@ -908,7 +910,7 @@ public class NotificationPanelViewController extends PanelViewController { mCommunalSourceMonitorCallback = (source) -> { mUiExecutor.execute(() -> setCommunalSource(source)); }; mQsFrameTranslateController = qsFrameTranslateController; updateUserSwitcherFlags(); onFinishInflate(); } Loading Loading @@ -2667,7 +2669,8 @@ public class NotificationPanelViewController extends PanelViewController { (float) (mQsMaxExpansionHeight), computeQsExpansionFraction()); } else { return mQsExpansionHeight; return mQsFrameTranslateController.getNotificationsTopPadding(mQsExpansionHeight, mNotificationStackScrollLayoutController); } } Loading Loading @@ -3251,8 +3254,8 @@ public class NotificationPanelViewController extends PanelViewController { } private void updateQsFrameTranslation() { float translation = mOverExpansion / 2.0f + mQsTranslationForFullShadeTransition; mQsFrame.setTranslationY(translation); mQsFrameTranslateController.translateQsFrame(mQsFrame, mQs, mOverExpansion, mQsTranslationForFullShadeTransition); } @Override Loading