package com.atmob.keyboard_android.util

import android.os.Handler
import android.os.Looper

/**
 * 延迟工具类
 */
class DelayUtil private constructor() {
    companion object {
        private val mMainHandler = Handler(Looper.getMainLooper())

        /**
         *
         */
        fun post(action: () -> Unit) {
            mMainHandler.post(action)
        }

        /**
         * 延迟指定毫秒后执行
         */
        fun postDelay(action: () -> Unit, delayMillis: Long) {
            mMainHandler.postDelayed(action, delayMillis)
        }
    }
}