C#
Switch branches/tags
Nothing to show
Latest commit 3edae17 Jul 5, 2014 @Cheesebaron Update README.md
Permalink
Failed to load latest commit information.
FloatingActionButton Initial port. Jul 5, 2014
Sample Initial port. Jul 5, 2014
Screenshots Added screenshots. Jul 5, 2014
.gitignore Added csharp gitignore. Jul 5, 2014
FloatingActionButton.sln Initial port. Jul 5, 2014
LICENSE Initial commit Jul 5, 2014
README.md

README.md

FloatingActionButton

A port of Faiz Malkani's FloatingActionButton backport, which backports the Floating Action Button from Android L to API 15 and up.

Drawables contained in the FAB are 24dp, and this is the preferred size.

ss2

Instructions

  1. Use a FrameLayout to layer your layouts, and place the FAB in the bottom to make it appear on top:

    <FrameLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <!--
        Your layouts here. Do not put anything below the FAB layout,
        unless you want it to overlap it.
        -->
    
    
        <dk.ostebaronen.floatingactionbutton.Fab
            android:id="@+id/fabbutton"
            android:layout_width="72dp"
            android:layout_height="72dp"
            android:layout_gravity="bottom|right"
            android:layout_marginBottom="16dp"
            android:layout_marginRight="16dp" />
    
    </FrameLayout>
  2. Initialize FAB in your Activity's OnCreate() method:

    var fab = FindViewById<Fab>(Resource.Id.fabbutton);
  3. Use the FabColor and FabDrawable methods to change the color and image inside of it:

    fab.FabColor = Color.Blue;
    fab.FabDrawable = Resources.GetDrawable(Resource.Drawable.ic_my_fab);
  4. Use Hide() and Show() to hide and show the FAB. Use the Alpha property to set the transparency. Assign the Click event to handle user clicks on the FAB.

License

This derivative work is licensed under The MIT License (MIT).