This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun getTextWithHighlights(text: String): CharSequence { | |
// Initialize spannable string without any formatting | |
val spannableString = SpannableStringBuilder(text) | |
// Regex to find words between curly braces i.e {test} | |
val regex = Regex("\\{(.*?)\\}") | |
// List of index for the curly braces which needs to be removed after formatting | |
val symbolsToRemoveIndices = mutableListOf<Int>() | |
// iterate over all the words within curly braces | |
regex.findAll(spannableString).forEach { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.BlurMaskFilter | |
import android.graphics.ColorMatrix | |
import android.graphics.ColorMatrixColorFilter | |
import androidx.compose.runtime.Stable | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.draw.clip | |
import androidx.compose.ui.draw.drawWithCache | |
import androidx.compose.ui.geometry.Size | |
import androidx.compose.ui.graphics.Canvas | |
import androidx.compose.ui.graphics.ClipOp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Number of milliseconds in a standard second. | |
*/ | |
const val MILLIS_PER_SECOND: Long = 1000 | |
/** | |
* Number of milliseconds in a standard minute. | |
*/ | |
const val MILLIS_PER_MINUTE = 60 * MILLIS_PER_SECOND |