GithubHelp home page GithubHelp logo

bowyer-app / fab-toolbar Goto Github PK

View Code? Open in Web Editor NEW
210.0 8.0 35.0 1.86 MB

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

License: Other

Java 100.00%

fab-toolbar's Introduction

Floating Action Button Toolbar

Android Arsenal

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

demo

Usage

build.gradle

repositories {
    jcenter()
}

dependencies {
    compile 'com.bowyer.app:fab-toolbar:1.1.0@aar'
}

Layout XML

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    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_margin="16dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:src="@drawable/ic_fab_icon"/>

    <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_color="@color/primary"
        app:tb_container_gravity="center"
        app:tb_anim_duration="400"
        app:tb_fab_type="normal">

        <!--add your original layout-->

    </com.bowyer.app.fabtoolbar.FabToolbar>

</android.support.design.widget.CoordinatorLayout>

Make sure to user CoordinatorLayout as your container for the Floating Action Button if you want to preserve same margin values for both Lollipop and pre Lollipop devices.

Set up

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(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();

Credits

This library use following libraries.

Feature

  • Android 5.0 lower animation support

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fab-toolbar's Issues

Failed to resolve

Error:Failed to resolve: com.github.ozodrukh:CircularReveal:1.1.1

I have tired many solution

Elevation

Does elevation currently works for the FabToolbar? Will it be implemented?

Can't set the height of child layout

I have LinearLayout as FabToolbar child but I can't set its height. no matter what is the height of the layout it is always become visible the same height as FloatingButton height

hide and show fab within a coordinatorlayout?

hi
Thanks for this beautiful library ๐Ÿ‘
is it possible to hide and show fab inside coordinatorLayout and NestedScrollView when the scroll... i mean without any list scrolling!
thanks again...

FAB don't always reappear on contractFab()

Hello,

I've noticed that if i expand and then contract too fast the fabToolbar, the original FAB will not re-appear.

This case happens to me very often as i want the fabToolbar to contract if the user starts scrolling.
My only solution so far has been to put a fab.show() on the scroll event, this way on the next scroll if the fab his hidden it will re-appear. But before that scrolls i have a screen without fab, which feels weird.

Is there a way to avoid that ?

minSDK 15

Any reason not to have this library minSDK targeting 14 instead of 15?

java.lang.NoSuchMethodError: io.codetail.animation.SupportAnimator.setDuration

Hi,

calling mFabToolbar.expandFab(); on pre lollipop device, causes following exception:

java.lang.NoSuchMethodError: io.codetail.animation.SupportAnimator.setDuration at com.bowyer.app.fabtoolbar.FabToolbar.expandPreLollipop(FabToolbar.java:368) at com.bowyer.app.fabtoolbar.FabToolbar.expandFab(FabToolbar.java:241) at com.shygunsys.mu.cybermobile.ui.MainActivityFragment$1.onClick(MainActivityFragment.java:61)

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.