INNER CODE UNIT · Kotlin

perform

burhanrashid52/PhotoEditor · app/src/androidTest/java/com/burhanrashid52/photoediting/PinchTestHelper.kt:31

            override fun perform(uiController: UiController, view: View) {
                val middlePosition = getCenterPoint(view)

                // How far from the center point each finger should start
                // (note: If you make this 0, where the two fingers are on top of one another, the view may disappear)
                val startDelta = 10

                // How far from the center point each finger should end
                // (note: Be sure to have this large enough so that the gesture is recognized)
                val endDelta = 20
                val startPoint1 = Point(middlePosition.x - startDelta, middlePosition.y)
                val startPoint2 = Point(middlePosition.x + startDelta, middlePosition.y)
                val endPoint1 = Point(middlePosition.x - endDelta, middlePosition.y)
                val endPoint2 = Point(middlePosition.x + endDelta, middlePosition.y)
                performPinch(uiController, startPoint1, startPoint2, endPoint1, endPoint2)
            }
        }
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…