Skip to content

Commit

Permalink
Start index was updated
Browse files Browse the repository at this point in the history
  • Loading branch information
enofeb committed Dec 5, 2021
1 parent ce2a3dc commit 1401773
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class SocialTextView @JvmOverloads constructor(
@ColorInt
private var _webLinkColor = Color.BLUE

private var startIndexOfLink = -1

private var startIndexOfLink = 0

var socialText: CharSequence?
get() = this.text
Expand Down Expand Up @@ -135,9 +134,8 @@ class SocialTextView @JvmOverloads constructor(
val words = this.text.split("\\s+".toRegex()).map { word ->
word.replace("""^[,\.]|[,\.]$""".toRegex(), "")
}

words.forEach { word ->
startIndexOfLink = this.text.toString().indexOf(word, startIndexOfLink + 1)
startIndexOfLink = this.text.toString().indexOf(word)
checkRuleAndSpan(word)
}

Expand Down

0 comments on commit 1401773

Please sign in to comment.