diff options
| author | 2020-03-18 17:07:41 +0000 | |
|---|---|---|
| committer | 2020-03-18 17:07:41 +0000 | |
| commit | 962b460f1c1d8bb93926fa86b215cffb4265715e (patch) | |
| tree | 784f045ed7bac9be26cc90f07f23eda8cd0c4b8c /packages/CarSystemUI/src | |
| parent | 96d70f138e4eba0a51ee1186da1df0eb64bcdd26 (diff) | |
| parent | 96cf38e427fdc59240c52c372f8db9ce54683661 (diff) | |
Merge "Added boolean flag to allow showing notification on the bottom of the screen rather than on the top." into rvc-dev
Diffstat (limited to 'packages/CarSystemUI/src')
| -rw-r--r-- | packages/CarSystemUI/src/com/android/systemui/car/notification/CarHeadsUpNotificationSystemContainer.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/CarSystemUI/src/com/android/systemui/car/notification/CarHeadsUpNotificationSystemContainer.java b/packages/CarSystemUI/src/com/android/systemui/car/notification/CarHeadsUpNotificationSystemContainer.java index 689d2d537bd6..53e5d9fe91ec 100644 --- a/packages/CarSystemUI/src/com/android/systemui/car/notification/CarHeadsUpNotificationSystemContainer.java +++ b/packages/CarSystemUI/src/com/android/systemui/car/notification/CarHeadsUpNotificationSystemContainer.java @@ -60,6 +60,8 @@ public class CarHeadsUpNotificationSystemContainer implements CarHeadsUpNotifica mCarDeviceProvisionedController = deviceProvisionedController; mCarStatusBarLazy = carStatusBarLazy; + boolean showOnBottom = resources.getBoolean(R.bool.config_showHeadsUpNotificationOnBottom); + WindowManager.LayoutParams lp = new WindowManager.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT, @@ -68,11 +70,13 @@ public class CarHeadsUpNotificationSystemContainer implements CarHeadsUpNotifica | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, PixelFormat.TRANSLUCENT); - lp.gravity = Gravity.TOP; + lp.gravity = showOnBottom ? Gravity.BOTTOM : Gravity.TOP; lp.setTitle("HeadsUpNotification"); - mWindow = (ViewGroup) LayoutInflater.from(context) - .inflate(R.layout.headsup_container, null, false); + int layoutId = showOnBottom + ? R.layout.headsup_container_bottom + : R.layout.headsup_container; + mWindow = (ViewGroup) LayoutInflater.from(context).inflate(layoutId, null, false); windowManager.addView(mWindow, lp); mWindow.setVisibility(View.INVISIBLE); mHeadsUpContentFrame = mWindow.findViewById(R.id.headsup_content); |