Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinch gesture on Android #802

Open
hbrtose opened this issue Sep 12, 2023 · 3 comments
Open

Pinch gesture on Android #802

hbrtose opened this issue Sep 12, 2023 · 3 comments

Comments

@hbrtose
Copy link

hbrtose commented Sep 12, 2023

I am trying to implement pinch zoom in a KMM app, and while it works well on iOS, there are issues on Android. As you can see on the screenshot, MotionEvent has 2 points, but event.x and event.y value that's passed down to onGestureEvent are just the first point, instead of an average of both.

image

Also when pinching on Android I noticed I receive both Pinch and Pan events, whereas on iOS I only get Pinch events.

@hbrtose
Copy link
Author

hbrtose commented Sep 26, 2023

Here's an example with Clocks demo edited to show the point where pinching is considered to happen and informing when panning is happening (even during a pinch)
https://github.com/hbrtose/skiko/blob/master/samples/SkiaAndroidSample/src/main/java/org/jetbrains/skiko/sample/Clocks.kt
Also, even with coroutines, kotlin and gradle plugin bumped to the newest versions, the app crashes on startup with any version of skiko above 0.7.77

 Failed to measure fs-verity, errno 1: /data/app/~~hV8Iwq5JcCjo_yTasxGG_A==/org.jetbrains.skiko.sample-2Bg_qermzNj0EQXJvojaQw==/base.apk
searching for layers in '/data/app/~~hV8Iwq5JcCjo_yTasxGG_A==/org.jetbrains.skiko.sample-2Bg_qermzNj0EQXJvojaQw==/lib/arm64'
searching for layers in '/data/app/~~hV8Iwq5JcCjo_yTasxGG_A==/org.jetbrains.skiko.sample-2Bg_qermzNj0EQXJvojaQw==/base.apk!/lib/arm64-v8a'
checking cmar_predictor for org.jetbrains.skiko.sample
Invalid ID 0x00000000.
Shutting down VM
FATAL EXCEPTION: main
Process: org.jetbrains.skiko.sample, PID: 1242
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN4sksg4NodeD2Ev" referenced by "/data/app/~~hV8Iwq5JcCjo_yTasxGG_A==/org.jetbrains.skiko.sample-2Bg_qermzNj0EQXJvojaQw==/base.apk!/lib/arm64-v8a/libskiko-android-arm64.so"...
                                                                                                    	at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
                                                                                                    	at java.lang.Runtime.loadLibrary0(Runtime.java:998)
                                                                                                    	at java.lang.System.loadLibrary(System.java:1661)
                                                                                                    	at org.jetbrains.skiko.Library.findAndLoad(Library.kt:78)
                                                                                                    	at org.jetbrains.skiko.Library.load(Library.kt:59)
                                                                                                    	at org.jetbrains.skia.impl.Library$Companion.staticLoad(Library.jvm.kt:12)
                                                                                                    	at org.jetbrains.skia.paragraph.FontCollection.<clinit>(FontCollection.kt:11)
                                                                                                    	at org.jetbrains.skiko.sample.Clocks.<init>(Clocks.kt:25)
                                                                                                    	at org.jetbrains.skiko.sample.MainActivity.onCreate(MainActivity.kt:27)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8054)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8034)
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1341)
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3688)
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3864)
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2253)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                    	at android.os.Looper.loop(Looper.java:288)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7870)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

@sgopi93
Copy link

sgopi93 commented Feb 21, 2024

Hi, Any update onthis.

@dima-avdeev-jb
Copy link
Contributor

dima-avdeev-jb commented Feb 21, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants