How can I create a horizontal sliding drawer like the YouTube and Facebook app has.
Many other apps seem to use use the same style, so I'm guessing that this is a part of the default Androind UI framework but I can't seem to piece it together.
You can see some more samples here.
Thanks.
This is a sliding menu, you can implement this by writing a custom view. There are a lot of good open source examples. I would recommend you to use this one.
You can use it by defining this in your Layout:
<com.slidingmenu.lib.SlidingMenu
xmlns:sliding="http://schemas.android.com/apk/res-auto"
android:id="@+id/slidingmenulayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
sliding:viewAbove="@layout/YOUR_ABOVE_VIEW"
sliding:viewBehind="@layout/YOUR_BEHIND_BEHIND"
sliding:touchModeAbove="margin|fullscreen"
sliding:touchModeBehind="margin|fullscreen"
sliding:behindOffset="@dimen/YOUR_OFFSET"
sliding:behindWidth="@dimen/YOUR_WIDTH"
sliding:behindScrollScale="@dimen/YOUR_SCALE"
sliding:shadowDrawable="@drawable/YOUR_SHADOW"
sliding:shadowWidth="@dimen/YOUR_SHADOW_WIDTH" />
The Android team introduced an official sliding pattern on Google IO 2013. Read everything about it here.
As far as I know it is not part of the default framework. This is the only place I can find it mention in the Android docs http://developer.android.com/design/patterns/actionbar.html and I have search quite a bit.
This so far has been my favorite library https://bitbucket.org/verdigo/drawer/ straight forward and easy to use.
Also pretty recently HoloEverywhere library added a drawer you can use. This one interests me since I use HoloEverywhere in most of my apps and it looks very similar to Foursquares. https://github.com/Prototik/HoloEverywhere
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With