floating-action-button

Moving Floating Action Button up and down to avoid getting blocked by a snackbar

偶尔善良 提交于 2019-11-27 10:47:25
问题 I'm using this library to implement a floating action bar and I can't seem to find a way to move the button when a snackbar appears on screen. Is it even possible with that library? 回答1: To anyone looking out for answer in future.. Coordinator Layout used as Parent Layout of Floating Action Button will handle the animation effect for you automatically. The floating action button has a default behavior that detects Snackbar views being added and animates the button above the height of the

Android Design Library - Floating Action Button Padding/Margin Issues

天涯浪子 提交于 2019-11-27 10:20:57
I'm using the new FloatingActionButton from the Google Design Library and I am getting some strange padding/margin problems. This image (with developer layout options on) is from API 22. And from API 17. This is the XML <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_gravity="bottom|right" android:layout_marginLeft="16dp" android:layout_marginRight="20dp" android:layout_marginTop="-32dp" android:src="@drawable/ic_action_add" app:fabSize="normal"

Android L FAB Button shadow

那年仲夏 提交于 2019-11-27 09:38:19
问题 In the Material Design guidelines Google presented a new style of button, the FAB Button . I found instructions how to make it but I have trouble adding the shadow. How can this be achieved? 回答1: Check out the "activity.java", there is probably the code you need. I made the Fab - Button like this: layout.xml <Button style="?android:attr/buttonStyleSmall" android:layout_width="56dp" android:layout_height="56dp" android:text="+" android:textSize="40sp" android:background="@drawable/ripple"

FAB animation with viewpager/tabslider

百般思念 提交于 2019-11-27 06:41:48
I'm trying to find way to achieve such effect https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B6Okdz75tqQsVlhxNGJCNTEzNFU/components-buttons-fab-behavior_04_xhdpi_009.webm I'm using android.support.v4.view.ViewPager I appreciate any hints and help First, you need to have the layout with the floating action button anchored to the ViewPager: <android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id

Flutter floating action button with speed dial

*爱你&永不变心* 提交于 2019-11-27 05:22:49
问题 Is there any ready made widget or where to get started floating action button with speed dial actions in Flutter. 回答1: 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

Error inflating class android.support.design.widget.CoordinatorLayout

你离开我真会死。 提交于 2019-11-27 01:34:35
问题 I would like use a FloatingActionButton on my application, I read this : https://guides.codepath.com/android/Floating-Action-Buttons#google-s-official-support-library but when I run the Activity I have this error : java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xavier_laffargue.podcast/com.xavier_laffargue.podcast.ACT_Test}: android.view.InflateException: Binary XML file line #1: Error inflating class android.support.design.widget.CoordinatorLayout XML File <android

Hide FloatingActionButton on scroll of RecyclerView

倖福魔咒の 提交于 2019-11-27 00:34:40
问题 I want to hide/show FloatingActionButton on scroll of RecyclerView . My XML layout : <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v7.widget.RecyclerView android:id="@+id/recyclerview_eventlist" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab_createevent" android:layout_width="wrap_content" android

Android How to implement Bottom Sheet from Material Design docs

佐手、 提交于 2019-11-26 23:24:55
How do you implement the bottom sheet specficiation? http://www.google.com/design/spec/components/bottom-sheets.html The new update to Google Drive shows this with the Floating Action Button press -> Granted the specs never say anything about rounded corners, regardless it is possible to do, just unsure of how to go about it. Currently using the AppCompat library and target set to 21. Thanks reVerse 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).

FloatingActionButton doesn't hide

一曲冷凌霜 提交于 2019-11-26 22:44:52
问题 I am trying to hide my FloatingActionButton fabLocation programmatically with : fabLocation.setVisibility(View.GONE) but it does not work. If I add android:visibility="gone" in my XML layout, fabLocation is hidden when I run my activity but it reappears when I scroll. Here is my layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id

How to add shadow to the FAB provided with the android support design library?

不问归期 提交于 2019-11-26 22:19:33
The title is pretty self explaining. The following code does not render shadow below the Floating Action Button. What can be done to render shadow? Is this feature really not supported even on API 21+? <android.support.design.widget.FloatingActionButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:src="@drawable/ic_add" android:clickable="true" /> Note: Adding android:elevation does not add shadow on API 21. Screenshot taken from the example by dandar3: https://github.com/dandar3/android-support-design Simply setting app:borderWidth="0dp" resolve this issues