feat(mobile): use drawer for gif picker
fix(mobile): some ui bugs fix(mobile): disable pinch zooming
This commit is contained in:
parent
eaf3f61ebd
commit
6e977bca7e
9 changed files with 436 additions and 259 deletions
2
apps/tauri/src-tauri/Cargo.lock
generated
2
apps/tauri/src-tauri/Cargo.lock
generated
|
|
@ -5298,7 +5298,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tensamin"
|
||||
version = "0.0.11"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"jni 0.22.4",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.app.Activity
|
|||
import android.content.pm.PackageManager
|
||||
import android.media.projection.MediaProjectionManager
|
||||
import android.os.Bundle
|
||||
import android.view.MotionEvent
|
||||
import android.view.ViewTreeObserver
|
||||
import android.view.WindowManager
|
||||
import android.webkit.JavascriptInterface
|
||||
|
|
@ -54,6 +55,32 @@ class MainActivity : TauriActivity() {
|
|||
}
|
||||
|
||||
override fun onWebViewCreate(webView: WebView) {
|
||||
webView.settings.apply {
|
||||
setSupportZoom(false)
|
||||
builtInZoomControls = false
|
||||
displayZoomControls = false
|
||||
}
|
||||
|
||||
var blockingMultiTouch = false
|
||||
webView.setOnTouchListener { _, event ->
|
||||
val shouldBlock = blockingMultiTouch || event.pointerCount > 1
|
||||
|
||||
when (event.actionMasked) {
|
||||
MotionEvent.ACTION_POINTER_DOWN -> {
|
||||
// Cancel the one-finger gesture before consuming the rest of the pinch.
|
||||
MotionEvent.obtain(event).let { cancelEvent ->
|
||||
cancelEvent.action = MotionEvent.ACTION_CANCEL
|
||||
webView.onTouchEvent(cancelEvent)
|
||||
cancelEvent.recycle()
|
||||
}
|
||||
blockingMultiTouch = true
|
||||
}
|
||||
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> blockingMultiTouch = false
|
||||
}
|
||||
|
||||
shouldBlock
|
||||
}
|
||||
|
||||
NativeAccessibilityBridge.attach(webView)
|
||||
mediaWebView = webView
|
||||
MobileMediaEvents.attach(webView)
|
||||
|
|
|
|||
Loading…
Reference in a new issue