diff options
| author | 2016-02-04 15:06:02 +0000 | |
|---|---|---|
| committer | 2016-02-04 15:06:02 +0000 | |
| commit | c265356596e74d5658dbd0088cd93b50afad3be8 (patch) | |
| tree | 2a6a6e0df27b0bae20247dced982a39de54c9e21 | |
| parent | 1615c3ff12652fb51a6adb3b7d9ea0065bf299ba (diff) | |
| parent | bef6de8b3fafea4453e28ecd419561563fcae771 (diff) | |
Merge "Update QS + Notification landscape width"
5 files changed, 61 insertions, 4 deletions
diff --git a/packages/SystemUI/res/values-land/config.xml b/packages/SystemUI/res/values-land/config.xml index e0affa177897..43e7bacd3d41 100644 --- a/packages/SystemUI/res/values-land/config.xml +++ b/packages/SystemUI/res/values-land/config.xml @@ -38,6 +38,4 @@ while the stack is not focused. --> <item name="recents_layout_unfocused_range_min" format="float" type="integer">-2</item> <item name="recents_layout_unfocused_range_max" format="float" type="integer">1.5</item> - - <integer name="quick_settings_num_columns">4</integer> </resources> diff --git a/packages/SystemUI/res/values-land/dimens.xml b/packages/SystemUI/res/values-land/dimens.xml index c75a89fa4b31..26a81c8d835c 100644 --- a/packages/SystemUI/res/values-land/dimens.xml +++ b/packages/SystemUI/res/values-land/dimens.xml @@ -19,8 +19,7 @@ <!-- thickness (width) of the navigation bar on phones that require it --> <dimen name="navigation_bar_size">@*android:dimen/navigation_bar_width</dimen> - <!-- Standard notification width + gravity --> - <dimen name="notification_panel_width">@dimen/standard_notification_panel_width</dimen> + <!-- Standard notification gravity --> <integer name="notification_panel_layout_gravity">@integer/standard_notification_panel_layout_gravity</integer> <dimen name="docked_divider_handle_width">2dp</dimen> diff --git a/packages/SystemUI/res/values-w550dp-land/config.xml b/packages/SystemUI/res/values-w550dp-land/config.xml new file mode 100644 index 000000000000..71e54a1ca61c --- /dev/null +++ b/packages/SystemUI/res/values-w550dp-land/config.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2016, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<!-- These resources are around just to allow their values to be customized + for different hardware and product builds. --> +<resources> + <integer name="quick_settings_num_columns">4</integer> +</resources> diff --git a/packages/SystemUI/res/values-w550dp-land/dimens.xml b/packages/SystemUI/res/values-w550dp-land/dimens.xml new file mode 100644 index 000000000000..eaca9d718fd2 --- /dev/null +++ b/packages/SystemUI/res/values-w550dp-land/dimens.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (c) 2016, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ +--> +<resources> + <!-- Standard notification width + gravity --> + <dimen name="notification_panel_width">544dp</dimen> +</resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java index cbb71c5d97e6..fd28b095c09d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.phone; import android.content.Context; +import android.content.res.Configuration; import android.graphics.Canvas; import android.util.AttributeSet; import android.view.View; @@ -55,6 +56,20 @@ public class NotificationsQuickSettingsContainer extends FrameLayout } @Override + protected void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + reloadWidth(mScrollView); + reloadWidth(mStackScroller); + } + + private void reloadWidth(View view) { + LayoutParams params = (LayoutParams) view.getLayoutParams(); + params.width = getContext().getResources().getDimensionPixelSize( + R.dimen.notification_panel_width); + view.setLayoutParams(params); + } + + @Override public WindowInsets onApplyWindowInsets(WindowInsets insets) { setPadding(0, 0, 0, insets.getSystemWindowInsetBottom()); return insets; |