I have an idea, but I don't know its proper or not.
At first, use TextView
for headers like Hollywood, Bollywood, Coming Soon, and for others too excepts in last second nested list. Use ExpandableListView
for last second nested list. In your case-
Movies //Tv
Hollywood //Tv
Coming Soon // --
abc1 // |
abc2 // |
abc3 // | ExpandableLV
Now Showing // |
abc1 // |
abc2 // |
abc3 // --
Bollywood //Tv
Coming Soon //Tv
abc1 //Tv
vcvc //Tv
vcvc // -
// | ExpandableLV
(..many more levels) // -
abc2 //Tv
abc3 //Tv
Now Showing // -
abc1 // |
abc2 // | ExpandableLV
abc3 // -
Now you would wonder how stupid is this. You want to give the whole list expandable effect. So that's why I got a solution for it too.
Use Visibility
feature for all Textview
s. Whenever any particular Textview
's OnClickListener
listener is called, toggle Visibility
of inner data.
E.g. In your case - when Movies
is clicked, call HollywoodTextview.setVisibility(View.VISIBLE);
and BollywoodTextview.setVisibility(View.VISIBLE);
. And then when HollywoodTextview
is clicked, call HollywoodComingSoonNowShowingExpandableLV.setVisibility(View.VISIBLE);
. Similarly, keep toggling as required. I hope this helps.
Note: you might come across a scrolling problem bacause of manual scrollbars you would use and inbuilt scrolls of ExpandableListView
. See if you can tackle it. Pleasure!