I want to make a TextView that is collapsable by user\'s touch.
When the TextView collapsed, I set textView.setMaxLines(4);
.
How to I clear this state in my expand
Try this (infoView.getLineCount()):
public void onMoreClick(View v) {
Button btn = (Button) v;
if(!moreSwitcher) {
infoView.setMaxLines(infoView.getLineCount());
infoView.setLines(infoView.getLineCount());
moreSwitcher = true;
btn.setText(R.string.collapse);
}else{
infoView.setMaxLines(5);
infoView.setLines(5);
moreSwitcher = false;
btn.setText(R.string.expand);
}
}