Merge "When the notification shade is shown the functionality to show/hide HUN should be controlled via a config flag." into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a6d0f1f7fa
@@ -29,6 +29,9 @@
|
||||
<bool name="config_enableRightNavigationBar">false</bool>
|
||||
<bool name="config_enableBottomNavigationBar">true</bool>
|
||||
|
||||
<!-- Whether heads-up notifications should be shown when shade is open. -->
|
||||
<bool name="config_enableHeadsUpNotificationWhenNotificationShadeOpen">true</bool>
|
||||
|
||||
<bool name="config_hideNavWhenKeyguardBouncerShown">true</bool>
|
||||
<bool name="config_enablePersistentDockedActivity">false</bool>
|
||||
<string name="config_persistentDockedActivityIntentUri" translatable="false"></string>
|
||||
|
||||
@@ -165,6 +165,8 @@ public class CarStatusBar extends StatusBar implements
|
||||
private boolean mIsNotificationCardSwiping;
|
||||
// If notification shade is being swiped vertically to close.
|
||||
private boolean mIsSwipingVerticallyToClose;
|
||||
// Whether heads-up notifications should be shown when shade is open.
|
||||
private boolean mEnableHeadsUpNotificationWhenNotificationShadeOpen;
|
||||
|
||||
private final CarPowerStateListener mCarPowerStateListener =
|
||||
(int state) -> {
|
||||
@@ -459,6 +461,8 @@ public class CarStatusBar extends StatusBar implements
|
||||
}
|
||||
});
|
||||
|
||||
mEnableHeadsUpNotificationWhenNotificationShadeOpen = mContext.getResources().getBoolean(
|
||||
R.bool.config_enableHeadsUpNotificationWhenNotificationShadeOpen);
|
||||
CarHeadsUpNotificationManager carHeadsUpNotificationManager =
|
||||
new CarSystemUIHeadsUpNotificationManager(mContext,
|
||||
mNotificationClickHandlerFactory, mNotificationDataManager);
|
||||
@@ -1272,12 +1276,19 @@ public class CarStatusBar extends StatusBar implements
|
||||
mHeadsUpPanel.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setInternalInsetsInfo(ViewTreeObserver.InternalInsetsInfo info,
|
||||
HeadsUpEntry currentNotification, boolean panelExpanded) {
|
||||
super.setInternalInsetsInfo(info, currentNotification, mPanelExpanded);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setHeadsUpVisible() {
|
||||
// if the Notifications panel is showing don't show the Heads up
|
||||
if (mPanelExpanded) {
|
||||
if (!mEnableHeadsUpNotificationWhenNotificationShadeOpen && mPanelExpanded) {
|
||||
return;
|
||||
}
|
||||
|
||||
super.setHeadsUpVisible();
|
||||
if (mHeadsUpPanel.getVisibility() == View.VISIBLE) {
|
||||
mStatusBarWindowController.setHeadsUpShowing(true);
|
||||
|
||||
Reference in New Issue
Block a user