首页 » Andorid » 安卓例子 » 正文

Fab的transition效果

FabTransitionLayout

Android Arsenal

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

It is strongly inspired by fab-toolbar

bottomsheet toolbar CoordinatorLayout
bottomsheet bottomsheet CoordinatorLayout

Usage

build.gradle

repositories {
    jcenter()
}

dependencies {
    compile 'com.bowyer.app:fabtransitionlayout:0.4.0@aar'
}

Layout XML

BottomSheetLayout













FooterLayout








        <!--add your original layout-->

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
        mBottomSheetLayout.setFab(mFab);
    }

Show Hide

//expand FabToolbar
mBottomSheetLayout.expandFab();

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

//fab slide in
mBottomSheetLayout.slideInFab();

Credits

This library use following libraries.

Code Style

Follow SquareAndroid.

Feature

  • [ ] A floating action button transforming into a single sheet of material

License

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

发表评论