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

 

 

 

 

 

 

 

 



Share article on

Show Buttons
Hide Buttons

June 27, 2017

Attention Required! | Cloudflare

One more step

Please complete the security check to access push.wppush.co

Why do I have to complete a CAPTCHA?

Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.

What can I do to prevent this in the future?

If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.

If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.

Clear all
Read previous post:
calendarbanner
Android CalendarView Tutorial in Android Studio

Close