MaterialFabSpeedDial


Source link: https://github.com/kobakei/MaterialFabSpeedDial

MaterialFabSpeedDial

This project aims to provide FloatingActionButton's speed dial pattern in material design guideline.

This project is inspired by fab-speed-dial and overcomes some issues of it (ex. using private APIs of support library). This library supports landscape mode and also supports CoordinatorLayout so it works as same as FloatingActionButton when Snackbar is shown.

Download

Project build.gradle

allprojects {

  repositories {

...

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

  
}
 
}

App build.gradle

dependencies {

  compile 'com.github.kobakei:MaterialFabSpeedDial:LATEST_VERSION' 
}

LATEST_VERSION is

You can also use snapshot version.

dependencies {

  compile 'com.github.kobakei:MaterialFabSpeedDial:master-SNAPSHOT' 
}

Getting Started

Add to layout file

You can put FabSpeedDial in your layout XML.

<io.github.kobakei.materialfabspeeddial.FabSpeedDial
  android:id="@+id/fab"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  app:fab_menu="@menu/fab"/>

Menu file is as below. Supported attributes of menu are id, title, icon, orderInCategory, visible, enabled. Other attributes will be ignored.

<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item

android:id="@+id/one"

android:title="Cut"

android:icon="@drawable/ic_action_cut"

android:orderInCategory="1"/>
  <item

android:id="@+id/two"

android:title="Copy"

android:icon="@drawable/ic_action_copy"

android:orderInCategory="2"/>
  <item

android:id="@+id/three"

android:title="Paste"

android:icon="@drawable/ic_action_paste"

android:orderInCategory="3"/> </menu>

Or you can set up menu items in Java.

FabSpeedDialMenu menu = new FabSpeedDialMenu(this);
 menu.add("One").setIcon(R.drawable.ic_action_cut);
 menu.add("Two").setIcon(R.drawable.ic_action_copy);
 menu.add("Three").setIcon(R.drawable.ic_action_paste);
 fab.setMenu(menu);

Event listener

You can detect menu open/close event and menu item click event.

fab.addOnStateChangeListener(new FabSpeedDial.OnStateChangeListener() {

  @Override
  public void onStateChange(boolean open) {

// do something
  
}
 
}
);
  fab.addOnMenuItemClickListener(new FabSpeedDial.OnMenuItemClickListener() {

  @Override
  public void onMenuItemClick(FloatingActionButton fab, TextView textView, int itemId) {

// do something
  
}
 
}
);

Attributes

Attribute Type Description Note
fab_menu Menu resource ID Menu
fab_fabBackgroundColor color int or ColorStateList Main FAB background color
fab_fabDrawable Drawable Main FAB drawable
fab_fabDrawableTint color int or ColorStateList Main FAB drawable tint
fab_fabRippleColor color int Main FAB ripple color
fab_miniFabBackgroundColor color int or ColorStateList Mini FAB background color
fab_miniFabBackgroundColorList array of color int or ColorStateList Mini FAB background color Array size must be same as menu item size
fab_miniFabDrawableTint color int or ColorStateList Mini FAB drawable tint
fab_miniFabDrawableTintList array of color int or ColorStateList Mini FAB drawable tint Array size must be same as menu item size
fab_miniFabRippleColor color int or ColorStateList Mini FAB ripple color
fab_miniFabRippleColorList array of color int or ColorStateList Mini FAB ripple color Array size must be same as menu item size
fab_miniFabTextColor color int or ColorStateList Mini FAB text color
fab_miniFabTextColorList array of color int or ColorStateList Mini FAB text color Array size must be same as menu item size
fab_miniFabTextBackground drawable Mini FAB text background
fab_miniFabTextBackgroundList drawable Mini FAB text background Array size must be same as menu item size
fab_useTouchGuard boolean Use touch guard or not
fab_touchGuardColor color int Touch guard color Default: #80000000
fab_useRippleOnPreLollipop boolean Use ripple on pre Lollipop Default: true
fab_useRevealEffect boolean Use reveal effect of touch guard Works on API level >= 21. Default: true
fab_extraMargin dimension Extra margin between FABs All FABs have padding app:useCompatPadding="true". To reduce space, set negative value.

fab_miniFab***List attribute is array version of fab_miniFab***. If you want to set different values to each items, please use fab_miniFab***List instead of fab_miniFab***.?Notice that size of resource array must be same as menu item size.

License

Copyright (c) 2017 Keisuke Kobayashi  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. 

Resources

A camera view to capture long image merged from small captured images as it is in Shoparoo app!

This library uses CameraView from Google as the backbone of camera functionality and adds auto-support of creating long or wide images from multiple images.

Features:

  • Built-in Camera UI and activity
  • Built-in Image Viewer with pinch-fling gestures for zoom/move/rotate etc.
  • TouchImageView with gestures support for zoom/move/rotate etc.
  • Built-in permission handling for Camera and Storage
  • Horizontal or Vertical image merging

Android Runtime Permission is an easy way to handle single or multiple permission very easily.

In-App Android Debugging Tool With Enhanced Logging, Networking Info, Crash reporting And More.

The debugger tool for Android developer. Display logs, network request, while using the app. Easy accessible with its bubble head button :radio_button:. Easy to integrate in any apps, to handle development or testing apps easier. First version, there is plenty of room for improvement.

Quoteable is a simple library to request random quotes from the free Forismatic Quote API to help implement quotes into your app.

A synchronous CallAdapter.Factory implementation for Retrofit 2. This project brings Retrofit 1's synchronous usage to Retrofit 2.

The DynamicPagerAdapter extends Android's PagerAdapter to do four important things:

  • Has an accessible HashMap View cache using ViewHolders. The default implementaiton has caching, but it isn't enforced and users of the PagerAdapter don't get access to it.

  • Provides the capability to use multiple view types just like RecyclerView.

  • Handles data set changes in a much more friendly way, allowing items to be removed, added, etc. with less issues and effort on your end.

  • Includes optional discard animations. These are exposed for you to call when you want or to override and create your own.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes