mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
First pass of the Launcher Overlay interface / impl
-> Added simple reference launcher extension -> Make launcher able to handle a null qsb Change-Id: Ib1575243cac800a335e95bbf00cdc394bb4741c3
This commit is contained in:
@@ -89,6 +89,8 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||
private Drawable mLeftHoverDrawableActive;
|
||||
private Drawable mRightHoverDrawableActive;
|
||||
|
||||
private boolean mBlockTouches = false;
|
||||
|
||||
/**
|
||||
* Used to create a new DragLayer from XML.
|
||||
*
|
||||
@@ -185,11 +187,19 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setBlockTouch(boolean block) {
|
||||
mBlockTouches = block;
|
||||
}
|
||||
|
||||
private boolean handleTouchDown(MotionEvent ev, boolean intercept) {
|
||||
Rect hitRect = new Rect();
|
||||
int x = (int) ev.getX();
|
||||
int y = (int) ev.getY();
|
||||
|
||||
if (mBlockTouches) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (AppWidgetResizeFrame child: mResizeFrames) {
|
||||
child.getHitRect(hitRect);
|
||||
if (hitRect.contains(x, y)) {
|
||||
@@ -332,6 +342,10 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
|
||||
int x = (int) ev.getX();
|
||||
int y = (int) ev.getY();
|
||||
|
||||
if (mBlockTouches) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (action == MotionEvent.ACTION_DOWN) {
|
||||
if (handleTouchDown(ev, false)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user