Coder Social home page Coder Social logo

floatingactionmenu's Introduction

FloatingActionMenu

https://img.shields.io/github/tag/QuadFlask/FloatingActionMenu.svg?label=maven

FloatingActionButton with menu like Google's Inbox app style.

Demo video

Youtube

Screenshot

screenshot1

screenshot2

How to add dependency?

This library is not released in Maven Central, but instead you can use JitPack

add remote maven url

repositories {
	maven {
		url "https://jitpack.io"
	}
}

then add a library dependency

dependencies {
	compile 'com.github.QuadFlask:FloatingActionMenu:0.0.1@aar'
}

for proguard, you may need this

#FAM
-keep class com.flask.floatingactionmenu.** { *; }

Usage

Create from code is not tested, so you should use xml.

Propertis

Color

  • fab_colorPressed
  • fab_colorNormal
  • fab_colorDisabled
  • fab_fadingColor

fab_fadingColor work with FadingBackgroundView only

Size

  • fab_type

normal or mini

Icon

  • fab_normal_icon
  • fab_toggle_icon

icon size should be 24dp for normal or 18dp for mini

Label

  • fab_labelStyle
  • fab_labelText
<com.flask.floatingactionmenu.FloatingActionButton
	android:id="@+id/fab1"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:layout_alignParentBottom="true"
	android:layout_alignParentLeft="true"
	android:layout_margin="16dp"
	fab:fab_normal_icon="@drawable/ic_add_white_24dp"
	/>

<com.flask.floatingactionmenu.FloatingActionButton
	android:id="@+id/fab2"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:layout_alignParentTop="true"
	android:layout_alignParentRight="true"
	android:layout_margin="16dp"
	fab:fab_normal_icon="@drawable/ic_add_white_18dp"
	fab:fab_type="mini"
	/>

<com.flask.floatingactionmenu.FloatingActionToggleButton
	android:id="@+id/fab3"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:layout_alignParentBottom="true"
	android:layout_centerHorizontal="true"
	android:layout_margin="16dp"
	fab:fab_normal_icon="@drawable/ic_add_white_24dp"
	fab:fab_toggle_icon="@drawable/ic_mode_edit_white_24dp"
	/>

<com.flask.floatingactionmenu.FadingBackgroundView
	android:id="@+id/fading"
	android:layout_width="match_parent"
	android:layout_height="match_parent"/>

<com.flask.floatingactionmenu.FloatingActionMenu
	android:id="@+id/fam"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:layout_alignParentBottom="true"
	android:layout_alignParentRight="true"
	android:layout_margin="4dp"
	fab:fab_labelStyle="@style/fab_labels_style"
	>

	<com.flask.floatingactionmenu.FloatingActionButton
		android:id="@+id/faba"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_margin="8dp"
		fab:fab_normal_icon="@drawable/ic_add_white_18dp"
		fab:fab_type="mini"
		fab:fab_labelText="faba"
		/>

	<com.flask.floatingactionmenu.FloatingActionButton
		android:id="@+id/fabb"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_margin="8dp"
		fab:fab_normal_icon="@drawable/ic_mode_edit_white_18dp"
		fab:fab_type="mini"
		fab:fab_labelText="faba"
		/>

	<com.flask.floatingactionmenu.FloatingActionButton
		android:id="@+id/fabc"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_margin="8dp"
		fab:fab_normal_icon="@drawable/ic_add_white_18dp"
		fab:fab_type="mini"
		fab:fab_labelText="fabc"
		/>

	<com.flask.floatingactionmenu.FloatingActionToggleButton
		android:id="@+id/fab_toggle"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_marginTop="8dp"
		fab:fab_normal_icon="@drawable/ic_add_white_24dp"
		fab:fab_toggle_icon="@drawable/ic_mode_edit_white_24dp"
		fab:fab_labelText="toggle button"
		/>
</com.flask.floatingactionmenu.FloatingActionMenu>

To do

  • gradle support
  • performance improvement
  • refactoring
  • other label style

Credits

I used android-floating-action-button library by futuresimple and FloatingActionButton library by Oleksandr Melnykov as a base for development.

License

Copyright 2015 QuadFlask

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.

floatingactionmenu's People

Contributors

quadflask avatar

Watchers

Satya Naveen Vysetty 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.