Introducing CellPosMapper which allows mapping between UI position

and model position

Test: atest CellPosMapperTest
Bug: 188081026
Change-Id: If5c6b3df5ad240317bb535c675f6ead94084238e
This commit is contained in:
Sunny Goyal
2023-01-27 14:37:07 -08:00
parent 150b7b0497
commit 669b71f5b3
17 changed files with 385 additions and 88 deletions

View File

@@ -29,8 +29,6 @@ import androidx.annotation.Nullable;
*/
public class CellLayoutLayoutParams extends ViewGroup.MarginLayoutParams {
private int mScreenId = -1;
@ViewDebug.ExportedProperty
private int mCellX;
@@ -97,20 +95,17 @@ public class CellLayoutLayoutParams extends ViewGroup.MarginLayoutParams {
this.mCellY = source.getCellY();
this.cellHSpan = source.cellHSpan;
this.cellVSpan = source.cellVSpan;
this.mScreenId = source.getScreenId();
this.mTmpCellX = source.getTmpCellX();
this.mTmpCellY = source.getTmpCellY();
this.useTmpCoords = source.useTmpCoords;
}
public CellLayoutLayoutParams(int cellX, int cellY, int cellHSpan, int cellVSpan,
int screenId) {
public CellLayoutLayoutParams(int cellX, int cellY, int cellHSpan, int cellVSpan) {
super(CellLayoutLayoutParams.MATCH_PARENT, CellLayoutLayoutParams.MATCH_PARENT);
this.mCellX = cellX;
this.mCellY = cellY;
this.cellHSpan = cellHSpan;
this.cellVSpan = cellVSpan;
this.mScreenId = screenId;
}
/**
@@ -178,14 +173,6 @@ public class CellLayoutLayoutParams extends ViewGroup.MarginLayoutParams {
return "(" + this.getCellX() + ", " + this.getCellY() + ")";
}
public int getScreenId() {
return mScreenId;
}
public void setScreenId(int screenId) {
this.mScreenId = screenId;
}
/**
* Horizontal location of the item in the grid.
*/