A TextView with lightweight-highlighting.
Base | Color | Width | Radius |
---|---|---|---|
Step 1. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.minseok-kr:HighlightTextView:1.2.0'
}
<com.minseok.hightlight.HighlightTextView
android:id="@+id/text_sample_sentence"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_margin"
android:text="Lorem ipsum dolor sit amet,"
android:textSize="25sp"
app:highlightText="ipsum,dolor"
app:highlightTextColor="@color/red"
app:highlightBold="true"
app:highlightWidth="8dp"
app:highlightRadius="4dp"/>
val highlightView = findViewById<HighlightTextView>(R.id.highlight_view)
val input = findViewById<EditText>(R.id.input)
input.addTextChangedListener {
highlightView.highlight(it.toString())
}
- Light, Fast highlighting than Spannable case.
- Working only for a single line
- Not stable yet
Support rounded corners of highlight- Support a highlight of multiline
- Support a highlight of mulitword