@Test public void testSweepAngleAntiClockwise() { assertEquals(360, mArcSwipeUnderTest.getSweepAngle(0, 0, false), 0.0f); assertEquals(0, mArcSwipeUnderTest.getSweepAngle(0, 360, false), 0.0f); assertEquals(270, mArcSwipeUnderTest.getSweepAngle(0, 90, false), 0.0f); assertEquals(270, mArcSwipeUnderTest.getSweepAngle(90, 180, false), 0.0f); assertEquals(135, mArcSwipeUnderTest.getSweepAngle(45, 270, false), 0.0f); assertEquals(90, mArcSwipeUnderTest.getSweepAngle(90, 0, false), 0.0f); assertEquals(190, mArcSwipeUnderTest.getSweepAngle(280, 90, false), 0.0f); }
@VisibleForTesting float getSweepAngle(float startAngle, float endAngle, boolean isClockwise) { float sweepAngle = endAngle - startAngle; if (sweepAngle < 0) { sweepAngle += 360; } return isClockwise ? sweepAngle : (360 - sweepAngle); }
ArcSwipe implements Swiper { @VisibleForTesting float getSweepAngle(float startAngle, float endAngle, boolean isClockwise) { float sweepAngle = endAngle - startAngle; if (sweepAngle < 0) { sweepAngle += 360; } return isClockwise ? sweepAngle : (360 - sweepAngle); } }
ArcSwipe implements Swiper { @VisibleForTesting float getSweepAngle(float startAngle, float endAngle, boolean isClockwise) { float sweepAngle = endAngle - startAngle; if (sweepAngle < 0) { sweepAngle += 360; } return isClockwise ? sweepAngle : (360 - sweepAngle); } ArcSwipe(Gesture gesture, RectF bounds); }
ArcSwipe implements Swiper { @VisibleForTesting float getSweepAngle(float startAngle, float endAngle, boolean isClockwise) { float sweepAngle = endAngle - startAngle; if (sweepAngle < 0) { sweepAngle += 360; } return isClockwise ? sweepAngle : (360 - sweepAngle); } ArcSwipe(Gesture gesture, RectF bounds); @Override Swiper.Status sendSwipe(
            UiController uiController,
            float[] startCoordinates,
            float[] endCoordinates,
            float[] precision); }
ArcSwipe implements Swiper { @VisibleForTesting float getSweepAngle(float startAngle, float endAngle, boolean isClockwise) { float sweepAngle = endAngle - startAngle; if (sweepAngle < 0) { sweepAngle += 360; } return isClockwise ? sweepAngle : (360 - sweepAngle); } ArcSwipe(Gesture gesture, RectF bounds); @Override Swiper.Status sendSwipe(
            UiController uiController,
            float[] startCoordinates,
            float[] endCoordinates,
            float[] precision);  }