Haga una barra lateral como el navegador Dolphin o Firefox en Android

I would like to create a sidebar like the one in dolphin browser or firefox for android.

I have a listview that is my main screen, when I swype to right I wish to move the listview to right and make appear a new view on the left.

Como este

Muchas Gracias

PS : I'm a french guy sorry for the english :-)

preguntado el 08 de enero de 11 a las 20:01

3 Respuestas

Echa un vistazo a la Workspace widget in the Android Open Source Project Launcher2 code. This is the widget that implements the side to side paging behavior on the stock Android home screen.

The basic idea is to create a custom widget that can pan its contents with rules for snapping to a final position if the user flings or lets go. Use onInterceptTouchEvent to determine when the user has crossed a 'slop' threshold in horizontal motion (you can get the system values for this from ViewConfiguration) and steal away input focus from any child views in the hierarchy. From there, control the panning in onTouchEvent. Puedes usar un VelocityTracker to determine how the content should fling when the user lets go and a Scroller to help you animate to the final position.

Respondido el 09 de enero de 11 a las 01:01

Utilización de ViewPager apoyada por la Support-V4 package, puedes poner Fragments in it, one for your main screen, and another for your sidebar, and then the user can swipe to see the hidden sidebar.

Respondido 05 Abr '12, 19:04

You can make the pane with LinearLayout with a width at 0, then you can use also GestureBuilder to detect horizontal swipe and Animation to change progressively the widthof your LinearLayout to the desired width.

Respondido 06 Abr '12, 15:04

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.