Merge "Refactor around NSSL to open up some more APIs for subcomponents." into tm-qpr-dev

This commit is contained in:
Ben Lin
2022-10-13 16:30:26 +00:00
committed by Android (Google) Code Review
7 changed files with 23 additions and 10 deletions

View File

@@ -28,6 +28,7 @@ import com.android.systemui.keyguard.KeyguardSliceProvider;
import com.android.systemui.media.muteawait.MediaMuteAwaitConnectionCli;
import com.android.systemui.media.nearby.NearbyMediaDevicesManager;
import com.android.systemui.people.PeopleProvider;
import com.android.systemui.statusbar.QsFrameTranslateModule;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.unfold.FoldStateLogger;
import com.android.systemui.unfold.FoldStateLoggingProvider;
@@ -63,6 +64,7 @@ import dagger.Subcomponent;
@Subcomponent(modules = {
DefaultComponentBinder.class,
DependencyProvider.class,
QsFrameTranslateModule.class,
SystemUIBinder.class,
SystemUIModule.class,
SystemUICoreStartableModule.class,

View File

@@ -61,7 +61,6 @@ import com.android.systemui.smartspace.dagger.SmartspaceModule;
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.collection.NotifPipeline;
import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinder;
import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl;
@@ -133,7 +132,6 @@ import dagger.Provides;
PeopleModule.class,
PluginModule.class,
PrivacyModule.class,
QsFrameTranslateModule.class,
ScreenshotModule.class,
SensorModule.class,
MultiUserUtilsModule.class,

View File

@@ -3383,8 +3383,9 @@ public final class NotificationPanelViewController extends PanelViewController {
}
private void updateQsFrameTranslation() {
mQsFrameTranslateController.translateQsFrame(mQsFrame, mQs, mOverExpansion,
mQsTranslationForFullShadeTransition);
mQsFrameTranslateController.translateQsFrame(mQsFrame, mQs,
mNavigationBarBottomHeight + mAmbientState.getStackTopMargin());
}
@Override

View File

@@ -36,8 +36,7 @@ public abstract class QsFrameTranslateController {
/**
* Calculate and translate the QS Frame on the Y-axis.
*/
public abstract void translateQsFrame(View qsFrame, QS qs, float overExpansion,
float qsTranslationForFullShadeTransition);
public abstract void translateQsFrame(View qsFrame, QS qs, int bottomInset);
/**
* Calculate the top padding for notifications panel. This could be the supplied

View File

@@ -27,6 +27,8 @@ import javax.inject.Inject;
/**
* Default implementation of QS Translation. This by default does not do much.
* This class can be subclassed to allow System UI variants the flexibility to change position of
* the Quick Settings frame.
*/
@SysUISingleton
public class QsFrameTranslateImpl extends QsFrameTranslateController {
@@ -37,8 +39,8 @@ public class QsFrameTranslateImpl extends QsFrameTranslateController {
}
@Override
public void translateQsFrame(View qsFrame, QS qs, float overExpansion,
float qsTranslationForFullShadeTransition) {
public void translateQsFrame(View qsFrame, QS qs, int bottomInset) {
// Empty implementation by default, meant to be overridden by subclasses.
}
@Override

View File

@@ -1115,6 +1115,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
updateAlgorithmLayoutMinHeight();
updateOwnTranslationZ();
// Give The Algorithm information regarding the QS height so it can layout notifications
// properly. Needed for some devices that grows notifications down-to-top
mStackScrollAlgorithm.updateQSFrameTop(mQsHeader == null ? 0 : mQsHeader.getHeight());
// Once the layout has finished, we don't need to animate any scrolling clampings anymore.
mAnimateStackYForContentHeightChange = false;
}

View File

@@ -416,13 +416,20 @@ public class StackScrollAlgorithm {
return i > 0 ? algorithmState.visibleChildren.get(i - 1) : null;
}
/**
* Update the position of QS Frame.
*/
public void updateQSFrameTop(int qsHeight) {
// Intentionally empty for sub-classes in other device form factors to override
}
/**
* Determine the positions for the views. This is the main part of the algorithm.
*
* @param algorithmState The state in which the current pass of the algorithm is currently in
* @param ambientState The current ambient state
*/
private void updatePositionsForState(StackScrollAlgorithmState algorithmState,
protected void updatePositionsForState(StackScrollAlgorithmState algorithmState,
AmbientState ambientState) {
if (!ambientState.isOnKeyguard()
|| (ambientState.isBypassEnabled() && ambientState.isPulseExpanding())) {
@@ -448,7 +455,7 @@ public class StackScrollAlgorithm {
* @return Fraction to apply to view height and gap between views.
* Does not include shelf height even if shelf is showing.
*/
private float getExpansionFractionWithoutShelf(
protected float getExpansionFractionWithoutShelf(
StackScrollAlgorithmState algorithmState,
AmbientState ambientState) {