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

@@ -24,6 +24,7 @@ import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherModel;
import com.android.launcher3.LauncherModel.CallbackTask;
import com.android.launcher3.LauncherModel.ModelUpdateTask;
import com.android.launcher3.celllayout.CellPosMapper;
import com.android.launcher3.model.BgDataModel.Callbacks;
import com.android.launcher3.model.BgDataModel.FixedContainerItems;
import com.android.launcher3.model.data.AppInfo;
@@ -96,7 +97,8 @@ public abstract class BaseModelUpdateTask implements ModelUpdateTask {
public ModelWriter getModelWriter() {
// Updates from model task, do not deal with icon position in hotseat. Also no need to
// verify changes as the ModelTasks always push the changes to callbacks
return mModel.getWriter(false /* hasVerticalHotseat */, false /* verifyChanges */, null);
return mModel.getWriter(false /* hasVerticalHotseat */, false /* verifyChanges */,
CellPosMapper.DEFAULT, null);
}
public void bindUpdatedWorkspaceItems(@NonNull final List<WorkspaceItemInfo> allUpdates) {