floating-action-button

Android Cannot anchor FAB button to BottomSheet

蓝咒 提交于 2019-12-05 05:24:00
I'm trying to attach a FAB button to the BottomSheet view like Google Maps does. However I cannot make it work, this is the code of the FAB button: <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" android:src="@android:drawable/ic_dialog_email" app:layout_anchor="@+id/nestedscrollview" --> BottomSheet view ID app:layout_anchorGravity="bottom|end" app:elevation="4dp" /> and this is the code of the BottomSheet View <android.support.v4.widget.NestedScrollView

How to set Floating Action Button image to fill the button?

有些话、适合烂在心里 提交于 2019-12-05 03:46:07
Usually icons are set for floating action buttons, but I need to set an image, so I can make a circular image. I added it to the project (using Android Studio-> New -> Image Asset), but the image didn't fill the entire button: My xml: <com.github.clans.fab.FloatingActionMenu android:id="@+id/run_menu" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:paddingBottom="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:visibility="visible" fab:fab_colorNormal="#DA4336" fab:fab_colorPressed="#E75043" fab:fab

My FloatingActionButton has some weird lines coming out of it on 4.4 and lower

心不动则不痛 提交于 2019-12-05 03:40:50
As the title says, my FloatingActionButton has some weird lines coming out of it only on 4.4 or lower. On Lollipop it works fine. This is a picture of the issue: The play image doesn't have those lines in it. My xml: <android.support.design.widget.FloatingActionButton android:id="@+id/play" android:layout_width="48dp" android:layout_height="48dp" android:src="@drawable/ic_av_play_arrow" app:borderWidth="0dp" app:elevation="6dp" app:layout_anchor="@+id/image" app:layout_anchorGravity="center_vertical|right|end" app:rippleColor="@color/color_primary_light" /> So what am I doing wrong? EDIT: goes

Alpha background on FAB clicked

妖精的绣舞 提交于 2019-12-04 23:09:50
问题 I'm using the library https://github.com/futuresimple/android-floating-action-button to create the fab buttons that works pretty well. I tried several libraries but none use the effect used in most application with a fab (or Google apps like keep, inbox) that when the fab is clicked the background of entire application becames semi-transparent white or black, it depends. I can't find any way to do it. Is it possible have an example or something like that to do this kind of effect? You can see

Floating action button not displaying over recyclerview(which is inside a DrawerLayout)

ⅰ亾dé卋堺 提交于 2019-12-04 22:56:12
I am trying to get FAB over recyclerview which in my case will cover the whole screen. The FAB wont display even recyclerview is empty. Following is my xml code. <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" tools:context="com.technistan.ledger.CreateLedger" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent"

How to change FAB background color

断了今生、忘了曾经 提交于 2019-12-04 22:25:17
I am using Floating Action Button and I want to change the background color. Here is my code <android.support.design.widget.FloatingActionButton android:id="@+id/btnfab" android:layout_width="48dp" android:layout_height="48dp" android:layout_alignParentBottom="true" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_gravity="right|center_vertical" android:layout_marginBottom="20dp" android:src="@drawable/search" /> Here is the code I am using to try and achieve this: 1- android:background="@color/mycolor" 2- android:backgroundTint="@color/white" I am

Hide FAB in NestedScrollView when scrolling

試著忘記壹切 提交于 2019-12-04 19:31:12
问题 I am having a nestedscrollview with content like some linearlayouts and textviews. I am using a floatingactionbutton library for some reasons, as well. So I can't use any behavior for it. I don't know how I should handle the scrollchangelistener from scrollview to hide and show the fab dynamically like a behavior. Any suggestions how to hide and show the fab while scrolling? 回答1: Simple add this code below to your NestedScrollView ScrollChangeListener: NestedScrollView nsv = v.findViewById(R

Android shared element transition between two activities does not work

≡放荡痞女 提交于 2019-12-04 15:47:07
问题 In my app I'm trying to use the newly introduced element sharing between activities. Everything works like a charm if the shared element is with fixed position (e.g. android:layout_gravity="top" ) but the problem comes when the view is anchored. My first activity looks like this: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/tools" xmlns:auto="http://schemas.android.com/apk/res-auto" android

Is it possible to increase Floating Action Button size on Android?

空扰寡人 提交于 2019-12-04 14:50:03
I'm working on an application and we want to increase the size of our floating action button on larger devices. The problem is that floating action button comes only in two size ( mini and normal ). First, I tried to set a custom android:layout_height and android:layout_height to my fab but it didn't work. Well, the whole layout did actually got bigger but a border appeared around the fab and the background wasn't fully transparent. Desperate for a solution I created my own circle button view and replaced the floating action button. But that's not good enough. I won't have the cool ripple

CoordinatorLayout, FAB and container layout conflict

我们两清 提交于 2019-12-04 14:34:03
I have a main activity with a drawer that have a container layout where I replace each fragment with FragmentManager . I want to add a FAB to one of my child fragments that hide/show on scroll but Im not sure what Im doing wrong and get: 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:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/appBar" android