You are on page 1of 7

Dismiss

Join GitHub today


GitHub is home to over 28 million developers
working together to host and review code, manage
projects, and build software together.

Sign up

Home
Jump to bottom

Harin Trivedi edited this page on 21 Nov 2017 · 11 revisions

Welcome to the FABRevealMenu-master wiki!

FABRevealMenu

An simple general purpose UI library to create custom user defied menu in modern way with
your favourite Floating action button. It incorporates lollipop circular reveal view with cool
animations somewhat inspired from google material design guideline
https://material.google.com/components/buttons-floating-action-button.html#buttons-floating-
action-button-transitions

Features
Supports api level 15(Ice-cream Sandwich) and above.
Easy integration
Easy customisation
Simply binds menu resources
Allows to add dynamic items
Allows own custom view instead of menu

Demo
Horizontal Menu

Vertical Menu

Custom view in Menu


How to integrate
First update your project (top level) gradle file and append this code (important!)

allprojects {
repositories {
maven {
url "https://jitpack.io"
}
jcenter()
}
}

1. Using gradle library dependency:

compile 'com.hlab.fabrevealmenu:fab-reveal-menu:1.0.3'

OR

2. Using gradle module dependency:

compile project(':fabrevealmenu')

How to use
By xml

Add namespace in layout like:


xmlns:app="http://schemas.android.com/apk/res-auto"

Use FABRevealMenu in xml layout like:

<com.hlab.fabrevealmenu.view.FABRevealMenu
android:id="@+id/fabMenu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
app:animateItems="true/false"
app:menuBackgroundColor="@colorRes"
app:menuDirection="left/top/right/bottom"
app:menuRes="@menuRes"
app:menuTitleTextColor="@colorRes"
app:showOverlay="true/false"
app:showTitle="true/false"
app:overlayBackground="@colorRes"
app:menuSize="normal/small"
app:menuTitleFontFamily="@font/quicksand"
app:menuTitleDisabledTextColor="@colorRes""/>

By Code

All attributes can also be set/altered by below methods:

setMenu(@MenuRes) // set R.menu resourece


setMenuItems(ArrayList<FABMenuItem>) // set custom menu items
setOverlayBackground(@ColorRes) // change default overlay background color
setMenuBackground(@ColorRes) // change menu background color
setShowOverlay(boolean) // change overlay visibility : be careful to use this
setTitleVisible(boolean) // set menu item title visibility
setMenuTitleTextColor(@ColorRes) // change menu item text color
setMenuDirection(Direction) // change menu direction when showed : place FAB on
screen properly to change directions
enableItemAnimation(boolean) // enable animations
setSmallerMenu() // small size menu
setNormalMenu() // normal size menu
setMenuTitleDisabledTextColor(@ColorRes) // set disable text color
setMenuTitleTypeface(@FontRes) // set custom font typeface

Set custom view

You can inflate custom view by two ways

1. app:menuCustomView="@layoutRes" // you can get custom view object by calling


getCustomView() on fabRevealMenu instance

2. setCustomView(View)
Thanks to
1. ArcAnimator https://github.com/asyl/ArcAnimator
2. CircularReveal https://github.com/ozodrukh/CircularReveal

More is coming, Enjoy and post issues/suggestion if you love


to use this 👍

LICENSE

Copyright 2017 Harry's Lab

Licensed under the Apache License, Version 2.0 (the "License");


you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software


distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Pages 1

Find a Page…

Home

Clone this wiki locally

https://github.com/HarinTrivedi/FABRevealMenu-master.wiki.git

You might also like