Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

LIVSlideMenu-Android

A two layer sliding menu where the top layer can be animated open to reveal the bottom layer.

Note: An iOS Version is also available.

##Setup

Download the library and include as module dependancy.

##Initialisation & Usage

  1. XML
...
<FrameLayoutandroid:id="@+id/slide_menu_container"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical">
</FrameLayout>
...
  1. JAVA
//Create menu and set background and foreground viewsLiVSlidingMenuliVSlidingMenu = newLiVSlidingMenu();
liVSlidingMenu.setForegroundView(R.layout.view_top);
liVSlidingMenu.setBackgroundView(R.layout.view_bottom);
//The menu can be modified by settingsliVSlidingMenu.showSlideMenuButton(true);
liVSlidingMenu.setDecelerateInterpolator(0.5f);
liVSlidingMenu.setAnimationDuration(300);
liVSlidingMenu.enableFlipSlideMenuButtonImage(true);
//Add the menu to the menu containerFragmentManagerfragmentManager = getFragmentManager();
FragmentTransactionfragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.slide_menu_container, liVSlidingMenu);
fragmentTransaction.commit();
// Change the view members of the foreground and background views after they have been// instantiatedliVSlidingMenu.setViewInstantiatedListener(newLiVSlidingMenu.ViewsInstantiatedListener() {
@OverridepublicvoidonInstantiated() {
LinearLayoutlinearLayout = (LinearLayout)liVSlidingMenu.getForegroundView();
((TextView)linearLayout.findViewById(R.id.text)).setText("Front Drawer");
}
});

##Customizable Properties

PropertyTypeDescriptionDefault Value
animationDurationintDuration of the sliding animation.500
decelerateInterpolatorfloatDegree to which the animation should be eased.1.0f
flipEnabledbooleanFlag whether the sliding button image flips on animation.true
showButtonbooleanFlag whether the sliding button is shown.true

##Listeners

###ViewsInstantiatedListener

This listener has a onViewInstantiated() function to implemented and gets called when the top and bottom views are instantiated. This should be used to make changes or add adapters to views passed through as layouts.

###OnAnimateListener

This listener has 2 functions to be implemented:

  1. onStartAnimateOpen()
  2. onStartAnimateClose() These functions get called when the drawer starts to animate open or close.

##Upcoming Features

  • Keep drawer open when screen rotates.
  • Bounce effect on open and close animation.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors