GithubHelp home page GithubHelp logo

r0mai / circularfloatingactionmenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oguzbilgener/circularfloatingactionmenu

0.0 3.0 0.0 2.7 MB

an animated circular menu for Android

License: MIT License

Java 100.00%

circularfloatingactionmenu's Introduction

CircularFloatingActionMenu

An animated, customizable circular floating menu for Android, inspired by Path app.

Getting Started

Requirements

  • API >= 15

Installation

Grab the AAR from Maven Central by adding it as a dependency in your build.gradle file:

dependencies {
    compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
}

Alternatively, clone the repo and add library as a module to your project.

Usage

CircularFloatingActionMenu can be attached to any view in your layout. A Floating Action Button implementation is available in the library, with a similar look to new Material Design's FAB.

1 - Create a button to attach the menu:

// in Activity Context
ImageView icon = new ImageView(this); // Create an icon
icon.setImageDrawable( ... );
	
FloatingActionButton actionButton = new FloatingActionButton.Builder(this)
										.setContentView(icon)
										.build();
	

2 - Create menu items:

SubActionButton.Builder itemBuilder = new SubActionButton.Builder(this);
// repeat many times:
ImageView itemIcon = new ImageView(this);
itemIcon.setImageDrawable( ... ); 
SubActionButton button1 = itemBuilder.setContentView(itemIcon).build();
 

3 - Create the menu with the items:

FloatingActionMenu actionMenu = new FloatingActionMenu.Builder(this)
									.addSubActionView(button1)
									.addSubActionView(button2)
									// ...
									.attachTo(actionButton)
									.build();

And you're ready to go!

Customization

Animations, start angle, end angle and radius are customizable via FloatingActionMenu.Builder.

FloatingActionMenu is the essential class for the menu. Other two classes, FloatingActionButton and SubActionButton are just views and they can be replaced with any other view. You are completely free to create your own menu button and item views.

Existing FloatingActionButton and SubActionButton views are customizable too. These parameters can be changed via Builders of both classes:

  • Theme (Light / Dark)
  • Background drawable
  • LayoutParams (width & height)
  • Content View

FloatingActionButton can be placed to one of 8 predefined positions on the screen. To place it somewhere else, extend it!

Custom Animations

You can write your own animation handler class by extending from MenuAnimationHandler to completely customize menu opening and closing animations.

Then all you need is to create an instance of your custom animation handler and pass it to FloatingActionMenu.Builder via setAnimationHandler( ) method.

See CustomAnimationHandler in samples module for a sample animation handler.

Licence

CircularFloatingActionMenu is released under MIT Licence. See file LICENCE.

circularfloatingactionmenu's People

Contributors

johnjohndoe avatar oguzbilgener avatar

Watchers

 avatar  avatar  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.