Manabu-GT / ExpandableTextView

Android's TextView that can expand/collapse like the Google Play's app description
Apache License 2.0
4.08k stars 791 forks source link

There is no support for collapsing an already expanded textview. #68

Open kanishk779 opened 5 years ago

c0dehunter commented 5 years ago

Actually you can collapse the view with setText():

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    SparseBooleanArray mTogglePositions = new SparseBooleanArray(); // leave it empty to collapse
    holder.content.setText(someText, mTogglePositions, position); 
}

See https://github.com/Manabu-GT/ExpandableTextView/issues/44#issuecomment-271550170