Merge "Minor stylistic changes in Workspace.java." into ub-launcher3-master
This commit is contained in:
commit
4c3952dc60
|
@ -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