Giter VIP home page Giter VIP logo

fab-toolbar's Introduction

Floating Action Button Toolbar

Provides the Floating Action Button Toolbar as specified in the Material Design Guide in a simple library.

demo

Usage

build.gradle

repositories {
    maven { url 'http://bowyer-app.github.io/AndroidRepositories/repository/releases' }
}

dependencies {
    compile 'com.bowyer.app:fabtoolbar:1.0.0@aar'
}

Layout XML

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

    <com.github.ksoichiro.android.observablescrollview.ObservableListView
            android:id="@+id/list_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />

    <android.support.design.widget.FloatingActionButton
            android:id="@+id/fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_marginBottom="32dp"
            android:layout_marginRight="32dp"
            android:src="@drawable/ic_add_white_24dp"
            app:borderWidth="0dp"
            app:fabSize="normal"
            app:rippleColor="@color/primary"
            />

    <com.bowyer.app.fabtoolbar.FabToolbar
            android:id="@+id/fabtoolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            app:tb_container_gravity="center"
            app:tb_color="@color/primary">
            
        <!--add your original layout-->
    </com.bowyer.app.fabtoolbar.FabToolbar>
</FrameLayout>

Set up

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.inject(this);
        initListView();
        //set floating button to FabToolbar
        mFabToolbar.setFab(mFab);
    }

Show Hide

//expand FabToolbar
mFabToolbar.expandFab();

//if mFabToolbar is expand,mFabToolbar contract. else fab slide out.
mFabToolbar.slideOutFab();

//fab slide in
mFabToolbar.slideInFab();

License

Copyright (c) 2015 Bowyer Released under the MIT license http://opensource.org/licenses/mit-license.php

fab-toolbar's People

Contributors

bowyer-app avatar

Watchers

James Cloos avatar Wei Liu 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.