Git Product home page Git Product logo

naseemakhtar994 / customfloatingactionbutton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robertlevonyan/custom-floating-action-button

0.0 1.0 0.0 321 KB

This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button

License: Apache License 2.0

Java 100.00%
floatingactionbutton floating action button custom android

customfloatingactionbutton's Introduction

Custom Floating Action Button

This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button

Setup

Gradle:

Add following line of code to your module(app) level gradle file

    compile 'com.robertlevonyan.view:CustomFloatingActionButton:1.0.3'

Maven:

  <dependency>
    <groupId>com.robertlevonyan.view</groupId>
    <artifactId>CustomFloatingActionButton</artifactId>
    <version>1.0.3</version>
    <type>pom</type>
  </dependency>

Usage

  <com.robertlevonyan.views.customfloatingactionbutton.CustomFloatingActionButton
    android:id="@+id/custom_fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end" />

Cutomizing Floating Action Button

    app:fabIcon="@drawable/customIcon"
    app:fabIconColor="@color/customColor"

alt text

    app:fabSizes="mini"

alt text

            app:fabType="square"

alt text

            app:fabType="roundedSquare"

alt text

            app:fabText="@string/stringRes"
alt text alt text
            app:fabIconPosition="end"

alt text

Attributes

Custom Atributes Description
app:fabType Visual style of Floating Action Button (values: circle (default), square, roundedSquare)
app:fabSizes Sizes of Floating Action Button (values: normal (default), mini)
app:fabText Text label of Floating Action Button
app:fabTextAllCaps Set text label all capitals
app:fabTextColor Set custom color for text label
app:fabElevation Drop shadow size
app:fabColor Custom color for Floating Action Button (default value is accent color)
app:fabIcon Custom icon for Floating Action Button
app:fabIconColor Custom color for icon
app:fabIconPosition Icon position for icon (values: start (default), top, end, bottom)

Setting Listeners

    CustomFloatingActionButton customFAB = (CustomFloatingActionButton) findViewById(R.id.custom_fab);
    
    customFab.setOnFabClickListener(new OnFabClickListener() {
        @Override
        public void onFabClick(View v) {
            //Your action here...
        }
    });

Customizing Floating Action Button from Java

    customFAB.setFabType(); /* Set FAB type | CustomFloatingActionButton.FAB_TYPE_CIRCLE, 
                                              CustomFloatingActionButton.FAB_TYPE_SQUARE, 
                                              CustomFloatingActionButton.FAB_TYPE_ROUNDED_SQUARE */                                              
    customFAB.setFabSize(); /* Set FAB size | CustomFloatingActionButton.FAB_SIZE_NORMAL, 
                                              CustomFloatingActionButton.FAB_SIZE_MINI */
    customFAB.setFabText(); // Set text label
    customFAB.setFabTextAllCaps(); // Set label all capitals
    customFAB.setFabTextColor(); // Change color of label
    customFAB.setFabElevation(); // Change drop shadow size
    customFAB.setFabColor(); // Change FAB color
    customFAB.setFabIcon(); // Change FAB icon
    customFAB.setFabIconColor(); // Change FAB icon color
    customFAB.setFabIconPosition(); /* Change FAB icon position | CustomFloatingActionButton.FAB_ICON_START, 
                                                                  CustomFloatingActionButton.FAB_ICON_TOP,
                                                                  CustomFloatingActionButton.FAB_ICON_END, 
                                                                  CustomFloatingActionButton.FAB_ICON_BOTTOM */

Versions

1.0.0 - 1.0.3

First version of library with some bugfixes

Licence

    Custom Floating Action Button©
    Copyright 2017 Robert Levonyan
    Url: https://github.com/robertlevonyan/materialChipView
    
    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.

customfloatingactionbutton's People

Contributors

robertlevonyan avatar

Watchers

Naseem Akhtar 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.