Fole is a simple library that handles a toggle for you, to expand and collapse a TextView.
This is only the Alpha version, not tested yet!
repositories {
// ...
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'com.github.bffcorreia:fole:v0.4.4-alpha'
}
Fole.with(yourTextView).text("Your text...").maxLines(4).toggleView(yourToggleView);
Fole.with(yourTextView).maxLines(4).ellipsisPlaceholder("###").toggleView(yourToggleView);
If you want to know when the TextView expand or collapse just add a FoleCallback.
FoleCallback callback = new FoleCallback() {
@Override public void onTextExpand() {
// Handle onTextExpand!
}
@Override public void onTextCollapse() {
// Handle onTextCollapse!
}
};
Fole.with(yourTextView).maxLines(4).toggleView(yourToggleView, callback);
- Tests
- More...