package com.atmob.keyboard_android.ext

import android.app.Dialog
import android.view.Window
import android.view.WindowManager

/**
 * 设置Service的WindowToken给Dialog
 */
fun Dialog.setServiceWindowToken(hostWindow: Window) {
    this.window?.setType(WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG)
    this.window?.attributes?.token = hostWindow.attributes.token
}