Update QS + Notification landscape width

Make it bigger, also make QS + Notification width update on config
change, so the new width can take effect.

Change-Id: Id069d21358d7bb716a1dfadc21fa11d1e5d69575
This commit is contained in:
Jason Monk
2016-02-03 11:26:07 -05:00
parent 49d34d995b
commit bef6de8b3f
5 changed files with 61 additions and 4 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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;
@@ -54,6 +55,20 @@ public class NotificationsQuickSettingsContainer extends FrameLayout
mUserSwitcher = userSwitcher;
}
@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());