Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Floating Action Button for lower version

Tags:

android

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

like image 488
user3487657 Avatar asked Jul 07 '14 07:07

user3487657


People also ask

Does iOS have floating action button?

Sorry, But unfortunately iOS doesn't support such kind of development. You can add the Floating button inside the app but you can't add that over other apps.

How do I change the size of the floating action button?

If you want to set icon size to particular Floating Action Button just go with Floating action button attributes like app:fabSize="normal" and android:scaleType="center".


1 Answers

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.

like image 61
makovkastar Avatar answered Oct 01 '22 14:10

makovkastar