Minor stylistic changes in Workspace.java.
Change-Id: Ib07611f27cbc427d11abccd8b74ea144485752f7
This commit is contained in:
parent
ff8febabb0
commit
70e8b15721
|
@ -2078,40 +2078,40 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
|||
mLastReorderY = -1;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* Convert the 2D coordinate xy from the parent View's coordinate space to this CellLayout's
|
||||
* coordinate space. The argument xy is modified with the return result.
|
||||
*/
|
||||
private void mapPointFromSelfToChild(View v, float[] xy) {
|
||||
xy[0] = xy[0] - v.getLeft();
|
||||
xy[1] = xy[1] - v.getTop();
|
||||
}
|
||||
/*
|
||||
*
|
||||
* Convert the 2D coordinate xy from the parent View's coordinate space to this CellLayout's
|
||||
* coordinate space. The argument xy is modified with the return result.
|
||||
*/
|
||||
private void mapPointFromSelfToChild(View v, float[] xy) {
|
||||
xy[0] = xy[0] - v.getLeft();
|
||||
xy[1] = xy[1] - v.getTop();
|
||||
}
|
||||
|
||||
boolean isPointInSelfOverHotseat(int x, int y) {
|
||||
mTempFXY[0] = x;
|
||||
mTempFXY[1] = y;
|
||||
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, mTempFXY, true);
|
||||
View hotseat = mLauncher.getHotseat();
|
||||
return mTempFXY[0] >= hotseat.getLeft() &&
|
||||
mTempFXY[0] <= hotseat.getRight() &&
|
||||
mTempFXY[1] >= hotseat.getTop() &&
|
||||
mTempFXY[1] <= hotseat.getBottom();
|
||||
}
|
||||
boolean isPointInSelfOverHotseat(int x, int y) {
|
||||
mTempFXY[0] = x;
|
||||
mTempFXY[1] = y;
|
||||
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, mTempFXY, true);
|
||||
View hotseat = mLauncher.getHotseat();
|
||||
return mTempFXY[0] >= hotseat.getLeft()
|
||||
&& mTempFXY[0] <= hotseat.getRight()
|
||||
&& mTempFXY[1] >= hotseat.getTop()
|
||||
&& mTempFXY[1] <= hotseat.getBottom();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the point in {@param xy} to point to the co-ordinate space of {@param layout}
|
||||
* @param layout either hotseat of a page in workspace
|
||||
* @param xy the point location in workspace co-ordinate space
|
||||
*/
|
||||
private void mapPointFromDropLayout(CellLayout layout, float[] xy) {
|
||||
if (mLauncher.isHotseatLayout(layout)) {
|
||||
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, xy, true);
|
||||
mLauncher.getDragLayer().mapCoordInSelfToDescendant(layout, xy);
|
||||
} else {
|
||||
mapPointFromSelfToChild(layout, xy);
|
||||
}
|
||||
}
|
||||
private void mapPointFromDropLayout(CellLayout layout, float[] xy) {
|
||||
if (mLauncher.isHotseatLayout(layout)) {
|
||||
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, xy, true);
|
||||
mLauncher.getDragLayer().mapCoordInSelfToDescendant(layout, xy);
|
||||
} else {
|
||||
mapPointFromSelfToChild(layout, xy);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isDragWidget(DragObject d) {
|
||||
return (d.dragInfo instanceof LauncherAppWidgetInfo ||
|
||||
|
@ -2393,9 +2393,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
|||
spanY = mDragInfo.spanY;
|
||||
}
|
||||
|
||||
final int container = mLauncher.isHotseatLayout(cellLayout) ?
|
||||
LauncherSettings.Favorites.CONTAINER_HOTSEAT :
|
||||
LauncherSettings.Favorites.CONTAINER_DESKTOP;
|
||||
final int container = mLauncher.isHotseatLayout(cellLayout)
|
||||
? LauncherSettings.Favorites.CONTAINER_HOTSEAT
|
||||
: LauncherSettings.Favorites.CONTAINER_DESKTOP;
|
||||
final int screenId = getIdForScreen(cellLayout);
|
||||
if (!mLauncher.isHotseatLayout(cellLayout)
|
||||
&& screenId != getScreenIdForPageIndex(mCurrentPage)
|
||||
|
|
Loading…
Reference in New Issue