11#AndroidResideMenu
22------
3+ ### 中文说明请点击 [ 这里] [ 1 ]
34
4- The idea of ResideMenu is from Dribble [ 1] and [ 2] . It has come true and run in iOS devices. [ iOS ResideMenu] [ 3 ]
5- This project is the ResideMenu Android version. The visual effect is partly referred to iOS version of ResideMenu.
5+ The idea of ResideMenu is from Dribble [ 1] [ 2 ] and [ 2] [ 3 ] . It has come true and run in iOS devices. [ iOS ResideMenu] [ 4 ]
6+ This project is the RefsideMenu Android version. The visual effect is partly referred to iOS version of ResideMenu.
67And thanks to the authors for the above idea and contribution.
7-
8+ < img src = " https://github.com/SpecialCyCi/AndroidResideMenu/raw/master/1.png " width = " 320 " height = " 568 " />
89<img src =" https://github.com/SpecialCyCi/AndroidResideMenu/raw/master/2.gif " width =" 320 " height =" 568 " />
910
10- ## Fixes
11- [ Overlapping Soft NavigationBar to contentUI] [ 4 ]
11+ Now with 3D support !
12+ <img src =" https://github.com/SpecialCyCi/AndroidResideMenu/raw/master/3Dsupport.png " width =" 320 " height =" 568 " />
13+ ## DEMO
14+ This copy is the demo.
15+
16+ ## Version Migration
17+
18+ #### Upgrading to ` v1.4 ` from ` v1.3 ` , ` v1.2 ` , ` v1.1 ` , ` v1.0 `
19+
20+ Duplicate the followed code in dispatchTouchEvent() of Activity, replace the old ` dispatchTouchEvent() ` code.
21+
22+ ``` java
23+ @Override
24+ public boolean dispatchTouchEvent(MotionEvent ev) {
25+ return resideMenu. dispatchTouchEvent(ev);
26+ }
27+ ```
28+
29+ ## Requirements
30+
31+ Run in Android 2.3 +
32+
33+ ## Installation
34+
35+ ### Gradle
36+
37+ ``` gradle
38+ repositories {
39+ mavenCentral()
40+ }
41+ dependencies {
42+ compile 'com.specyci:residemenu:1.6+'
43+ }
44+ ```
45+
46+ ### Other
47+
48+ 1 . import ResideMenu project to your workspace.
49+ 2 . make it as a dependency library project to your main project.
50+ <br >** ( see [ example] [ 5 ] )**
51+
52+ ** or**
53+
54+ If you want to merge ResideMenu with your project, you should follow these steps.
55+
56+ 1 . Copy all files from src/com/special/ResideMenu to your project.
57+ 2 . Copy libs/nineoldandroids-library-2.4.0.jar to your project’s corresponding path: libs/
58+ 3 . Copy res/drawable-hdpi/shadow.9.png to your project’s corresponding path: res/drawable-hdpi/
59+ 4 . Copy res/layout/residemenu.xml and residemenu_item.xml to your project’s corresponding path: res/layout
60+
61+ ## Usage
62+ init ResideMenu: write these code in Activity onCreate()
63+ ``` java
64+ // attach to current activity;
65+ resideMenu = new ResideMenu (this );
66+ resideMenu. setBackground(R . drawable. menu_background);
67+ resideMenu. attachToActivity(this );
68+
69+ // create menu items;
70+ String titles[] = { " Home" , " Profile" , " Calendar" , " Settings" };
71+ int icon[] = { R . drawable. icon_home, R . drawable. icon_profile, R . drawable. icon_calendar, R . drawable. icon_settings };
72+
73+ for (int i = 0 ; i < titles. length; i++ ){
74+ ResideMenuItem item = new ResideMenuItem (this , icon[i], titles[i]);
75+ item. setOnClickListener(this );
76+ resideMenu. addMenuItem(item, ResideMenu . DIRECTION_LEFT ); // or ResideMenu.DIRECTION_RIGHT
77+ }
78+ ```
79+ If you want to use slipping gesture to operate(lock/unlock) the menu, override this code in Acitivity dispatchTouchEvent() (please duplicate the followed code in dispatchTouchEvent() of Activity.
80+ ``` java
81+ @Override
82+ public boolean dispatchTouchEvent(MotionEvent ev) {
83+ return resideMenu. dispatchTouchEvent(ev);
84+ }
85+ ```
86+ ** On some occasions, the slipping gesture function for locking/unlocking menu, may have conflicts with your widgets, such as viewpager. By then you can add the viewpager to ignored view, please refer to next chapter – Ignored Views.**
87+
88+ open/close menu
89+ ``` java
90+ resideMenu. openMenu(ResideMenu . DIRECTION_LEFT ); // or ResideMenu.DIRECTION_RIGHT
91+ resideMenu. closeMenu();
92+ ```
93+
94+ listen in the menu state
95+ ``` java
96+ resideMenu. setMenuListener(menuListener);
97+ private ResideMenu . OnMenuListener menuListener = new ResideMenu .OnMenuListener () {
98+ @Override
99+ public void openMenu () {
100+ Toast . makeText(mContext, " Menu is opened!" , Toast . LENGTH_SHORT ). show();
101+ }
102+
103+ @Override
104+ public void closeMenu () {
105+ Toast . makeText(mContext, " Menu is closed!" , Toast . LENGTH_SHORT ). show();
106+ }
107+ };
108+ ```
12109
13- ## [ Default Usage] [ 5 ]
110+ disable a swipe direction
111+ ``` java
112+ resideMenu. setSwipeDirectionDisable(ResideMenu . DIRECTION_RIGHT );
113+ ```
14114
15115## Custom Usage
16116
@@ -35,8 +135,22 @@ As your configuration's completed, now you can customize side menus by getting i
35135 // TODO: Do whatever you need to with rightMenu
36136```
37137
38- [ 1 ] : http://dribbble.com/shots/1116265-Instasave-iPhone-App
39- [ 2 ] : http://dribbble.com/shots/1114754-Social-Feed-iOS7
40- [ 3 ] : https://github.com/romaonthego/RESideMenu
41- [ 4 ] : https://github.com/SpecialCyCi/AndroidResideMenu/issues/68
42- [ 5 ] : https://github.com/SpecialCyCi/AndroidResideMenu#usage
138+ ##Ignored Views
139+ On some occasions, the slipping gesture function for locking/unlocking menu, may have conflicts with your widgets such as viewpager.By then you can add the viewpager to ignored view.
140+ ``` java
141+ // add gesture operation's ignored views
142+ FrameLayout ignored_view = (FrameLayout ) findViewById(R . id. ignored_view);
143+ resideMenu. addIgnoredView(ignored_view);
144+ ```
145+ So that in ignored view’s workplace, the slipping gesture will not be allowed to operate menu.
146+
147+ ##About me
148+ A student from SCAU China.<br >
149+ Email: specialcyci#gmail.com
150+
151+
152+ [ 1 ] : https://github.com/SpecialCyCi/AndroidResideMenu/blob/master/README_CN.md
153+ [ 2 ] : http://dribbble.com/shots/1116265-Instasave-iPhone-App
154+ [ 3 ] : http://dribbble.com/shots/1114754-Social-Feed-iOS7
155+ [ 4 ] : https://github.com/romaonthego/RESideMenu
156+ [ 5 ] : https://github.com/SpecialCyCi/AndroidResideMenu/blob/master/ResideMenuDemo/project.properties
0 commit comments