[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Upgrade to Fresco v0.13.0
jenkins-bot has submitted this change and it was merged. Change subject: Upgrade to Fresco v0.13.0 .. Upgrade to Fresco v0.13.0 Also replace demo code copies per release notes[0,1,2]. From 6efeb95: [3]: MultiPointerGestureDetector, TransformGestureDetector [4]: DefaultZoomableController, ZoomableController, ZoomableDraweeView The javax.annotation.Nullable import was changed to the Support library and Checkstyle config updated to ignore these files. [0] https://github.com/facebook/fresco/releases/tag/v0.11.0 [1] https://github.com/facebook/fresco/releases/tag/v0.12.0 [2] https://github.com/facebook/fresco/releases/tag/v0.13.0 [3] https://github.com/facebook/fresco/tree/master/samples/gestures/src/main/java/com/facebook/samples/gestures [4] https://github.com/facebook/fresco/tree/master/samples/zoomable/src/main/java/com/facebook/samples/zoomable Change-Id: I64be6993cb1ec4acb6509daf3a1d8a7373b28431 --- M app/build.gradle M app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java M app/src/main/java/com/facebook/samples/gestures/TransformGestureDetector.java A app/src/main/java/com/facebook/samples/zoomable/AbstractAnimatedZoomableController.java A app/src/main/java/com/facebook/samples/zoomable/AnimatedZoomableController.java M app/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java A app/src/main/java/com/facebook/samples/zoomable/GestureListenerWrapper.java M app/src/main/java/com/facebook/samples/zoomable/ZoomableController.java M app/src/main/java/com/facebook/samples/zoomable/ZoomableDraweeView.java M app/src/main/java/org/wikipedia/views/FaceAndColorDetectImageView.java M gradle/src/checkstyle.gradle 11 files changed, 1,130 insertions(+), 415 deletions(-) Approvals: Dbrant: Looks good to me, approved jenkins-bot: Verified diff --git a/app/build.gradle b/app/build.gradle index b7445c1..e2ac521 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -170,7 +170,7 @@ String supportVersion = '24.1.1' String espressoVersion = '2.2.2' String butterKnifeVersion = '8.4.0' -String frescoVersion = '0.10.0' +String frescoVersion = '0.13.0' String testingSupportVersion = '0.5' String mockitoCore = 'org.mockito:mockito-core:1.9.5' diff --git a/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java b/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java index 5ed4874..97594ee 100644 --- a/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java +++ b/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java @@ -25,25 +25,26 @@ /** The listener for receiving notifications when gestures occur. */ public interface Listener { -/** Responds to the beginning of a gesture. */ -void onGestureBegin(MultiPointerGestureDetector detector); +/** A callback called right before the gesture is about to start. */ +public void onGestureBegin(MultiPointerGestureDetector detector); -/** Responds to the update of a gesture in progress. */ -void onGestureUpdate(MultiPointerGestureDetector detector); +/** A callback called each time the gesture gets updated. */ +public void onGestureUpdate(MultiPointerGestureDetector detector); -/** Responds to the end of a gesture. */ -void onGestureEnd(MultiPointerGestureDetector detector); +/** A callback called right after the gesture has finished. */ +public void onGestureEnd(MultiPointerGestureDetector detector); } private static final int MAX_POINTERS = 2; private boolean mGestureInProgress; - private int mCount; - private final int[] mId = new int[MAX_POINTERS]; - private final float[] mStartX = new float[MAX_POINTERS]; - private final float[] mStartY = new float[MAX_POINTERS]; - private final float[] mCurrentX = new float[MAX_POINTERS]; - private final float[] mCurrentY = new float[MAX_POINTERS]; + private int mPointerCount; + private int mNewPointerCount; + private final int mId[] = new int[MAX_POINTERS]; + private final float mStartX[] = new float[MAX_POINTERS]; + private final float mStartY[] = new float[MAX_POINTERS]; + private final float mCurrentX[] = new float[MAX_POINTERS]; + private final float mCurrentY[] = new float[MAX_POINTERS]; private Listener mListener = null; @@ -69,7 +70,7 @@ */ public void reset() { mGestureInProgress = false; -mCount = 0; +mPointerCount = 0; for (int i = 0; i < MAX_POINTERS; i++) { mId[i] = MotionEvent.INVALID_POINTER_ID; } @@ -83,15 +84,21 @@ return true; } + /** + * Starts a new gesture and calls the listener just before starting it. + */ private void startGesture() { if (!mGestureInProgress) { - mGestureInProgress = true; if (mListener != null) { mListener.onGestureBegin(this); } +
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Upgrade to Fresco v0.13.0
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/311152 Change subject: Upgrade to Fresco v0.13.0 .. Upgrade to Fresco v0.13.0 Also replace demo code copies per release notes[0,1,2]. From 6efeb95: [3]: MultiPointerGestureDetector, TransformGestureDetector [4]: DefaultZoomableController, ZoomableController, ZoomableDraweeView The javax.annotation.Nullable import was changed to the Support library and Checkstyle config updated to ignore these files. [0] https://github.com/facebook/fresco/releases/tag/v0.11.0 [1] https://github.com/facebook/fresco/releases/tag/v0.12.0 [2] https://github.com/facebook/fresco/releases/tag/v0.13.0 [3] https://github.com/facebook/fresco/tree/master/samples/gestures/src/main/java/com/facebook/samples/gestures [4] https://github.com/facebook/fresco/tree/master/samples/zoomable/src/main/java/com/facebook/samples/zoomable Change-Id: I64be6993cb1ec4acb6509daf3a1d8a7373b28431 --- M app/build.gradle M app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java M app/src/main/java/com/facebook/samples/gestures/TransformGestureDetector.java A app/src/main/java/com/facebook/samples/zoomable/AbstractAnimatedZoomableController.java A app/src/main/java/com/facebook/samples/zoomable/AnimatedZoomableController.java M app/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java A app/src/main/java/com/facebook/samples/zoomable/GestureListenerWrapper.java M app/src/main/java/com/facebook/samples/zoomable/ZoomableController.java M app/src/main/java/com/facebook/samples/zoomable/ZoomableDraweeView.java M app/src/main/java/org/wikipedia/views/FaceAndColorDetectImageView.java M gradle/src/checkstyle.gradle 11 files changed, 1,130 insertions(+), 415 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/52/311152/1 diff --git a/app/build.gradle b/app/build.gradle index b7445c1..e2ac521 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -170,7 +170,7 @@ String supportVersion = '24.1.1' String espressoVersion = '2.2.2' String butterKnifeVersion = '8.4.0' -String frescoVersion = '0.10.0' +String frescoVersion = '0.13.0' String testingSupportVersion = '0.5' String mockitoCore = 'org.mockito:mockito-core:1.9.5' diff --git a/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java b/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java index 5ed4874..97594ee 100644 --- a/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java +++ b/app/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java @@ -25,25 +25,26 @@ /** The listener for receiving notifications when gestures occur. */ public interface Listener { -/** Responds to the beginning of a gesture. */ -void onGestureBegin(MultiPointerGestureDetector detector); +/** A callback called right before the gesture is about to start. */ +public void onGestureBegin(MultiPointerGestureDetector detector); -/** Responds to the update of a gesture in progress. */ -void onGestureUpdate(MultiPointerGestureDetector detector); +/** A callback called each time the gesture gets updated. */ +public void onGestureUpdate(MultiPointerGestureDetector detector); -/** Responds to the end of a gesture. */ -void onGestureEnd(MultiPointerGestureDetector detector); +/** A callback called right after the gesture has finished. */ +public void onGestureEnd(MultiPointerGestureDetector detector); } private static final int MAX_POINTERS = 2; private boolean mGestureInProgress; - private int mCount; - private final int[] mId = new int[MAX_POINTERS]; - private final float[] mStartX = new float[MAX_POINTERS]; - private final float[] mStartY = new float[MAX_POINTERS]; - private final float[] mCurrentX = new float[MAX_POINTERS]; - private final float[] mCurrentY = new float[MAX_POINTERS]; + private int mPointerCount; + private int mNewPointerCount; + private final int mId[] = new int[MAX_POINTERS]; + private final float mStartX[] = new float[MAX_POINTERS]; + private final float mStartY[] = new float[MAX_POINTERS]; + private final float mCurrentX[] = new float[MAX_POINTERS]; + private final float mCurrentY[] = new float[MAX_POINTERS]; private Listener mListener = null; @@ -69,7 +70,7 @@ */ public void reset() { mGestureInProgress = false; -mCount = 0; +mPointerCount = 0; for (int i = 0; i < MAX_POINTERS; i++) { mId[i] = MotionEvent.INVALID_POINTER_ID; } @@ -83,15 +84,21 @@ return true; } + /** + * Starts a new gesture and calls the listener just before starting it. + */ private void startGesture() { if (!mGestureInProgress) { - mGestureInProgress = true; if (mListener != null) {