I have a ListView. Initially, the ListView contains some data. When the user clicks on an item, another layout will be dynamically added to that it
My use case is just to have more or less text displayed. So to toggle state of a listview item from 2-6 max lines for instance one can do this. And its also animated. Animation dont look exactly smooth but...
if(!textDescriptionLenghtToggle) { // simple boolean toggle
ObjectAnimator animation = ObjectAnimator.ofInt(
textViewContainingDescription,
"maxLines",
6);
animation.setDuration(300);
animation.start();
} else {
ObjectAnimator animation = ObjectAnimator.ofInt(
textViewContainingDescription,
"maxLines",
2);
animation.setDuration(300);
animation.start();
}