Loading packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +25 −10 Original line number Diff line number Diff line Loading @@ -38,8 +38,8 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.keyguard.ScreenLifecycle; import com.android.systemui.plugins.qs.QS; import com.android.systemui.plugins.qs.QSTile; import com.android.systemui.qs.QSDetailClipper; Loading @@ -52,6 +52,8 @@ import com.android.systemui.statusbar.policy.KeyguardMonitor.Callback; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; /** * Allows full-screen customization of QS, through show() and hide(). * Loading @@ -66,6 +68,8 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene private final QSDetailClipper mClipper; private final LightBarController mLightBarController; private KeyguardMonitor mKeyguardMonitor; private final ScreenLifecycle mScreenLifecycle; private final TileQueryHelper mTileQueryHelper; private final View mTransparentView; Loading @@ -82,7 +86,11 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene private boolean mOpening; private boolean mIsShowingNavBackdrop; public QSCustomizer(Context context, AttributeSet attrs) { @Inject public QSCustomizer(Context context, AttributeSet attrs, LightBarController lightBarController, KeyguardMonitor keyguardMonitor, ScreenLifecycle screenLifecycle) { super(new ContextThemeWrapper(context, R.style.edit_theme), attrs); LayoutInflater.from(getContext()).inflate(R.layout.qs_customize_panel_content, this); Loading Loading @@ -115,7 +123,9 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene DefaultItemAnimator animator = new DefaultItemAnimator(); animator.setMoveDuration(TileAdapter.MOVE_DURATION); mRecyclerView.setItemAnimator(animator); mLightBarController = Dependency.get(LightBarController.class); mLightBarController = lightBarController; mKeyguardMonitor = keyguardMonitor; mScreenLifecycle = screenLifecycle; updateNavBackDrop(getResources().getConfiguration()); } Loading Loading @@ -177,7 +187,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene queryTiles(); mNotifQsContainer.setCustomizerAnimating(true); mNotifQsContainer.setCustomizerShowing(true); Dependency.get(KeyguardMonitor.class).addCallback(mKeyguardCallback); mKeyguardMonitor.addCallback(mKeyguardCallback); updateNavColors(); } } Loading @@ -193,7 +203,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene queryTiles(); mNotifQsContainer.setCustomizerAnimating(false); mNotifQsContainer.setCustomizerShowing(true); Dependency.get(KeyguardMonitor.class).addCallback(mKeyguardCallback); mKeyguardMonitor.addCallback(mKeyguardCallback); updateNavColors(); } } Loading @@ -203,16 +213,21 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene } public void hide() { final boolean animate = mScreenLifecycle.getScreenState() != ScreenLifecycle.SCREEN_OFF; if (isShown) { MetricsLogger.hidden(getContext(), MetricsProto.MetricsEvent.QS_EDIT); isShown = false; mToolbar.dismissPopupMenus(); setCustomizing(false); save(); if (animate) { mClipper.animateCircularClip(mX, mY, false, mCollapseAnimationListener); mNotifQsContainer.setCustomizerAnimating(true); } else { setVisibility(View.GONE); } mNotifQsContainer.setCustomizerAnimating(animate); mNotifQsContainer.setCustomizerShowing(false); Dependency.get(KeyguardMonitor.class).removeCallback(mKeyguardCallback); mKeyguardMonitor.removeCallback(mKeyguardCallback); updateNavColors(); } } Loading Loading @@ -268,7 +283,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene public void saveInstanceState(Bundle outState) { if (isShown) { Dependency.get(KeyguardMonitor.class).removeCallback(mKeyguardCallback); mKeyguardMonitor.removeCallback(mKeyguardCallback); } outState.putBoolean(EXTRA_QS_CUSTOMIZING, mCustomizing); } Loading Loading @@ -300,7 +315,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene @Override public void onKeyguardShowingChanged() { if (!isAttachedToWindow()) return; if (Dependency.get(KeyguardMonitor.class).isShowing() && !mOpening) { if (mKeyguardMonitor.isShowing() && !mOpening) { hide(); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +2 −1 Original line number Diff line number Diff line Loading @@ -1798,7 +1798,8 @@ public class NotificationPanelView extends PanelView implements private void setQsExpansion(float height) { height = Math.min(Math.max(height, mQsMinExpansionHeight), mQsMaxExpansionHeight); mQsFullyExpanded = height == mQsMaxExpansionHeight && mQsMaxExpansionHeight != 0; if (height > mQsMinExpansionHeight && !mQsExpanded && !mStackScrollerOverscrolling) { if (height > mQsMinExpansionHeight && !mQsExpanded && !mStackScrollerOverscrolling && !mDozing) { setQsExpanded(true); } else if (height <= mQsMinExpansionHeight && mQsExpanded) { setQsExpanded(false); Loading packages/SystemUI/src/com/android/systemui/util/InjectionInflationController.java +6 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import com.android.systemui.qs.QSFooterImpl; import com.android.systemui.qs.QSPanel; import com.android.systemui.qs.QuickQSPanel; import com.android.systemui.qs.QuickStatusBarHeader; import com.android.systemui.qs.customize.QSCustomizer; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.phone.LockIcon; Loading Loading @@ -172,6 +173,11 @@ public class InjectionInflationController { * Creates the QuickQSPanel. */ QuickQSPanel createQuickQSPanel(); /** * Creates the QSCustomizer. */ QSCustomizer createQSCustomizer(); } /** Loading Loading
packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +25 −10 Original line number Diff line number Diff line Loading @@ -38,8 +38,8 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.keyguard.ScreenLifecycle; import com.android.systemui.plugins.qs.QS; import com.android.systemui.plugins.qs.QSTile; import com.android.systemui.qs.QSDetailClipper; Loading @@ -52,6 +52,8 @@ import com.android.systemui.statusbar.policy.KeyguardMonitor.Callback; import java.util.ArrayList; import java.util.List; import javax.inject.Inject; /** * Allows full-screen customization of QS, through show() and hide(). * Loading @@ -66,6 +68,8 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene private final QSDetailClipper mClipper; private final LightBarController mLightBarController; private KeyguardMonitor mKeyguardMonitor; private final ScreenLifecycle mScreenLifecycle; private final TileQueryHelper mTileQueryHelper; private final View mTransparentView; Loading @@ -82,7 +86,11 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene private boolean mOpening; private boolean mIsShowingNavBackdrop; public QSCustomizer(Context context, AttributeSet attrs) { @Inject public QSCustomizer(Context context, AttributeSet attrs, LightBarController lightBarController, KeyguardMonitor keyguardMonitor, ScreenLifecycle screenLifecycle) { super(new ContextThemeWrapper(context, R.style.edit_theme), attrs); LayoutInflater.from(getContext()).inflate(R.layout.qs_customize_panel_content, this); Loading Loading @@ -115,7 +123,9 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene DefaultItemAnimator animator = new DefaultItemAnimator(); animator.setMoveDuration(TileAdapter.MOVE_DURATION); mRecyclerView.setItemAnimator(animator); mLightBarController = Dependency.get(LightBarController.class); mLightBarController = lightBarController; mKeyguardMonitor = keyguardMonitor; mScreenLifecycle = screenLifecycle; updateNavBackDrop(getResources().getConfiguration()); } Loading Loading @@ -177,7 +187,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene queryTiles(); mNotifQsContainer.setCustomizerAnimating(true); mNotifQsContainer.setCustomizerShowing(true); Dependency.get(KeyguardMonitor.class).addCallback(mKeyguardCallback); mKeyguardMonitor.addCallback(mKeyguardCallback); updateNavColors(); } } Loading @@ -193,7 +203,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene queryTiles(); mNotifQsContainer.setCustomizerAnimating(false); mNotifQsContainer.setCustomizerShowing(true); Dependency.get(KeyguardMonitor.class).addCallback(mKeyguardCallback); mKeyguardMonitor.addCallback(mKeyguardCallback); updateNavColors(); } } Loading @@ -203,16 +213,21 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene } public void hide() { final boolean animate = mScreenLifecycle.getScreenState() != ScreenLifecycle.SCREEN_OFF; if (isShown) { MetricsLogger.hidden(getContext(), MetricsProto.MetricsEvent.QS_EDIT); isShown = false; mToolbar.dismissPopupMenus(); setCustomizing(false); save(); if (animate) { mClipper.animateCircularClip(mX, mY, false, mCollapseAnimationListener); mNotifQsContainer.setCustomizerAnimating(true); } else { setVisibility(View.GONE); } mNotifQsContainer.setCustomizerAnimating(animate); mNotifQsContainer.setCustomizerShowing(false); Dependency.get(KeyguardMonitor.class).removeCallback(mKeyguardCallback); mKeyguardMonitor.removeCallback(mKeyguardCallback); updateNavColors(); } } Loading Loading @@ -268,7 +283,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene public void saveInstanceState(Bundle outState) { if (isShown) { Dependency.get(KeyguardMonitor.class).removeCallback(mKeyguardCallback); mKeyguardMonitor.removeCallback(mKeyguardCallback); } outState.putBoolean(EXTRA_QS_CUSTOMIZING, mCustomizing); } Loading Loading @@ -300,7 +315,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene @Override public void onKeyguardShowingChanged() { if (!isAttachedToWindow()) return; if (Dependency.get(KeyguardMonitor.class).isShowing() && !mOpening) { if (mKeyguardMonitor.isShowing() && !mOpening) { hide(); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +2 −1 Original line number Diff line number Diff line Loading @@ -1798,7 +1798,8 @@ public class NotificationPanelView extends PanelView implements private void setQsExpansion(float height) { height = Math.min(Math.max(height, mQsMinExpansionHeight), mQsMaxExpansionHeight); mQsFullyExpanded = height == mQsMaxExpansionHeight && mQsMaxExpansionHeight != 0; if (height > mQsMinExpansionHeight && !mQsExpanded && !mStackScrollerOverscrolling) { if (height > mQsMinExpansionHeight && !mQsExpanded && !mStackScrollerOverscrolling && !mDozing) { setQsExpanded(true); } else if (height <= mQsMinExpansionHeight && mQsExpanded) { setQsExpanded(false); Loading
packages/SystemUI/src/com/android/systemui/util/InjectionInflationController.java +6 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import com.android.systemui.qs.QSFooterImpl; import com.android.systemui.qs.QSPanel; import com.android.systemui.qs.QuickQSPanel; import com.android.systemui.qs.QuickStatusBarHeader; import com.android.systemui.qs.customize.QSCustomizer; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.phone.LockIcon; Loading Loading @@ -172,6 +173,11 @@ public class InjectionInflationController { * Creates the QuickQSPanel. */ QuickQSPanel createQuickQSPanel(); /** * Creates the QSCustomizer. */ QSCustomizer createQSCustomizer(); } /** Loading