summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2015-12-14 11:22:00 -0600
committerRoman Birg <roman@cyngn.com>2015-12-14 11:22:00 -0600
commit1fb9c5747a9b19eeab734b3bcf52d8fe346aec82 (patch)
tree849eea7c109ec846ed9e651c35b0efe5760fbbef
parentecb5cdb170d4caceea603e15428cea6267c1dcf7 (diff)
downloadandroid_frameworks_base-staging/insight.tar.gz
android_frameworks_base-staging/insight.tar.bz2
android_frameworks_base-staging/insight.zip
SystemUI: fix tile pages not filling upstaging/insight
Change-Id: I9083a83fe774921394a50432a993f256c5b1b305 Signed-off-by: Roman Birg <roman@cyngn.com>
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
index 9d76e4dafaf..9cc45d834ba 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
@@ -420,8 +420,10 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
return mEditing;
}
- protected int getPagesForCount(int size) {
- return (int) Math.ceil(size / (double) getTilesPerPage());
+ protected int getPagesForCount(int tileCount) {
+ tileCount -= getTilesPerPage(true);
+ // first page + rest of tiles
+ return 1 + (int) Math.ceil(tileCount / (double) getTilesPerPage(false));
}
protected int getCurrentMaxPageCount() {
@@ -604,8 +606,8 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
}
}
- public int getTilesPerPage() {
- if (!mFirstRowLarge) {
+ public int getTilesPerPage(boolean firstPage) {
+ if ((!mFirstRowLarge && firstPage)|| !firstPage) {
return QSTileHost.TILES_PER_PAGE + 1;
}
return QSTileHost.TILES_PER_PAGE;