Android Facebook style slide

前端 未结 25 1944
粉色の甜心
粉色の甜心 2020-11-22 03:23

The new Facebook application and its navigation is so cool. I was just trying to see how it can be emulated in my application.

Anyone has a clue how it can be achie

相关标签:
25条回答
  • 2020-11-22 03:47

    Hello this is best sample demo app which provides facebook like slide menu. Check the code here

    enter image description here

    enter image description here

    0 讨论(0)
  • 2020-11-22 03:48

    Here is the design and development guide found in official android documentation no need to add unofficial external library. Only android support library will do. Find the links here.

    design and develop.

    0 讨论(0)
  • 2020-11-22 03:50

    Recently I have worked on my sliding menu implementation version. It uses popular J.Feinstein Android library SlidingMenu.

    Please check the source code at GitHub:

    https://github.com/baruckis/Android-SlidingMenuImplementation

    Download app directly to the device to try:

    https://play.google.com/store/apps/details?id=com.baruckis.SlidingMenuImplementation

    Code should be self-explanatory because of comments. I hope it will be helpful! ;)

    0 讨论(0)
  • 2020-11-22 03:51

    I've had a play with this myself, and the best way I could find was to use a FrameLayout and lay a custom HorizontalScrollView (HSV) on top of the menu. Inside the HSV are your application Views, but there is a transparent View as the first child. This means, when the HSV has zero scroll offset, the menu will show through (and still be clickable surprisingly).

    When the app starts up, we scroll the HSV to the offset of the first visible application View, and when we want to show the menu we scroll back to reveal the menu through the transparent View.

    The code is here, and the bottom two buttons (called HorzScrollWithListMenu and HorzScrollWithImageMenu) in the Launch activity show the best menus I could come up with:

    Android sliding menu demo

    Screenshot from emulator (mid-scroll):

    Screenshot from emulator (mid-scroll)

    Screenshot from device (full-scroll). Note my icon is not as wide as the Facebook menu icon, so the menu view and 'app' view are not aligned.

    Screenshot from device (full-scroll)

    0 讨论(0)
  • 2020-11-22 03:51

    I've implemented this with AbsoluteLayout and a simple slide controller that moves the view to a negative offset to hide.

    If anyone is interested, I can clean up the code/layout and post. I know AbsoluteLayout is deprecated, but it was a very straight forward implementation. Left View/ Right View, and when "sliding open", just move the left view out from a -X offset to the device's width - whatever you want to show of the Right View

    0 讨论(0)
  • 2020-11-22 03:59

    After a search for several hours, I found Paul Grime's solution probably is the best one. But it has too much functionality in it. So it may be hard to study for beginners. So I would like to provide my implementation which is came from Paul's idea but it is simpler and should be easy to read.

    implementation of side menu bar by using java code without XML

    0 讨论(0)
提交回复
热议问题