FabTransitionLayout


Source link: https://github.com/bowyer-app/FabTransitionLayout

FabTransitionLayout

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

Usage

build.gradle

repositories {

  jcenter() 
}
  dependencies {

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

Layout XML

BottomSheetLayout

<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"

>

<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.fabtransitionlayout.BottomSheetLayout

 android:id="@+id/bottom_sheet"

 android:layout_width="match_parent"

 android:layout_height="match_parent"

 android:layout_gravity="bottom"

 app:ft_container_gravity="center"

 app:ft_color="@color/primary">

 <ListView

  android:id="@+id/list_menu"

  android:background="@color/primary"

  android:divider="@null"

  android:layout_width="match_parent"

  android:layout_height="wrap_content"/>
  </com.bowyer.app.fabtransitionlayout.BottomSheetLayout>  </FrameLayout> 

FooterLayout

<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.fabtransitionlayout.FooterLayout

 android:id="@+id/fabtoolbar"

 android:layout_width="match_parent"

 android:layout_height="wrap_content"

 android:layout_gravity="bottom"

 app:ft_container_gravity="center"

 app:ft_color="@color/primary">

<!--add your original layout-->
  </com.bowyer.app.fabtransitionlayout.FooterLayout> </FrameLayout>

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 

Resources

A Loading View for Android.

The indirect-injector simplify confusion of communication between activity and fragment, and dependencies.

This project allows to add decoration element at the corner of view.

Android Utility classes.

  • Simple logging
  • AppCompatPreferenceActivity
  • Functional Interfaces

VerbalExpressions is a Java library that helps to construct difficult regular expressions.

The RecyclerView is one of the most used widgets in the Android world, and with it you have to implement an Adapter which provides the items for the view. Most use cases require the same base logic, but require you to write everything again and again.

The FastAdapter is here to simplify this process. You don't have to worry about the adapter anymore. Just write the logic for how your view should look like, and you are done.

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