Fix naming
This commit is contained in:
parent
a6107e2e7a
commit
d83ab89739
|
|
@ -10,7 +10,7 @@ object ActionThrottler {
|
|||
private const val PREVENTION_OF_CLICK_AGAIN_COEFFICIENT = 2
|
||||
private const val DELAY_MS = PREVENTION_OF_CLICK_AGAIN_COEFFICIENT * RIPPLE_EFFECT_DELAY_MS
|
||||
|
||||
const val DEFAULT_THROTTLE_DELAY = 500L
|
||||
const val DEFAULT_THROTTLE_DELAY_MS = 500L
|
||||
private var lastActionTime = 0L
|
||||
|
||||
fun throttleAction(throttleDelay: Long = DELAY_MS, action: () -> Unit): Boolean {
|
||||
|
|
|
|||
|
|
@ -8,13 +8,10 @@ import android.text.style.URLSpan
|
|||
import android.text.util.Linkify
|
||||
import android.view.View
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.core.os.HandlerCompat.postDelayed
|
||||
import androidx.core.text.HtmlCompat
|
||||
import ru.touchin.extensions.RIPPLE_EFFECT_DELAY_MS
|
||||
import ru.touchin.extensions.indexesOf
|
||||
import ru.touchin.extensions.setOnRippleClickListener
|
||||
import ru.touchin.utils.ActionThrottler
|
||||
import ru.touchin.utils.ActionThrottler.DEFAULT_THROTTLE_DELAY
|
||||
import ru.touchin.utils.ActionThrottler.DEFAULT_THROTTLE_DELAY_MS
|
||||
|
||||
/**
|
||||
* Convert text with 'href' tags and raw links to spanned text with clickable URLSpan.
|
||||
|
|
@ -71,7 +68,7 @@ fun CharSequence.toClickableSubstringText(
|
|||
indexesOf(substring)?.let { (startSpan, endSpan) ->
|
||||
setSpan(object : ClickableSpan() {
|
||||
override fun onClick(widget: View) {
|
||||
ActionThrottler.throttleAction(DEFAULT_THROTTLE_DELAY) {
|
||||
ActionThrottler.throttleAction(DEFAULT_THROTTLE_DELAY_MS) {
|
||||
clickAction.invoke()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue