summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author kwaky <kwaky@google.com> 2020-02-06 13:45:57 -0800
committer kwaky <kwaky@google.com> 2020-02-12 16:29:11 -0800
commit6073f3c58b4b7585bc446c49cb1fa86f438d307c (patch)
tree1156dc1bb39f0107d65ad43ba0f0beffc95a028e
parentc1e78426b5632271e501bbc91ace4b8a68ee791e (diff)
DO NOT MERGE Adjust NotificationView bottom margin based on whether Keyboard is shown.
If the Keyboard is shown, then margin bottom is 0. Otherwise, the margin is the height of the NavBar. Bug: 149022190 Test: Manual. Verify that NotificationView's margin adjusts based on whether keyboard or IME is shown. Change-Id: I96c50a4d773dfac9b57ab1c15cfc59d315da4605
-rw-r--r--packages/CarSystemUI/res/layout/notification_center_activity.xml3
-rw-r--r--packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java8
2 files changed, 10 insertions, 1 deletions
diff --git a/packages/CarSystemUI/res/layout/notification_center_activity.xml b/packages/CarSystemUI/res/layout/notification_center_activity.xml
index 0af74c4462a6..e5cc08a3b601 100644
--- a/packages/CarSystemUI/res/layout/notification_center_activity.xml
+++ b/packages/CarSystemUI/res/layout/notification_center_activity.xml
@@ -20,7 +20,8 @@
android:id="@+id/notification_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/notification_shade_background_color">
+ android:background="@color/notification_shade_background_color"
+ android:visibility="invisible">
<View
android:id="@+id/glass_pane"
diff --git a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
index 0a2d5a08a914..e0f398742ebc 100644
--- a/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
+++ b/packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
@@ -1092,6 +1092,7 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
}
mNavigationBarWindow.setVisibility(isKeyboardVisible ? View.GONE : View.VISIBLE);
+ setNotificationViewBottomMargin(isKeyboardVisible ? 0 : mNavigationBarWindow.getHeight());
mBottomNavBarVisible = !isKeyboardVisible;
}
@@ -1155,6 +1156,13 @@ public class CarStatusBar extends StatusBar implements CarBatteryController.Batt
addTemperatureViewToController(mRightNavigationBarView);
}
+ private void setNotificationViewBottomMargin(int bottomMargin) {
+ ViewGroup.MarginLayoutParams params =
+ (ViewGroup.MarginLayoutParams) mNotificationView.getLayoutParams();
+ params.setMargins(params.leftMargin, params.topMargin, params.rightMargin, bottomMargin);
+ mNotificationView.setLayoutParams(params);
+ }
+
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
//When executing dump() function simultaneously, we need to serialize them