From 78d834bc833d9903324a09741d33cd176a164114 Mon Sep 17 00:00:00 2001 From: Amin Shaikh Date: Mon, 23 Apr 2018 13:07:31 -0400 Subject: [PATCH] Use screen height to determine # of QS rows. 1 row default 2 rows >320dp 3 rows >600dp Change-Id: I5d547bdf851a7398bbe78d8c762015fb02aa378d Fixes: 78383956 Test: visual on Pixel and Pixel XL --- .../SystemUI/res/values-h320dp/config.xml | 22 +++++++++++++++++ .../SystemUI/res/values-h600dp/config.xml | 22 +++++++++++++++++ .../SystemUI/res/values-sw410dp/config.xml | 3 --- .../SystemUI/res/values-sw540dp/config.xml | 24 ------------------- packages/SystemUI/res/values/config.xml | 1 - .../android/systemui/qs/PagedTileLayout.java | 6 +---- 6 files changed, 45 insertions(+), 33 deletions(-) create mode 100644 packages/SystemUI/res/values-h320dp/config.xml create mode 100644 packages/SystemUI/res/values-h600dp/config.xml delete mode 100644 packages/SystemUI/res/values-sw540dp/config.xml diff --git a/packages/SystemUI/res/values-h320dp/config.xml b/packages/SystemUI/res/values-h320dp/config.xml new file mode 100644 index 0000000000000..a9c19db0f46f2 --- /dev/null +++ b/packages/SystemUI/res/values-h320dp/config.xml @@ -0,0 +1,22 @@ + + + + + + 2 + diff --git a/packages/SystemUI/res/values-h600dp/config.xml b/packages/SystemUI/res/values-h600dp/config.xml new file mode 100644 index 0000000000000..8616e3e627793 --- /dev/null +++ b/packages/SystemUI/res/values-h600dp/config.xml @@ -0,0 +1,22 @@ + + + + + + 3 + diff --git a/packages/SystemUI/res/values-sw410dp/config.xml b/packages/SystemUI/res/values-sw410dp/config.xml index 362c1d214b0e5..8ace7bf135731 100644 --- a/packages/SystemUI/res/values-sw410dp/config.xml +++ b/packages/SystemUI/res/values-sw410dp/config.xml @@ -20,8 +20,5 @@ - 2 - 3 - true diff --git a/packages/SystemUI/res/values-sw540dp/config.xml b/packages/SystemUI/res/values-sw540dp/config.xml deleted file mode 100644 index e554fc6dd4d14..0000000000000 --- a/packages/SystemUI/res/values-sw540dp/config.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - 3 - diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 7eb08c4c3582c..88e3331ff76c4 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -112,7 +112,6 @@ 1 - 2 1 diff --git a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java index 1fd60239ee98c..8cfba2cc53d7c 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java +++ b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java @@ -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) {