summaryrefslogtreecommitdiff
path: root/core/java/android/window/BackEvent.java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-04-16 01:51:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-04-16 01:51:10 +0000
commite16244c3cdab1380a88993136bf1d81ff0a7b72a (patch)
treeb172448126b0133cd241a2b79faa9b0ddfacd246 /core/java/android/window/BackEvent.java
parent022f4485d6f3124380a11bd60670b57f70aa8430 (diff)
parent316179540ee24582351f21078275bb6f2bebde1a (diff)
Merge "Make BackEvent#getTouchX and BackEvent#getTouchY floats." into tm-dev
Diffstat (limited to 'core/java/android/window/BackEvent.java')
-rw-r--r--core/java/android/window/BackEvent.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/core/java/android/window/BackEvent.java b/core/java/android/window/BackEvent.java
index 14985c987f97..1024e2e50c3e 100644
--- a/core/java/android/window/BackEvent.java
+++ b/core/java/android/window/BackEvent.java
@@ -46,8 +46,8 @@ public class BackEvent implements Parcelable {
@Retention(RetentionPolicy.SOURCE)
public @interface SwipeEdge{}
- private final int mTouchX;
- private final int mTouchY;
+ private final float mTouchX;
+ private final float mTouchY;
private final float mProgress;
@SwipeEdge
@@ -58,14 +58,14 @@ public class BackEvent implements Parcelable {
/**
* Creates a new {@link BackEvent} instance.
*
- * @param touchX Absolute X location of the touch point.
- * @param touchY Absolute Y location of the touch point.
+ * @param touchX Absolute X location of the touch point of this event.
+ * @param touchY Absolute Y location of the touch point of this event.
* @param progress Value between 0 and 1 on how far along the back gesture is.
* @param swipeEdge Indicates which edge the swipe starts from.
* @param departingAnimationTarget The remote animation target of the departing application
* window.
*/
- public BackEvent(int touchX, int touchY, float progress, @SwipeEdge int swipeEdge,
+ public BackEvent(float touchX, float touchY, float progress, @SwipeEdge int swipeEdge,
@Nullable RemoteAnimationTarget departingAnimationTarget) {
mTouchX = touchX;
mTouchY = touchY;
@@ -75,8 +75,8 @@ public class BackEvent implements Parcelable {
}
private BackEvent(@NonNull Parcel in) {
- mTouchX = in.readInt();
- mTouchY = in.readInt();
+ mTouchX = in.readFloat();
+ mTouchY = in.readFloat();
mProgress = in.readFloat();
mSwipeEdge = in.readInt();
mDepartingAnimationTarget = in.readTypedObject(RemoteAnimationTarget.CREATOR);
@@ -101,8 +101,8 @@ public class BackEvent implements Parcelable {
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeInt(mTouchX);
- dest.writeInt(mTouchY);
+ dest.writeFloat(mTouchX);
+ dest.writeFloat(mTouchY);
dest.writeFloat(mProgress);
dest.writeInt(mSwipeEdge);
dest.writeTypedObject(mDepartingAnimationTarget, flags);
@@ -118,14 +118,14 @@ public class BackEvent implements Parcelable {
/**
* Returns the absolute X location of the touch point.
*/
- public int getTouchX() {
+ public float getTouchX() {
return mTouchX;
}
/**
* Returns the absolute Y location of the touch point.
*/
- public int getTouchY() {
+ public float getTouchY() {
return mTouchY;
}