Merge change 4402 into donut
* changes: Fixes #1899284 and #1899287. Give applications more control over the gesture's path.
This commit is contained in:
@@ -84,6 +84,7 @@ public class GestureOverlayView extends FrameLayout {
|
|||||||
|
|
||||||
private final Rect mInvalidRect = new Rect();
|
private final Rect mInvalidRect = new Rect();
|
||||||
private final Path mPath = new Path();
|
private final Path mPath = new Path();
|
||||||
|
private boolean mGestureVisible;
|
||||||
|
|
||||||
private float mX;
|
private float mX;
|
||||||
private float mY;
|
private float mY;
|
||||||
@@ -274,14 +275,6 @@ public class GestureOverlayView extends FrameLayout {
|
|||||||
return mCurrentGesture;
|
return mCurrentGesture;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getFadeOffset() {
|
|
||||||
return mFadeOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFadeOffset(long fadeOffset) {
|
|
||||||
mFadeOffset = fadeOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGesture(Gesture gesture) {
|
public void setGesture(Gesture gesture) {
|
||||||
if (mCurrentGesture != null) {
|
if (mCurrentGesture != null) {
|
||||||
clear(false);
|
clear(false);
|
||||||
@@ -304,6 +297,31 @@ public class GestureOverlayView extends FrameLayout {
|
|||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Path getGesturePath() {
|
||||||
|
return mPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Path getGesturePath(Path path) {
|
||||||
|
path.set(mPath);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isGestureVisible() {
|
||||||
|
return mGestureVisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGestureVisible(boolean visible) {
|
||||||
|
mGestureVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFadeOffset() {
|
||||||
|
return mFadeOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFadeOffset(long fadeOffset) {
|
||||||
|
mFadeOffset = fadeOffset;
|
||||||
|
}
|
||||||
|
|
||||||
public void addOnGestureListener(OnGestureListener listener) {
|
public void addOnGestureListener(OnGestureListener listener) {
|
||||||
mOnGestureListeners.add(listener);
|
mOnGestureListeners.add(listener);
|
||||||
}
|
}
|
||||||
@@ -372,7 +390,7 @@ public class GestureOverlayView extends FrameLayout {
|
|||||||
public void draw(Canvas canvas) {
|
public void draw(Canvas canvas) {
|
||||||
super.draw(canvas);
|
super.draw(canvas);
|
||||||
|
|
||||||
if (mCurrentGesture != null) {
|
if (mCurrentGesture != null && mGestureVisible) {
|
||||||
canvas.drawPath(mPath, mGesturePaint);
|
canvas.drawPath(mPath, mGesturePaint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user