如何使Android上Facebook的应用程序,新的菜单?应用程序、菜单、Android、Facebook

2023-09-12 00:42:45 作者:品切男!

可能重复:   的Andr​​oid的Facebook风格的幻灯片

最近的Facebook发布了新版本的Andr​​oid应用程序的,其特点是改进的导航。一个主要的新功能是新的菜单(已经存在于iOS版):

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):

点击操作栏的home键,此菜单幻灯片从左至右,隐藏的主要活动就是不再访问。

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.

您如何看待这个菜单中已经取得了?你认为他们只是使用了与SlidingDrawer或者是别的东西像ViewPager?

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?

谢谢!

修改

有没有办法,这可能是一两个( ViewPager SlidingDrawer )。这并不是说在滑动菜单,那就是移开留在屏幕上只有一小部分的主屏幕。这就像如果菜单上已经落后于主屏幕上,它刚刚被发现。而第二件事情,我们实际上可以仍与主屏互动(否则我会假设,他们采取了截屏,以削减它的一个小部分来撰写这一观点)。

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).

推荐答案

我一直在寻找实现同样的事情,我想出了一个解决方案,那就是不够好(或者真的是接近他们做了什么)。

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).

所以,我所做的就是与两个叠在一起的布局单一的FrameLayout,然后我只是动画的顶尖布局滑动到屏幕的右侧(只需要调用slideTo或scrollBy。基本上它是的!挺简单有效!

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!

编辑:

我已经回答了在这里的一些code样品类似的问题,享受=)的点击此处

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