Fixing RTL issues with apps ordering and snapping to page. (Bug 8238938, Bug 8374016, Bug 8373578)
Change-Id: I57ff58a6202a2794f02cfc13ed6124b10256dbbf
This commit is contained in:
@@ -998,6 +998,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
|
||||
|
||||
public void syncAppsPageItems(int page, boolean immediate) {
|
||||
// ensure that we have the right number of items on the pages
|
||||
final boolean isRtl = isLayoutRtl();
|
||||
int numCells = mCellCountX * mCellCountY;
|
||||
int startIndex = page * numCells;
|
||||
int endIndex = Math.min(startIndex + numCells, mApps.size());
|
||||
@@ -1019,6 +1020,9 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
|
||||
int index = i - startIndex;
|
||||
int x = index % mCellCountX;
|
||||
int y = index / mCellCountX;
|
||||
if (isRtl) {
|
||||
x = mCellCountX - x - 1;
|
||||
}
|
||||
layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1));
|
||||
|
||||
items.add(info);
|
||||
|
||||
Reference in New Issue
Block a user