summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;