Skip to content

master #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 3Dsupport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ 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" />

Now with 3D support !
<img src="https://github.com/SpecialCyCi/AndroidResideMenu/raw/master/3Dsupport.png" width="320" height="568" />
## DEMO
This copy is the demo.

Expand Down Expand Up @@ -110,6 +112,29 @@ disable a swipe direction
resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_RIGHT);
```

## Custom Usage

Do your reside menu configurations, by creating an instance of ResideMenu with your custom layout's resource Ids. If you want to use default layout, just pass that variable as -1.

```java
resideMenu = new ResideMenu(activity, R.layout.menu_left, R.layout.menu_right);
resideMenu.setBackground(R.drawable.menu_background);
resideMenu.attachToActivity(activity);
resideMenu.setScaleValue(0.5f);

resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_RIGHT);
resideMenu.setSwipeDirectionDisable(ResideMenu.DIRECTION_LEFT);
```

As your configuration's completed, now you can customize side menus by getting instances of them as following:

```java
View leftMenu = resideMenu.getLeftMenuView();
// TODO: Do whatever you need to with leftMenu
View rightMenu = resideMenu.getRightMenuView();
// TODO: Do whatever you need to with rightMenu
```

##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
Expand Down
53 changes: 0 additions & 53 deletions ResideMenu/res/layout/residemenu.xml

This file was deleted.

25 changes: 25 additions & 0 deletions ResideMenu/res/layout/residemenu_custom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >

<ImageView
android:id="@+id/iv_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />

<ImageView
android:id="@+id/iv_shadow"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/shadow"
android:scaleType="fitXY" />

<RelativeLayout
android:id="@+id/sv_menu_holder"
android:layout_width="match_parent"
android:layout_height="match_parent" >

</RelativeLayout>

</merge>
23 changes: 23 additions & 0 deletions ResideMenu/res/layout/residemenu_custom_left_scrollview.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ScrollView
android:id="@+id/sv_left_menu"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="30dp"
android:scrollbars="none" >

<LinearLayout
android:id="@+id/layout_left_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>

</RelativeLayout>
24 changes: 24 additions & 0 deletions ResideMenu/res/layout/residemenu_custom_right_scrollview.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ScrollView
android:id="@+id/sv_right_menu"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="30dp"
android:scrollbars="none" >

<LinearLayout
android:id="@+id/layout_right_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>

</RelativeLayout>
Loading