package com.atmob.keyboard_android.util

import android.annotation.SuppressLint
import com.atmob.keyboard_android.keyboard.ICustomKeyboardService

@SuppressLint("StaticFieldLeak")
object KeyboardHolder {
    /**
     * 软键盘Service
     */
    private var mCustomKeyboardService: ICustomKeyboardService? = null

    /**
     * 保存软键盘Service实例
     */
    fun attachKeyboardService(service: ICustomKeyboardService) {
        this.mCustomKeyboardService = service
    }

    /**
     * 获取软键盘的Window
     */
    fun getKeyboardService(): ICustomKeyboardService? {
        return this.mCustomKeyboardService
    }

    /**
     * 移除软键盘的Service实例
     */
    fun detachKeyboardService() {
        this.mCustomKeyboardService = null
    }
}