Fix naming

This commit is contained in:
Kirill Nayduik 2021-11-23 11:34:40 +03:00
parent a6107e2e7a
commit d83ab89739
2 changed files with 3 additions and 6 deletions

View File

@ -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 {

View File

@ -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()
}
}