Flutter floating action button with speed dial

Here’s a sketch of how to implement a Speed dial using FloatingActionButton. import ‘package:flutter/material.dart’; import ‘dart:math’ as math; void main() { runApp(new MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( home: new MyHomePage(), ); } } class MyHomePage extends StatefulWidget { @override State createState() => new MyHomePageState(); } … Read more

FloatingActionButton with text instead of image

Thanks to all. Here is easy workaround which I found for this question. Works correctly for Android 4+, for Android 5+ is added specific parameter android:elevation to draw TextView over FloatingActionButton. <FrameLayout android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”bottom|right”> <android.support.design.widget.FloatingActionButton android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:src=”https://stackoverflow.com/questions/33671196/@android:color/transparent” /> <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”center” android:text=”@android:string/ok” android:elevation=”16dp” android:textColor=”@android:color/white” android:textAppearance=”?android:attr/textAppearanceMedium” /> </FrameLayout>

Android Design Support Library expandable Floating Action Button(FAB) menu

Got a better approach to implement the animating FAB menu without using any library or to write huge xml code for animations. hope this will help in future for someone who needs a simple way to implement this. Just using animate().translationY() function, you can animate any view up or down just I did in my … Read more

Android How to implement Bottom Sheet from Material Design docs

Edit The BottomSheet is now part of the android-support-library. See John Shelleys’ answer. Unfortunately there’s currently no “official” way on how to do this (at least none that I’m aware of). Luckily there’s a library called “BottomSheet” (click) which mimics the look and feel of the BottomSheet and supports Android 2.1 and up. In case … Read more

InflateException with FloatingActionButton from Official Design Library

com.android.support:appcompat-v7:21+ added support for tinting widgets on devices running pre android 5.1 (API Level 21). To make use of it make sure you extend or set the AppCompat Theme and use app:backgroundTint instead of android:backgroundTint. Example: <android.support.design.widget.FloatingActionButton xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/fab” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_margin=”16dp” android:src=”https://stackoverflow.com/questions/30870443/@drawable/icon” app:backgroundTint=”@color/accent” app:borderWidth=”0dp” />

Android changing Floating Action Button color

As described in the documentation, by default it takes the color set in styles.xml attribute colorAccent. The background color of this view defaults to the your theme’s colorAccent. If you wish to change this at runtime then you can do so via setBackgroundTintList(ColorStateList). If you wish to change the color in XML with attribute app:backgroundTint … Read more

FloatingActionButton example with Support Library

So in your build.gradle file, add this: compile ‘com.android.support:design:27.1.1′ AndroidX Note: Google is introducing new AndroidX extension libraries to replace the older Support Libraries. To use AndroidX, first make sure you’ve updated your gradle.properties file, edited build.gradle to set compileSdkVersion to 28 (or higher), and use the following line instead of the previous compile one. … Read more