Shift the screen to right on click of menu; like f

2019-03-10 11:17发布

In my application, I want to have behavior like facebook app wherein on click of icon I'd like to shift the whole screen towards right and display some menus on the left as shown below:

Before Clicking Menu Button

Before Clicking Menu

After Clicking Menu Button

After Clicking Menu Button

One way is to have a layout with those menu in black color and set its visibility to gone

But in that case, the shifting animation won't be there like it is there in facebook. So is there any way we can do this?

3条回答
三岁会撩人
2楼-- · 2019-03-10 11:52

I have not implemented it but give you an exact idea that you have to use fragment for this. Go through this link

查看更多
虎瘦雄心在
3楼-- · 2019-03-10 12:04

This UI Pattern is currently being referred to as Side Navigation and discussed in some detail here:

http://www.androiduipatterns.com/2012/06/emerging-ui-pattern-side-navigation.html

The article also links to several projects that have implemented this navigation:

https://github.com/korovyansk/android-fb-like-slideout-navigation

https://github.com/darvds/RibbonMenu

https://bitbucket.org/jfeinstein10/slidingmenu/overview

https://github.com/Gregadeaux/android-fly-in-app-navigation

It is worth reading the article for its discussion about the issues with this kind of navigation also, though.

查看更多
欢心
4楼-- · 2019-03-10 12:09

This is the best that I've found https://github.com/DWorkS/ActionBarToggle because it's implementation is similar to DrawerLayout from google using ActionBarToggle. Although, it has a problem with open method but I wrote to its owner and he said that he will solve.

查看更多
登录 后发表回答