Today we are going to learn about how to create the custom expandable View which you might have seen in google play app when user clicks on More button then view expands
Create the Custom Linear layout :
For this we will have to create the custome linear layout by expanding the class with Linear Layout
and add the custom animation class which will be having the start height and end height
creating the custom Linear layout is as follows
For this we will have to create the custome linear layout by expanding the class with Linear Layout
and add the custom animation class which will be having the start height and end height
creating the custom Linear layout is as follows
Declaring the Interface And Custom Animation class:
you will have to declare and write one interface which will take care of the view expansion and attraction
here i have declared 2 methods of the interface onCollaps() and OnExpand() which are getting called whenever the view is expanded
to handle the animation events of the expand and collapse action the this is how the custom animation class is written as follows
you will have to declare and write one interface which will take care of the view expansion and attraction
here i have declared 2 methods of the interface onCollaps() and OnExpand() which are getting called whenever the view is expanded
to handle the animation events of the expand and collapse action the this is how the custom animation class is written as follows
The Complete Custom view looks like this which has Linear layout,animation class and the Interface in it
Complete Expandable Class
Complete Expandable Class
The Source code for this tutorial is available at this Linkhttps://github.com/shir60bhushan/ExpandableViewTutorial