Pārlūkot izejas kodu

[feat]键盘引导页,键盘引导弹窗,调整延迟时间

hezihao 7 mēneši atpakaļ
vecāks
revīzija
caa5f847dd

+ 1 - 1
plugins/keyboard_android/android/src/main/kotlin/com/atmob/keyboard_android/component/child/impl/AiKeyboardCommonPanelComponent.kt

@@ -364,7 +364,7 @@ class AiKeyboardCommonPanelComponent @JvmOverloads constructor(
                 mKeyboardGuideShowing = true
             }
         }
-        mKeyboardGuideHandler.postDelayed(action, 350)
+        mKeyboardGuideHandler.postDelayed(action, 300)
     }
 
     /**

+ 11 - 0
plugins/keyboard_android/android/src/main/kotlin/com/atmob/keyboard_android/ui/popup/base/BasePopupDialog.kt

@@ -40,6 +40,11 @@ abstract class BasePopupDialog(context: Context, private val hostWindow: Window)
             isOutsideTouchable = isCanOutsideTouchable()
             // 设置背景,否则还是会关闭
             setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
+            setOnDismissListener(object : PopupWindow.OnDismissListener {
+                override fun onDismiss() {
+                    onDialogDismiss()
+                }
+            })
         }
 
         onInflaterViewAfter(contentView)
@@ -103,6 +108,12 @@ abstract class BasePopupDialog(context: Context, private val hostWindow: Window)
     }
 
     /**
+     * 键盘关闭时回调
+     */
+    protected open fun onDialogDismiss() {
+    }
+
+    /**
      * 是否正在显示
      */
     fun isShowing(): Boolean {

+ 5 - 0
plugins/keyboard_android/android/src/main/kotlin/com/atmob/keyboard_android/ui/popup/guide/KeyboardGuideDialog.kt

@@ -53,6 +53,11 @@ class KeyboardGuideDialog(context: Context, hostWindow: Window) :
         render()
     }
 
+    override fun isCanOutsideTouchable(): Boolean {
+        // 禁止点击外部区域关闭弹窗,自定义点击事件来实现关闭
+        return false
+    }
+
     override fun onSetupDialogFrameSize(
         context: Context,
         windowWidth: Int,