#AndroidResideMenu
------
### 中文说明请点击 [这里][1]
The idea of ResideMenu is from Dribble [1][2] and [2][3]. It has come true and run in iOS devices. [iOS ResideMenu][4]
This project is the RefsideMenu Android version. The visual effect is partly referred to iOS version of ResideMenu.
And thanks to the authors for the above idea and contribution.
<img src="https://github.com/SpecialCyCi/AndroidResideMenu/raw/master/1.png" width="320" height="568" />
<img src="https://github.com/SpecialCyCi/AndroidResideMenu/raw/master/2.gif" width="320" height="568" />
## DEMO
This copy is the demo.
## Version Migration
#### Upgrading to `v1.4` from `v1.3`, `v1.2`, `v1.1`, `v1.0`
Duplicate the followed code in dispatchTouchEvent() of Activity, replace the old `dispatchTouchEvent()` code.
```java
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return resideMenu.dispatchTouchEvent(ev);
}
```
## Requirements
Run in Android 2.3 +
## Installation
1. import ResideMenu project to your workspace.
2. make it as a dependency library project to your main project.
<br>**( see [example][5] )**
**or**
If you want to merge ResideMenu with your project, you should follow these steps.
1. Copy all files from src/com/special/ResideMenu to your project.
2. Copy libs/nineoldandroids-library-2.4.0.jar to your project’s corresponding path: libs/
3. Copy res/drawable-hdpi/shadow.9.png to your project’s corresponding path: res/drawable-hdpi/
4. Copy res/layout/residemenu.xml and residemenu_item.xml to your project’s corresponding path: res/layout
## Usage
init ResideMenu: write these code in Activity onCreate()
```java
// attach to current activity;
resideMenu = new ResideMenu(this);
resideMenu.setBackground(R.drawable.menu_background);
resideMenu.attachToActivity(this);
// create menu items;
String titles[] = { "Home", "Profile", "Calendar", "Settings" };
int icon[] = { R.drawable.icon_home, R.drawable.icon_profile, R.drawable.icon_calendar, R.drawable.icon_settings };
for (int i = 0; i < titles.length; i++){
ResideMenuItem item = new ResideMenuItem(this, icon[i], titles[i]);
item.setOnClickListener(this);
resideMenu.addMenuItem(item, ResideMenu.DIRECTION_LEFT); // or ResideMenu.DIRECTION_RIGHT
}
```
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.
```java
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return resideMenu.dispatchTouchEvent(ev);
}
```
**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.**
open/close menu
```java
resideMenu.openMenu(ResideMenu.DIRECTION_LEFT); // or ResideMenu.DIRECTION_RIGHT
resideMenu.closeMenu();
```
listen in the menu state
```java
resideMenu.setMenuListener(menuListener);
private ResideMenu.OnMenuListener menuListener = new ResideMenu.OnMenuListener() {
@Override
public void openMenu() {
Toast.makeText(mContext, "Menu is opened!", Toast.LENGTH_SHORT).show();
}
@Override
public void closeMenu() {
Toast.makeText(mContext, "Menu is closed!", Toast.LENGTH_SHORT).show();
}
};
```
disable a swipe direction
```java
resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_RIGHT);
```
##Ignored Views
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.
```java
// add gesture operation's ignored views
FrameLayout ignored_view = (FrameLayout) findViewById(R.id.ignored_view);
resideMenu.addIgnoredView(ignored_view);
```
So that in ignored view’s workplace, the slipping gesture will not be allowed to operate menu.
##About me
A student from SCAU China.<br>
Email: specialcyci#gmail.com
[1]: https://github.com/SpecialCyCi/AndroidResideMenu/blob/master/README_CN.md
[2]: http://dribbble.com/shots/1116265-Instasave-iPhone-App
[3]: http://dribbble.com/shots/1114754-Social-Feed-iOS7
[4]: https://github.com/romaonthego/RESideMenu
[5]: https://github.com/SpecialCyCi/AndroidResideMenu/blob/master/ResideMenuDemo/project.properties
没有合适的资源?快使用搜索试试~ 我知道了~
动画侧边栏AndroidResideMenu-master
共62个文件
png:21个
xml:16个
java:8个
5星 · 超过95%的资源 需积分: 10 26 下载量 116 浏览量
2014-11-09
11:27:40
上传
评论
收藏 2.25MB ZIP 举报
温馨提示
该资源是第三方开源项目,可实现类似于腾讯QQ的左侧侧边栏的动态效果,操作非常流畅,UI效果绝对够炫,附件中还附有一个已实现的demo,方便大家学习。
资源推荐
资源详情
资源评论
收起资源包目录
动画侧边栏AndroidResideMenu-master.zip (62个子文件)
AndroidResideMenu-master
settings.gradle 319B
ResideMenuDemo
project.properties 605B
src
com
special
ResideMenuDemo
HomeFragment.java 1KB
CalendarFragment.java 2KB
SettingsFragment.java 538B
MenuActivity.java 4KB
ProfileFragment.java 536B
AndroidManifest.xml 822B
ant.properties 698B
res
drawable-ldpi
ic_launcher.png 3KB
gesture.png 7KB
drawable-hdpi
icon_home.png 972B
ic_launcher.png 9KB
button_on.9.png 441B
title_bar_menu_on.png 3KB
title_bar_menu.png 3KB
icon_profile.png 2KB
frame.png 5KB
icon_calendar.png 1KB
icon_settings.png 1KB
button.9.png 440B
menu_background.png 284KB
drawable
titlebar_menu_selector.xml 353B
button_selector.xml 329B
drawable-mdpi
ic_launcher.png 5KB
layout
settings.xml 548B
calendar.xml 425B
home.xml 3KB
profile.xml 547B
main.xml 2KB
drawable-xhdpi
ic_launcher.png 14KB
values
strings.xml 116B
styles.xml 215B
libs
android-support-v4.jar 377KB
build.xml 4KB
proguard-project.txt 781B
build.gradle 917B
ResideMenu
project.properties 599B
src
com
special
ResideMenu
TouchDisableView.java 2KB
ResideMenuItem.java 2KB
ResideMenu.java 19KB
AndroidManifest.xml 276B
ant.properties 698B
res
drawable-ldpi
ic_launcher.png 3KB
drawable-hdpi
ic_launcher.png 9KB
shadow.9.png 18KB
drawable-mdpi
ic_launcher.png 5KB
layout
residemenu.xml 2KB
residemenu_item.xml 833B
drawable-xhdpi
ic_launcher.png 14KB
values
strings.xml 112B
libs
nineoldandroids-library-2.4.0.jar 108KB
build.xml 4KB
proguard-project.txt 781B
build.gradle 814B
2.gif 1.43MB
1.png 40KB
README_CN.md 4KB
LICENSE 1KB
README.md 4KB
.gitignore 359B
build.gradle 906B
共 62 条
- 1
资源评论
- 昔我往矣杨柳依依2015-10-19值得借鉴的
- 轻云光年2015-02-01不错,可以改改自己用
- bryanthe2015-05-21这个不错,改一下就能自用
Ivan_Truman
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功