Question

In my application I have 8 buttons in 2 lines (2x4 buttons). I show/hide them using a SlidingDrawer. Right now, I can show 0 or 2 lines of buttons. But I want to show them in steps:

  • slide up -> show 1 line of buttons
  • slide upper -> show 2 lines of buttons
  • slide down -> show 2 line of buttons
  • slide farther down -> hide SlidingDrawer.

How can I make this?

P.S. I saw something like this in Go Weather application.

Was it helpful?

Solution

You have handle in Sliding Drawer. Add onTouchListner to this slider and check for 1st and 2nd Up and Downs. You can check motion events for up down detection. Then set some flag or variable for 1st up , 2nd up, 1st down and 2nd down. For 1st up motion event make your first view(i.e. textview or button) visible and for 2nd up make your 2nd view visible. For first down make 2nd view invisible or Visibility GONE. Likewise you can do. For last sliding down you can make Visibility of Handler as GONE so that Sliding drawer will be invisible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top