GithubHelp home page GithubHelp logo

avijitnsec / fabrevealmenu-master Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harintrivedi/fabrevealmenu-master

1.0 0.0 0.0 1.34 MB

A general purpose android UI library to show a user show menu in accordance of Floating action button with material design guidelines.

Home Page: https://harintrivedi.github.io/FABRevealMenu-master/

License: Apache License 2.0

Java 100.00%

fabrevealmenu-master's Introduction

FABRevealMenu 2.0 ✌️


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

Uses Material Container Transformation from material components by Google.


gradle dependency:

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
....

dependencies {
        implementation 'com.github.HarinTrivedi:FABRevealMenu-master:2.0.0'
}
    

What's new:

  • Vector icon support
  • Font support
  • Disable menut item
  • Set menu corder radius
  • Set custom animation duration

Demo

  • Horizontal Menu

demo_horizontal

  • Vertical Menu

demo_vertical

  • Custom view in Menu

demo_custom


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: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:duration="1000"
    app:menuCornerRadius="15dp"
    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
    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)


LICENSE

Copyright 2020 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.

fabrevealmenu-master's People

Contributors

harintrivedi avatar karmil32 avatar mflisar avatar harintrivedimm avatar ahmadmust8 avatar jaibatrik avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.