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