use of com.android.systemui.recents.events.ui.dragndrop.DragStartEvent in project android_frameworks_base by ResurrectionRemix.
the class TaskView method onLongClick.
/**** View.OnLongClickListener Implementation ****/
@Override
public boolean onLongClick(View v) {
SystemServicesProxy ssp = Recents.getSystemServices();
boolean inBounds = false;
Rect clipBounds = new Rect(mViewBounds.mClipBounds);
if (!clipBounds.isEmpty()) {
// If we are clipping the view to the bounds, manually do the hit test.
clipBounds.scale(getScaleX());
inBounds = clipBounds.contains(mDownTouchPos.x, mDownTouchPos.y);
} else {
// Otherwise just make sure we're within the view's bounds.
inBounds = mDownTouchPos.x <= getWidth() && mDownTouchPos.y <= getHeight();
}
if (v == this && inBounds && !ssp.hasDockedTask()) {
// Start listening for drag events
setClipViewInStack(false);
mDownTouchPos.x += ((1f - getScaleX()) * getWidth()) / 2;
mDownTouchPos.y += ((1f - getScaleY()) * getHeight()) / 2;
EventBus.getDefault().register(this, RecentsActivity.EVENT_BUS_PRIORITY + 1);
EventBus.getDefault().send(new DragStartEvent(mTask, this, mDownTouchPos));
return true;
}
return false;
}
use of com.android.systemui.recents.events.ui.dragndrop.DragStartEvent in project android_frameworks_base by AOSPA.
the class TaskView method onLongClick.
/**** View.OnLongClickListener Implementation ****/
@Override
public boolean onLongClick(View v) {
SystemServicesProxy ssp = Recents.getSystemServices();
boolean inBounds = false;
Rect clipBounds = new Rect(mViewBounds.mClipBounds);
if (!clipBounds.isEmpty()) {
// If we are clipping the view to the bounds, manually do the hit test.
clipBounds.scale(getScaleX());
inBounds = clipBounds.contains(mDownTouchPos.x, mDownTouchPos.y);
} else {
// Otherwise just make sure we're within the view's bounds.
inBounds = mDownTouchPos.x <= getWidth() && mDownTouchPos.y <= getHeight();
}
if (v == this && inBounds && !ssp.hasDockedTask()) {
// Start listening for drag events
setClipViewInStack(false);
mDownTouchPos.x += ((1f - getScaleX()) * getWidth()) / 2;
mDownTouchPos.y += ((1f - getScaleY()) * getHeight()) / 2;
EventBus.getDefault().register(this, RecentsActivity.EVENT_BUS_PRIORITY + 1);
EventBus.getDefault().send(new DragStartEvent(mTask, this, mDownTouchPos));
return true;
}
return false;
}
use of com.android.systemui.recents.events.ui.dragndrop.DragStartEvent in project platform_frameworks_base by android.
the class TaskView method onLongClick.
/**** View.OnLongClickListener Implementation ****/
@Override
public boolean onLongClick(View v) {
SystemServicesProxy ssp = Recents.getSystemServices();
// Since we are clipping the view to the bounds, manually do the hit test
Rect clipBounds = new Rect(mViewBounds.mClipBounds);
clipBounds.scale(getScaleX());
boolean inBounds = clipBounds.contains(mDownTouchPos.x, mDownTouchPos.y);
if (v == this && inBounds && !ssp.hasDockedTask()) {
// Start listening for drag events
setClipViewInStack(false);
mDownTouchPos.x += ((1f - getScaleX()) * getWidth()) / 2;
mDownTouchPos.y += ((1f - getScaleY()) * getHeight()) / 2;
EventBus.getDefault().register(this, RecentsActivity.EVENT_BUS_PRIORITY + 1);
EventBus.getDefault().send(new DragStartEvent(mTask, this, mDownTouchPos));
return true;
}
return false;
}
use of com.android.systemui.recents.events.ui.dragndrop.DragStartEvent in project android_frameworks_base by DirtyUnicorns.
the class TaskView method onLongClick.
/**** View.OnLongClickListener Implementation ****/
@Override
public boolean onLongClick(View v) {
SystemServicesProxy ssp = Recents.getSystemServices();
boolean inBounds = false;
Rect clipBounds = new Rect(mViewBounds.mClipBounds);
if (!clipBounds.isEmpty()) {
// If we are clipping the view to the bounds, manually do the hit test.
clipBounds.scale(getScaleX());
inBounds = clipBounds.contains(mDownTouchPos.x, mDownTouchPos.y);
} else {
// Otherwise just make sure we're within the view's bounds.
inBounds = mDownTouchPos.x <= getWidth() && mDownTouchPos.y <= getHeight();
}
if (v == this && inBounds && !ssp.hasDockedTask()) {
// Start listening for drag events
setClipViewInStack(false);
mDownTouchPos.x += ((1f - getScaleX()) * getWidth()) / 2;
mDownTouchPos.y += ((1f - getScaleY()) * getHeight()) / 2;
EventBus.getDefault().register(this, RecentsActivity.EVENT_BUS_PRIORITY + 1);
EventBus.getDefault().send(new DragStartEvent(mTask, this, mDownTouchPos));
return true;
}
return false;
}
use of com.android.systemui.recents.events.ui.dragndrop.DragStartEvent in project android_frameworks_base by crdroidandroid.
the class TaskView method onLongClick.
/**** View.OnLongClickListener Implementation ****/
@Override
public boolean onLongClick(View v) {
SystemServicesProxy ssp = Recents.getSystemServices();
boolean inBounds = false;
Rect clipBounds = new Rect(mViewBounds.mClipBounds);
if (!clipBounds.isEmpty()) {
// If we are clipping the view to the bounds, manually do the hit test.
clipBounds.scale(getScaleX());
inBounds = clipBounds.contains(mDownTouchPos.x, mDownTouchPos.y);
} else {
// Otherwise just make sure we're within the view's bounds.
inBounds = mDownTouchPos.x <= getWidth() && mDownTouchPos.y <= getHeight();
}
if (v == this && inBounds && !ssp.hasDockedTask()) {
// Start listening for drag events
setClipViewInStack(false);
mDownTouchPos.x += ((1f - getScaleX()) * getWidth()) / 2;
mDownTouchPos.y += ((1f - getScaleY()) * getHeight()) / 2;
EventBus.getDefault().register(this, RecentsActivity.EVENT_BUS_PRIORITY + 1);
EventBus.getDefault().send(new DragStartEvent(mTask, this, mDownTouchPos));
return true;
}
return false;
}
Aggregations