Include jitpack.io
inside of root project build.gradle
:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
After that you can easily include the library in your app build.gradle
:
dependencies {
compile 'com.github.mahendramahi:ExpandableMenu:1.0'
}
Add ExpandableMenuView to your xml fule
<io.mahendra.expandablemenu.ExpandableMenuView
android:id="@+id/expanded_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:bottom_drawable="@drawable/location_selector"
app:left_drawable="@drawable/play_selector"
app:menu_color="@color/menu_color"
app:menu_drawable="@drawable/menu_icon"
app:menu_expanded_radius="@dimen/big_radius"
app:menu_radius="@dimen/small_radius"
app:right_drawable="@drawable/phone_selector"
app:top_drawable="@drawable/camera_selector" />
Most of xml attributes are self explanatory.
Add menu click callback in java -
mExpandableMenuView.setOnMenuListener(new ExpandableMenuView.MenuListener() {
@Override
public void rightPressed() {
}
@Override
public void leftPressed() {
}
@Override
public void topPressed() {
}
@Override
public void bottomPressed() {
}
});
--
This Is Demo for Test