Merge "Use screen height to determine # of QS rows." into pi-dev

This commit is contained in:
TreeHugger Robot
2018-04-23 21:07:45 +00:00
committed by Android (Google) Code Review
6 changed files with 45 additions and 33 deletions

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (c) 2017, 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>
<!-- The number of rows in the QuickSettings -->
<integer name="quick_settings_num_rows">2</integer>
</resources>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (c) 2017, 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>
<!-- The number of rows in the QuickSettings -->
<integer name="quick_settings_num_rows">3</integer>
</resources>

View File

@@ -20,8 +20,5 @@
<!-- These resources are around just to allow their values to be customized
for different hardware and product builds. -->
<resources>
<integer name="quick_settings_num_rows">2</integer>
<integer name="quick_settings_num_rows_portrait">3</integer>
<bool name="quick_settings_show_full_alarm">true</bool>
</resources>

View File

@@ -1,24 +0,0 @@
<?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_rows">3</integer>
</resources>

View File

@@ -112,7 +112,6 @@
<!-- The number of rows in the QuickSettings -->
<integer name="quick_settings_num_rows">1</integer>
<integer name="quick_settings_num_rows_portrait">2</integer>
<!-- The number of columns that the top level tiles span in the QuickSettings -->
<integer name="quick_settings_user_time_settings_tile_span">1</integer>

View File

@@ -375,11 +375,7 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
}
private int getRows() {
final Resources res = getContext().getResources();
if (res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
return res.getInteger(R.integer.quick_settings_num_rows_portrait);
}
return Math.max(1, res.getInteger(R.integer.quick_settings_num_rows));
return Math.max(1, getResources().getInteger(R.integer.quick_settings_num_rows));
}
public void setMaxRows(int maxRows) {