Migrated media/zoomControllers package to kotlin (#6204)

* Rename .java to .kt

* Migrated media/zoomControllers package to kotlin

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
Saifuddin Adenwala 2025-03-08 19:17:23 +05:30 committed by GitHub
parent 972bf785f1
commit 30322707fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1959 additions and 2130 deletions

View file

@ -107,43 +107,43 @@ class MultiPointerGestureDetectorUnitTest {
@Test
@Throws(Exception::class)
fun testIsGestureInProgress() {
Assert.assertEquals(detector.isGestureInProgress, false)
Assert.assertEquals(detector.isGestureInProgress(), false)
}
@Test
@Throws(Exception::class)
fun testGetNewPointerCount() {
Assert.assertEquals(detector.newPointerCount, 0)
Assert.assertEquals(detector.getNewPointerCount(), 0)
}
@Test
@Throws(Exception::class)
fun testGetPointerCount() {
Assert.assertEquals(detector.pointerCount, 0)
Assert.assertEquals(detector.getPointerCount(), 0)
}
@Test
@Throws(Exception::class)
fun testGetStartX() {
Assert.assertEquals(detector.startX[0], 0.0f)
Assert.assertEquals(detector.getStartX()[0], 0.0f)
}
@Test
@Throws(Exception::class)
fun testGetStartY() {
Assert.assertEquals(detector.startY[0], 0.0f)
Assert.assertEquals(detector.getStartY()[0], 0.0f)
}
@Test
@Throws(Exception::class)
fun testGetCurrentX() {
Assert.assertEquals(detector.currentX[0], 0.0f)
Assert.assertEquals(detector.getCurrentX()[0], 0.0f)
}
@Test
@Throws(Exception::class)
fun testGetCurrentY() {
Assert.assertEquals(detector.currentY[0], 0.0f)
Assert.assertEquals(detector.getCurrentY()[0], 0.0f)
}
@Test

View file

@ -84,51 +84,51 @@ class TransformGestureDetectorUnitTest {
@Test
@Throws(Exception::class)
fun testIsGestureInProgress() {
Assert.assertEquals(detector.isGestureInProgress, false)
Assert.assertEquals(detector.isGestureInProgress(), false)
}
@Test
@Throws(Exception::class)
fun testGetNewPointerCount() {
Assert.assertEquals(detector.newPointerCount, 0)
Assert.assertEquals(detector.getNewPointerCount(), 0)
}
@Test
@Throws(Exception::class)
fun testGetPointerCount() {
Assert.assertEquals(detector.pointerCount, 0)
Assert.assertEquals(detector.getPointerCount(), 0)
}
@Test
@Throws(Exception::class)
fun testGetPivotX() {
Assert.assertEquals(detector.pivotX, 0.0f)
Assert.assertEquals(detector.getPivotX(), 0.0f)
}
@Test
@Throws(Exception::class)
fun testGetPivotY() {
Assert.assertEquals(detector.pivotY, 0.0f)
Assert.assertEquals(detector.getPivotY(), 0.0f)
}
@Test
@Throws(Exception::class)
fun testGetTranslationX() {
Assert.assertEquals(detector.translationX, 0.0f)
Assert.assertEquals(detector.getTranslationX(), 0.0f)
}
@Test
@Throws(Exception::class)
fun testGetTranslationY() {
Assert.assertEquals(detector.translationY, 0.0f)
Assert.assertEquals(detector.getTranslationY(), 0.0f)
}
@Test
@Throws(Exception::class)
fun testGetScaleCaseLessThan2() {
Whitebox.setInternalState(detector, "mDetector", mDetector)
whenever(mDetector.pointerCount).thenReturn(1)
Assert.assertEquals(detector.scale, 1f)
whenever(mDetector.getPointerCount()).thenReturn(1)
Assert.assertEquals(detector.getScale(), 1f)
}
@Test
@ -138,20 +138,20 @@ class TransformGestureDetectorUnitTest {
array[0] = 0.0f
array[1] = 1.0f
Whitebox.setInternalState(detector, "mDetector", mDetector)
whenever(mDetector.pointerCount).thenReturn(2)
whenever(mDetector.startX).thenReturn(array)
whenever(mDetector.startY).thenReturn(array)
whenever(mDetector.currentX).thenReturn(array)
whenever(mDetector.currentY).thenReturn(array)
Assert.assertEquals(detector.scale, 1f)
whenever(mDetector.getPointerCount()).thenReturn(2)
whenever(mDetector.getStartX()).thenReturn(array)
whenever(mDetector.getStartY()).thenReturn(array)
whenever(mDetector.getCurrentX()).thenReturn(array)
whenever(mDetector.getCurrentY()).thenReturn(array)
Assert.assertEquals(detector.getScale(), 1f)
}
@Test
@Throws(Exception::class)
fun testGetRotationCaseLessThan2() {
Whitebox.setInternalState(detector, "mDetector", mDetector)
whenever(mDetector.pointerCount).thenReturn(1)
Assert.assertEquals(detector.rotation, 0f)
whenever(mDetector.getPointerCount()).thenReturn(1)
Assert.assertEquals(detector.getRotation(), 0f)
}
@Test
@ -161,12 +161,12 @@ class TransformGestureDetectorUnitTest {
array[0] = 0.0f
array[1] = 1.0f
Whitebox.setInternalState(detector, "mDetector", mDetector)
whenever(mDetector.pointerCount).thenReturn(2)
whenever(mDetector.startX).thenReturn(array)
whenever(mDetector.startY).thenReturn(array)
whenever(mDetector.currentX).thenReturn(array)
whenever(mDetector.currentY).thenReturn(array)
Assert.assertEquals(detector.rotation, 0f)
whenever(mDetector.getPointerCount()).thenReturn(2)
whenever(mDetector.getStartX()).thenReturn(array)
whenever(mDetector.getStartY()).thenReturn(array)
whenever(mDetector.getCurrentX()).thenReturn(array)
whenever(mDetector.getCurrentY()).thenReturn(array)
Assert.assertEquals(detector.getRotation(), 0f)
}
@Test