package com.atmob.keyboard_android.util

import android.view.View
import com.atmob.keyboard_android.model.AiKeyboardKeyModel
import com.atmob.keyboard_android.ui.popup.guide.KeyboardGuideDialog
import com.atmob.keyboard_android.ui.popup.guide.KeyboardGuideDialog.OnActionCallback

/**
 * 键盘引导弹窗工具类
 */
class KeyboardGuideDialogUtil {
    companion object {
        /**
         * 显示权限弹窗
         */
        fun showGuideDialog(
            targetView: View,
            dataModel: AiKeyboardKeyModel,
            actionCallback: OnActionCallback
        ) {
            val keyboardService = KeyboardHolder.getKeyboardService()
            if (keyboardService == null) {
                return
            }

            val keyboardWindow = keyboardService.getKeyboardWindow()

            KeyboardGuideDialog(targetView.context, keyboardWindow)
                .bindTargetView(targetView, dataModel)
                .bindOnActionCallback(actionCallback)
                .show()
        }
    }
}