@@ -107,7 +107,13 @@ class EditorViewModel(application: Application) : AndroidViewModel(application)
107107 override fun onJoin (editor : Editor , tool : PointerTool ? , gestureStrokeId : String , before : NativeObjectHandle <ContentSelection >, after : NativeObjectHandle <ContentSelection >): GestureAction = GestureAction .APPLY_GESTURE
108108 override fun onInsert (editor : Editor , tool : PointerTool ? , gestureStrokeId : String , before : NativeObjectHandle <ContentSelection >, after : NativeObjectHandle <ContentSelection >): GestureAction = GestureAction .APPLY_GESTURE
109109 override fun onStrikethrough (editor : Editor , tool : PointerTool ? , gestureStrokeId : String , selection : NativeObjectHandle <ContentSelection >): GestureAction = GestureAction .APPLY_GESTURE
110- override fun onScratch (editor : Editor , tool : PointerTool ? , gestureStrokeId : String , selection : NativeObjectHandle <ContentSelection >): GestureAction = GestureAction .APPLY_GESTURE
110+ override fun onScratch (editor : Editor , tool : PointerTool ? , gestureStrokeId : String , selection : NativeObjectHandle <ContentSelection >): GestureAction {
111+ return if (isWriting.value == true ) {
112+ GestureAction .IGNORE
113+ } else {
114+ GestureAction .APPLY_GESTURE
115+ }
116+ }
111117 }
112118
113119 private var contentPackage: ContentPackage ? = null
@@ -242,7 +248,6 @@ class EditorViewModel(application: Application) : AndroidViewModel(application)
242248 setSelectionMode(false )
243249
244250 withContext(Dispatchers .Main ) {
245- editor.configuration.setBoolean(" gesture.enable" , false )
246251 _isWriting .value = true
247252 }
248253
@@ -282,7 +287,6 @@ class EditorViewModel(application: Application) : AndroidViewModel(application)
282287
283288 withContext(Dispatchers .Main ) {
284289 _isWriting .value = false
285- editor.configuration.setBoolean(" gesture.enable" , true )
286290 }
287291 }
288292 }
0 commit comments