package com.hongyegroup.cpt_newsfeed.widget.expand

import android.text.style.ClickableSpan
import android.view.View
import com.guadou.cs_cptservices.ui.GlobalWebActivity
import com.guadou.lib_baselib.utils.log.YYLogUtils


class InterceptUrlSpan(private val url: String) : ClickableSpan() {

    var _viewClickFlag = false
    val _clickRunnable = Runnable { _viewClickFlag = false }

    override fun onClick(widget: View) {

        if (!_viewClickFlag) {
            _viewClickFlag = true
            YYLogUtils.w("自定义的点击$url")
            GlobalWebActivity.startInstance("", url)
        }
        widget.removeCallbacks(_clickRunnable)
        widget.postDelayed(_clickRunnable, 350)

    }
}