[Android Apps and Games] Mohammad_Adib:
Yo Mark,

Check it out! For positioning the swipe detector on sidebar, I'm working on this:

Here are some cool methods, I actually didn't use OnTouchHandleResize for the little tabs :D

public boolean onTouchHandleMoveTop(int id, Window window, View view, MotionEvent event) {
StandOutLayoutParams params = window.getLayoutParams();

// how much you have to move in either direction in order for the
// gesture to be a move and not tap

int totalDeltaX = window.touchInfo.lastX - window.touchInfo.firstX;
int totalDeltaY = window.touchInfo.lastY - window.touchInfo.firstY;

switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
window.touchInfo.lastX = (int) event.getRawX();
window.touchInfo.lastY = (int) event.getRawY();

window.touchInfo.firstX = window.touchInfo.lastX;
window.touchInfo.firstY = window.touchInfo.lastY;
break;
case MotionEvent.ACTION_MOVE:
int deltaX = (int) event.getRawX() - window.touchInfo.lastX;
int deltaY = (int) event.getRawY() - window.touchInfo.lastY;

window.touchInfo.lastX = (int) event.getRawX();
window.touchInfo.lastY = (int) event.getRawY();

if (window.touchInfo.moving || Math.abs(totalDeltaX) >= params.threshold || Math.abs(totalDeltaY) >= params.threshold) {
window.touchInfo.moving = true;

// if window is moveable
if (Utils.isSet(window.flags, StandOutFlags.FLAG_BODY_MOVE_ENABLE)) {

// update the position of the window
if (event.getPointerCount() == 1) {
// params.x += deltaX;
params.y += deltaY;
params.y = Math.max(0, params.y);
if (!(params.y == 0 && deltaY < 0))
params.height -= deltaY;
params.height = Math.max(100, params.height);
}

window.edit().setPosition(params.x, params.y).commit();
}
}
break;
case MotionEvent.ACTION_UP:
window.touchInfo.moving = false;
save(window);
break;
}

onMove(id, window, view, event);

return true;
}

public boolean onTouchHandleMoveBottom(int id, Window window, View view, MotionEvent event) {
StandOutLayoutParams params = window.getLayoutParams();

// how much you have to move in either direction in order for the
// gesture to be a move and not tap

int totalDeltaX = window.touchInfo.lastX - window.touchInfo.firstX;
int totalDeltaY = window.touchInfo.lastY - window.touchInfo.firstY;

switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
window.touchInfo.lastX = (int) event.getRawX();
window.touchInfo.lastY = (int) event.getRawY();

window.touchInfo.firstX = window.touchInfo.lastX;
window.touchInfo.firstY = window.touchInfo.lastY;
break;
case MotionEvent.ACTION_MOVE:
int deltaX = (int) event.getRawX() - window.touchInfo.lastX;
int deltaY = (int) event.getRawY() - window.touchInfo.lastY;

window.touchInfo.lastX = (int) event.getRawX();
window.touchInfo.lastY = (int) event.getRawY();

if (window.touchInfo.moving || Math.abs(totalDeltaX) >= params.threshold || Math.abs(totalDeltaY) >= params.threshold) {
window.touchInfo.moving = true;

// if window is moveable
if (Utils.isSet(window.flags, StandOutFlags.FLAG_BODY_MOVE_ENABLE)) {

// update the position of the window
if (event.getPointerCount() == 1) {
// params.x += deltaX;
params.height += deltaY;
params.height = Math.max(100, params.height);
}

window.edit().setPosition(params.x, params.y).commit();
}
}
break;
case MotionEvent.ACTION_UP:
window.touchInfo.moving = false;
save(window);
break;
}

onMove(id, window, view, event);

return true;
}

GG