Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fb9c574 authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: fix tile pages not filling up



Change-Id: I9083a83fe774921394a50432a993f256c5b1b305
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent ecb5cdb1
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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;