1. Introduction :

 

Android Expandable Textview  will help you to show large sentences or paragraphs with an option like read more.. or expandable option and collapse the text so that it uses very less space.

 

Mainly we concentrate on the design of the app and area occupied sometimes there needs to be a lot of items to be shown on the screen each having its own usage and cannot be skipped.To attain this purpose we use various methods like Horizontal Scroll View and Vertical Scroll View.

 

 

 

2. Creating activity_main.xml :

 

We main need two buttons for expanding and collapsing i am representing them with ‘ + ‘ and¬† ‘ – ‘.

 

 

 

3. Creating MainActivity.java :

 

In main activity initialize plus and minus buttons and the make their visibility’s change accordingly.

 

 

4. Output :

exptext1 exptext2

 

 

 

 

 

 

 

 

Show Buttons
Hide Buttons
Read previous post:
Android CalendarView Tutorial in Android Studio

Close