Fabuless


Source link: https://github.com/beworker/fabuless

Fabuless

Fun to use Floating Action Button (FAB) view for Android 4.0 and higher.

Features

  • Fully configurable via layout xml-file
  • Can be attached to any view in layout
  • Automatically caclulatable attachment position
  • Two fab sizes ('normal' and 'small')
  • Nice reveal and touch animations

Usage example

To attach a FabView to your target view, do the following.

  1. Wrap target view with a FrameLayout.
  2. Add de.halfbit.fabuless.FabView as the last child of that FrameLayout.
  3. Configure size, location, color and icon of FabView.

That's it. Here is an example.

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:fabview="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent">

<RelativeLayout

 android:id="@+id/fab_target"

android:layout_width="match_parent"

android:layout_height="170dp"

android:layout_gravity="top"

android:background="@color/color1">

<!-- 

  This is yours target view with children (ommited for simplisity)  

  ...  

-->

 </RelativeLayout>

 <!-- This is our FabView -->
  <de.halfbit.fabuless.FabView

 android:id="@+id/fab"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:background="@color/fab_color"

android:paddingTop="3dp"

android:src="@drawable/ic_favorite"

fabview:fabuless_attachTo="@id/fab_target"

fabview:fabuless_attachAt="bottom_right"

fabview:fabuless_attachType="border"

fabview:fabuless_size="normal"

fabview:fabuless_padding="16dp"

fabview:fabuless_revealAfterMs="300"

/>  </FrameLayout>

FabView attributes

Attribute Required Default Description
fabuless_attachTo X - Id of target view.
fabuless_attachAt - top_right Attachment position ( top_left, top_right, bottom_left, bottom_right).
fabuless_attachType - border Defines whether the button resides inside ( inside) parent container or it gets attached to parent's borders ( border).
fabuless_size - normal Fab size ( normal, small).
fabuless_padding - 16dp Padding to the closest left or right border of target view.
fabuless_revealAfterMs - Show immediately When set, fab will be revealed with animation after a specified timeout in milliseconds.

Other attributes

FabView is an ImageView. You can use any ImageView attributes to achieve required look and feed. For instance

  • to set an icon you can use android:src attribute
  • to change background color you can use android:background attribute
  • to move icon down you can use android:paddingTop attribute etc.

More details

  • Click animation only works when OnClickListener is set to the view
  • Method setBackgroundDrawable() method supports ColorDrawable only

License

Copyright (c) 2014-2015 Sergej Shafarenka, halfbit.de  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

Android floating action button (fab) with text.

Simple and flexible router library for Android platform.

This library is inspired from Zane David's Animation Transition Work on Dribbble.

If you want to pick up a photo from the gallery and camera, store it somewhere then do something, this library will be the best choice for you. It will handle all the storing, scaling, rotating, threading, loading dialogs. Easy to start a photo intent, easy to get the result, you won't need to code a lot as what you used to do.

It also helps you to handle realtime permissions without any lines of code.

Template engine for java with statically checked and compiled templates. Compilation is performed alone with java sources.

This library implements Algebraic Data Types for Java. ADT4J provides annotation processor for @GenerateValueClassForVisitor annotation.

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