How to make Facebook's app new menu on Android? [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-11-26 11:57:42

问题


Possible Duplicate:
Android facebook style slide

Recently Facebook released a new version of its Android application that features an improved navigation. One main new feature is the new menu (that already existed on the iOS version):

\"enter

By clicking on the home button of the Action Bar, this menu slides from left to right, hiding the main activity that is no longer accessible.

How do you think this menu has been made? Do you think they have just played with the SlidingDrawer or is it something else like a ViewPager?

Thanks!

EDIT

There is no way that it could be one of the two (ViewPager or SlidingDrawer). It\'s not the menu that slides in, it\'s the main screen that moves away leaving only a tiny part of it on the screen. It\'s like if the menu was already behind that main screen and that it just got uncovered. And second thing, we can actually still interact with that main screen (otherwise I would have assumed that they took a screenshot in order to cut a tiny part of it to compose that view).


回答1:


I was looking for implementing the same thing and I came up with a solution that is good enough (or maybe is really near what they have done).

So what I did was a single FrameLayout with both of the Layouts stacked together and then I just animate the top layout to slide to the right of the screen (just need to call the slideTo or scrollBy. And basically it's that! Quite simple and effective!

EDIT:

I've answered to a similar question here with some code samples, enjoy =): Click here




回答2:


Almost everything except the photo taking parts is inside a WebView in the new FB app. I could not find any native Android UI controls in the stream or the lists.

Making the same effect using Javascript/HTML/CSS should be quite easy I feel.

Decompiling the apk would give a better idea.




回答3:


You can build this application style using javascript, HTML5 and CSS3 like it shows this little library "jbackbone-mobile", https://github.com/mjromper/jbackbone-mobile

and see this demo from any browser (device or desktop) http://lab.ochio.com.es/jbackbone/index.html



来源:https://stackoverflow.com/questions/8428416/how-to-make-facebooks-app-new-menu-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!