user3487657
user3487657

Reputation: 553

Floating Action Button for lower version

Is there a way I can Achieve the floating button to work on 4.0 and later android??

I've seen it on google plus but I haven't found any tutorial. Only for android l preview. What did google+ use to achieve it?

enter image description here

enter image description here

Upvotes: 10

Views: 24502

Answers (6)

Vladyslav Baidak
Vladyslav Baidak

Reputation: 338

Here is one aditional free Floating Action Button library for Android It has many customizations and requires SDK version 9 and higher

enter image description here

Full Demo Video

dependencies {
    compile 'com.scalified:fab:1.1.2'
}

Upvotes: 4

makovkastar
makovkastar

Reputation: 5020

You can now use the FloatingActionButton from the support-design library. Add this dependency to your gradle build file:

compile 'com.android.support:design:22.2.0'

And then add the FloatingActionButton to your layout file:

 <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end|bottom"
        android:layout_margin="@dimen/fab_margin"
        android:src="@drawable/ic_done" />

Example project from Chris Banes: https://github.com/chrisbanes/cheesesquare.

Upvotes: 10

Jarana Manotumruksa
Jarana Manotumruksa

Reputation: 180

Try this library, https://github.com/navasmdc/MaterialDesignLibrary

It can be easily to adapt to your project using Android Studio

Upvotes: -1

Oleksii K.
Oleksii K.

Reputation: 5419

Original post is here.

You can use this library, it works well from the Android 2.1, API level 7.

It's so easy to include it in your project:

build.gradle

dependencies {
    compile 'com.shamanland:fab:0.0.6'
}

layout.xml

<com.shamanland.fab.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/your_image"
    />

image

Upvotes: 3

makovkastar
makovkastar

Reputation: 5020

I created an open-source library called FloatingActionButton. It's a Google+ like floating action button which reacts on the list view scrolling events. Becomes visible when the list view is scrolled up and invisible when scrolled down. API level 14+.

Demo

Upvotes: 7

joselufo
joselufo

Reputation: 3415

You can use this demo FloatingView. This demo work from API 11.

Here put all the parts necessary to implement by code. FloatingView by steps

Upvotes: 1

Related Questions