Android Facebook style slide

2018-12-31 05:47发布

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 achieved?

enter image description here

On clicking the the top left button the page slide and the following screen is shown:

enter image description here

YouTube Video

25条回答
笑指拈花
2楼-- · 2018-12-31 06:10

With android support package revision 13( may 2013), there is DrawerLayout for creating a Navigation Drawer that can be pulled in from the edge of a window. And, navigation drawer is a design pattern now.

v4 support library

navigation drawer design pattern

查看更多
栀子花@的思念
3楼-- · 2018-12-31 06:12

In June 2012, Google has added "templates" in the Eclipse ADT plugin, and there is a template called "master/detail flow" which does exactly that (based on fragmets)

查看更多
像晚风撩人
4楼-- · 2018-12-31 06:13

I've implemented facebook-like slideout navigation in this library project.

You can easy built it into your application, your UI and navigation. You will need to implement only one Activity and one Fragment, let library know about it - and library will provide all wanted animations and navigation.

Inside the repo you can find demo-project, with how to use the lib to implement facebook-like navigation. Here is short video with record of demo project.

Also this lib should be compatible this ActionBar pattern, because is based on Activities transactions and TranslateAnimations (not Fragments transactions and custom Views).

Right now, the most problem is to make it work well for application, which support both portrait and landscape mode. If you have any feedback, please provide it via github.

All the best,
Alex

查看更多
呛了眼睛熬了心
5楼-- · 2018-12-31 06:13

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

查看更多
美炸的是我
6楼-- · 2018-12-31 06:14

I think that library does not mentioned:

jfeinstein10 / SlidingMenu

github url:https://github.com/jfeinstein10/SlidingMenu

  • works fine with action bar ActionBarSherlock which helps in backward compatibility!
  • Support right slide and not only slide via button!
查看更多
情到深处是孤独
7楼-- · 2018-12-31 06:15

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

查看更多
登录 后发表回答