floating-action-button

Android: Floating Button Icon is not centred

自作多情 提交于 2019-12-03 19:47:56
问题 I'm trying to create a floating button in my app. The button is there, but the image in the button is a bit upwards (see image). I can't figure out what's wrong with it. Below is part of the XML for floating button. <android.support.design.widget.FloatingActionButton android:id="@+id/buttonUp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="16dp" android:layout_marginTop="480dp" android:clickable="true" android:scaleType="center" android

Show/Hide FloatingActionButton on ViewPager swipe

笑着哭i 提交于 2019-12-03 17:42:17
问题 I have an activity that has 3 tabs. Each tabs page is a fragment which displays a RecyclerView. One of the fragment has FloatingActionButton in it. I'm implementing this Button in the Fragment's layout. I'm also making it static at the bottom right of the Fragment. Fragment layout: - CoordinatorLayout - RecyclerView - FAB (without any behavior) In Activity layout, I have: - CoordinatorLayout - AppBarLayout - Toolbar - TabLayout (SmartTabLayout) - ViewPager The problem now is the FAB is half

Is it possible to set different actions for floating action button in differet fragments?

天涯浪子 提交于 2019-12-03 17:29:24
I am working or an app where I have 4 fragments in viewpager and floating action button (fab). When I click on fab there appear 3 subfabs. Each of them start different activities where user can search data from different fragments. Is it possible to set fab so that if I click on it while I'm in first fragment it'll open an activity for searching inside this fragment, onClick inside second - search for second and etc. The issue is that now clicking on sub fab while I'm in some fragment I can search data from another fragment too and it's a bit weird. I understand question is kinda strange, if

How to make Floating Action Button background Gradient?

蓝咒 提交于 2019-12-03 17:13:25
The code for FAB: <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right|end" android:layout_margin="16dp" android:src="@drawable/add_chat" android:tint="@android:color/white" /> </android.support.design.widget.CoordinatorLayout> The code for gradient background: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <gradient android:angle="90" android:endColor="#e4849f" android:startColor="#d96e30" /> </shape> android:backgroundTint

Make FAB respond to Soft Keyboard show/hide changes

浪尽此生 提交于 2019-12-03 16:42:42
问题 I've seen various posts about FABs responding to Snackbar popups at the bottom of the screen as well as scroll-sensitive FABs. But is there some implementation of FloatingActionButton.Behavior (or similar) to move the FAB above the keyboard when it pops up? Right now, the keyboard covers the FAB when I click for example in an EditText box. My goal is to animate the FAB so it is always visible, independent of the keyboard status. EDIT: Both android:windowSoftInputMode="adjustResize" and ...=

floating action button on react native

人走茶凉 提交于 2019-12-03 16:25:05
问题 I want to use a floating action button in react native android in bottom right corner of the screen. But I am not able to do so. The CreateButton component contains floating button code. I called the CreateButton component after the list View and I want to show this button on the ListView android component with transparent overlay and fixed position in bottom right. <DrawerLayoutAndroid drawerWidth={300} drawerPosition={DrawerLayoutAndroid.positions.Left} renderNavigationView={() =>

onNestedScroll called only once

こ雲淡風輕ζ 提交于 2019-12-03 14:52:56
I have a class public class ScrollAwareFABBehavior extends FloatingActionButton.Behavior { public ScrollAwareFABBehavior(Context context, AttributeSet attrs) { super(); } public ScrollAwareFABBehavior() { super(); } @Override public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,final View directTargetChild, final View target, final int nestedScrollAxes) { return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL; } @Override public void onNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,final

Alpha background on FAB clicked

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 14:10:53
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 what i mean in this image: The semi-black background <?xml version="1.0" encoding="utf-8"?>

AdView and FloatingActionButton overlap while using CoordinatorLayout

ε祈祈猫儿з 提交于 2019-12-03 12:13:34
问题 After incorporating the new CoordinatorLayout in one of my layouts, I have an issue with Adview s overlapping with FloatingActionButton . <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="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width=

How to disable RecyclerView Items from clicking

随声附和 提交于 2019-12-03 11:59:41
I am using Floating Action Button. I want to disable Recyclerview Items from Clicking when i press FAB button. I tried this method but not working setClickable(true); My Layout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fab="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="#fff" tools:context="com.hartwintech.socialchat.activity.IconTabsActivity"> <android.support.v7.widget