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_enableRightNavigationBar">false</bool>
|
||||||
<bool name="config_enableBottomNavigationBar">true</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_hideNavWhenKeyguardBouncerShown">true</bool>
|
||||||
<bool name="config_enablePersistentDockedActivity">false</bool>
|
<bool name="config_enablePersistentDockedActivity">false</bool>
|
||||||
<string name="config_persistentDockedActivityIntentUri" translatable="false"></string>
|
<string name="config_persistentDockedActivityIntentUri" translatable="false"></string>
|
||||||
|
|||||||
@@ -165,6 +165,8 @@ public class CarStatusBar extends StatusBar implements
|
|||||||
private boolean mIsNotificationCardSwiping;
|
private boolean mIsNotificationCardSwiping;
|
||||||
// If notification shade is being swiped vertically to close.
|
// If notification shade is being swiped vertically to close.
|
||||||
private boolean mIsSwipingVerticallyToClose;
|
private boolean mIsSwipingVerticallyToClose;
|
||||||
|
// Whether heads-up notifications should be shown when shade is open.
|
||||||
|
private boolean mEnableHeadsUpNotificationWhenNotificationShadeOpen;
|
||||||
|
|
||||||
private final CarPowerStateListener mCarPowerStateListener =
|
private final CarPowerStateListener mCarPowerStateListener =
|
||||||
(int state) -> {
|
(int state) -> {
|
||||||
@@ -459,6 +461,8 @@ public class CarStatusBar extends StatusBar implements
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mEnableHeadsUpNotificationWhenNotificationShadeOpen = mContext.getResources().getBoolean(
|
||||||
|
R.bool.config_enableHeadsUpNotificationWhenNotificationShadeOpen);
|
||||||
CarHeadsUpNotificationManager carHeadsUpNotificationManager =
|
CarHeadsUpNotificationManager carHeadsUpNotificationManager =
|
||||||
new CarSystemUIHeadsUpNotificationManager(mContext,
|
new CarSystemUIHeadsUpNotificationManager(mContext,
|
||||||
mNotificationClickHandlerFactory, mNotificationDataManager);
|
mNotificationClickHandlerFactory, mNotificationDataManager);
|
||||||
@@ -1272,12 +1276,19 @@ public class CarStatusBar extends StatusBar implements
|
|||||||
mHeadsUpPanel.setVisibility(View.INVISIBLE);
|
mHeadsUpPanel.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setInternalInsetsInfo(ViewTreeObserver.InternalInsetsInfo info,
|
||||||
|
HeadsUpEntry currentNotification, boolean panelExpanded) {
|
||||||
|
super.setInternalInsetsInfo(info, currentNotification, mPanelExpanded);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setHeadsUpVisible() {
|
protected void setHeadsUpVisible() {
|
||||||
// if the Notifications panel is showing don't show the Heads up
|
// if the Notifications panel is showing don't show the Heads up
|
||||||
if (mPanelExpanded) {
|
if (!mEnableHeadsUpNotificationWhenNotificationShadeOpen && mPanelExpanded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.setHeadsUpVisible();
|
super.setHeadsUpVisible();
|
||||||
if (mHeadsUpPanel.getVisibility() == View.VISIBLE) {
|
if (mHeadsUpPanel.getVisibility() == View.VISIBLE) {
|
||||||
mStatusBarWindowController.setHeadsUpShowing(true);
|
mStatusBarWindowController.setHeadsUpShowing(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user