ShorteningTextView
A TextView that shows the right text based on its size!
Installation
Add the following line in the dependencies
section of your build.gradle
file:
implementation 'com.alexfacciorusso.shorteningtextview:shorteningtextview:0.1.0'
Usage
Use the com.alexfacciorusso.shorteningtextview.ShorteningTextView
view into your layouts.
<com.alexfacciorusso.shorteningtextview.ShorteningTextView
android:id="@+id/shorteningTextView"
app:stv_texts="@array/example_strings"
... />
where @array/exampe_strings
is an array of strings defined as a resource.
If you want to set the texts in a programmatic way (we all love setting views programmatically,
don't we?), a property texts
(Kotlin) or setTexts/getTexts
(Java) is available!