2

so I'm considering making a UI that consists of a list with expandable sections. I've read that the ExpandableList design is being phased out, so as an alternative, I am thinking about using a ViewPager that can partially swipe. What I mean by partially swipe is that the UI will consist of 3 columns, each column expanding relevant items in the column to its immediate right. When an item is selected in the very right most column, all the fragments will shift to the left and a new column on the right will display the next level of relevant items. All the while, a PagerTitleStrip will give the title of right most column.

In my research, I didn't even really know what to search to find information, so if anyone has any idea how to go about this, it would be greatly appreciated!

user1549672
  • 486
  • 1
  • 6
  • 16
  • 1
    "I've read that the ExpandableList design is being phased out" -- really? Do you have a link? – CommonsWare Jul 31 '13 at 17:58
  • Nothing official, just an answer from another post haha I guess not, but I'm still interested in a way to do what I asked in the question – user1549672 Jul 31 '13 at 18:03
  • 1
    Since they are using it in the navigation drawer, it's certainly not being completely phased out. I actually expect that something along the lines of what you're describing may be something we evolve to, though I haven't seen a reusable implementation of it. – CommonsWare Jul 31 '13 at 18:07
  • Hm, well I guess I'll try something else for the time being then. Thanks though! – user1549672 Jul 31 '13 at 18:33
  • try this! https://stackoverflow.com/a/13437997/1083128 – Mia Mar 18 '19 at 08:36

1 Answers1

0

I realize this is a very old question, but here's my answer anyway.

Check out ViewPager.PageTransformer. You can handle complicated behaviors like partial scrolling, position of each view, etc. on transformPage(..). This can be set to the ViewPager using viewPager.setPageTransformer(..)

An alternative could be using a RecyclerView with the total width of the three columns instead of a ViewPager and use smoothScrollToPosition(..) to the correct column when the next one expands. (With this you might have to disable manual scrolling on the RecyclerView like this

Ramprakash K
  • 131
  • 2
  • 5