Flaoating Action button position - android

I tried adding the floating action button but just not able to get it to position in the expected place.I've the xml along with the obtained and expected image.
Actually I want two such floating action buttons one on top of the other.
MapsActivity
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/maplinear"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:theme="#style/AppTheme">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment
android:id="#+id/place_autocomplete_fragment"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<fragment xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.srinivas.democomplete.MapsActivity" />
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:clickable="true"
app:srcCompat="#android:drawable/ic_dialog_email"
/>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="#+id/autoComplete"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#303F9F"
android:text="Auto Complete"
android:textColor="#ffffff"
android:visibility="visible" />
<View
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:background="#ffffff" />
<Button
android:id="#+id/bsolarpanel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#303F9F"
android:text="Add solar panels"
android:textColor="#ffffff" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
Any help would be great thx!

Just remove the line
android:layout_gravity="bottom|end"
You can use margin to set it according to your need
UPDATE
You can add some more attributes like
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"

Related

Fragment layout not covering entire screen

I was trying to have a map displayed on one of the fragments of the Bottom Navigation.
But, attached fragment is not covering complete screen. i tried adding background color to the fragment is as below:
While trying to add a map to the fragment it also is not convering the complete screen instead it shows only a bit of the screen.
Below my layout code:
Bottom Navigation.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_5">
<include
android:id="#+id/search_bar"
layout="#layout/include_card_view_search_bar" />
<androidx.core.widget.NestedScrollView
android:id="#+id/nested_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:scrollingCache="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginBottom="#dimen/spacing_middle" />
<FrameLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/blue_500"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:background="#color/blue_grey_700"
app:itemIconTint="#drawable/color_state_white_2"
app:itemTextColor="#drawable/color_state_white_2"
app:menu="#menu/menu_bottom_navigation_shifting" />
</RelativeLayout>
My Map Fragment:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="#drawable/bg_gradient_soft" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#android:color/white"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal"
android:padding="#dimen/spacing_medium">
<ImageButton
android:id="#+id/map_button"
android:layout_width="?attr/actionBarSize"
android:layout_height="?attr/actionBarSize"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="clickAction"
android:tint="#color/colorPrimary"
app:srcCompat="#drawable/ic_near_me" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Map"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Subhead"
android:textColor="#color/colorPrimary"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="?attr/actionBarSize"
android:layout_height="0dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:padding="#dimen/spacing_medium">
<ImageButton
android:id="#+id/list_button"
android:layout_width="?attr/actionBarSize"
android:layout_height="?attr/actionBarSize"
android:background="?attr/selectableItemBackgroundBorderless"
android:onClick="clickAction"
android:tint="#color/colorPrimary"
app:srcCompat="#drawable/ic_format_list_bulleted" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="List"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Subhead"
android:textColor="#color/colorPrimary"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/add_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:layout_marginBottom="15dp"
android:clickable="true"
android:onClick="clickAction"
android:tint="#android:color/white"
app:backgroundTint="#color/colorPrimary"
app:elevation="2dp"
app:fabSize="normal"
app:rippleColor="#color/deep_orange_400"
app:srcCompat="#drawable/ic_add" />
</RelativeLayout>
Attaching the Map using my code:
mapFragment = (SupportMapFragment) this.getChildFragmentManager().findFragmentById(R.id.map);
The app looks like below:
add android:fillViewport="true" in NestedScrollView
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_5">
<include
android:id="#+id/search_bar"
layout="#layout/include_card_view_search_bar" />
<androidx.core.widget.NestedScrollView
android:id="#+id/nested_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:scrollingCache="true"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginBottom="#dimen/spacing_middle" />
<FrameLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/blue_500"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:background="#color/blue_grey_700"
app:itemIconTint="#drawable/color_state_white_2"
app:itemTextColor="#drawable/color_state_white_2"
app:menu="#menu/menu_bottom_navigation_shifting" />
</RelativeLayout>
If NestedScrollView is not necessary try using some other ViewGroup i.e LinearLayout or RelativeLayout in its place. It seems the issue is in wrapping fragment content inside NestedScrollView.
You have taken FrameLayout(id-content) inside NestedScrollView, try removing NestedScrollView from there and adding it to the layout by which you are replacing it with FrameLayout(id-content)

Bottomsheet dialog always appear on UI instead of disapear

I have a problem when create bottomsheet in android (look likes google maps)
when i come to maps ui,but bottom sheet does not hide
Expectation: Click on marker and appear the bottom sheet likes google maps
Here is my xml :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.dangquang.stackexchange.activity.MapActivity">
<android.support.v7.widget.Toolbar
android:id="#+id/actMap_Toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:titleTextColor="#android:color/white">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/title_maps"
android:textSize="#dimen/title_nav_toolbar" />
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.Toolbar
android:id="#+id/actMap_tbDetail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/actMap_tvDuration"
style="#style/title_detail_direction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="#drawable/duration_icon" />
<TextView
android:id="#+id/actMap_tvDistance"
style="#style/title_detail_direction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="#drawable/distance_icon" />
<Spinner
android:id="#+id/actMap_spnMode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<TextView
android:id="#+id/actMap_tvDirection"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="#dimen/_5sdp"
android:textColor="#android:color/white"
android:textSize="#dimen/_14sdp" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
<EditText
android:id="#+id/actMap_etSearch"
style="#style/action_searchMap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/place_autocomplete_search_hint"
android:imeOptions="actionSearch"
android:inputType="text" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="#+id/actMap_frgMaps"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
>
<android.support.v4.widget.NestedScrollView
android:id="#+id/actMap_BottomSheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/actMap_tvDetailName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="#dimen/item_title_size"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/actMap_tvDetailPoint"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1" />
<TextView
android:id="#+id/actMap_tvDetailDuration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="#drawable/car_icon"
style="#style/navigation_item_text" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
</FrameLayout>
</LinearLayout>
You can set bottomsheet invisible on onCreate with this actMap_BottomSheet.setVisibility(View.INVISIBLE) and make it visible whenever you want.
But your xml is so complex and has so many nested levels which causes to performance issues. I suggest you to use constraint layout.

How to make Float Action Button at right of bottom of the page

I just created a Float Action button and put the attributes aliign parent bottom and right but it doesn't shown I don't know what I did wrong exactly here's my xml code................................................
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/activity_show_order"
android:layout_width="368dp"
android:layout_height="624dp"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp"
tools:context="abtech.waiteriano.com.waitrer.PaymentActivity">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="#f0ff4800"
android:minHeight="?attr/actionBarSize" />
<ListView
android:layout_width="fill_parent"
android:id="#+id/showOrderListID"
android:layout_height="wrap_content"
tools:layout_editor_absoluteY="8dp"
tools:layout_editor_absoluteX="8dp"
android:layout_alignParentStart="true"
android:layout_below="#id/toolbar"/>
<TextView
android:id="#+id/tvPayment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/showOrderListID"
android:text="Payment Type:" />
<Spinner
android:id="#+id/paymentSpinner"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:background="#drawable/spinner_bg"
android:stateListAnimator="#drawable/spinner_sla"
android:layout_below="#+id/showOrderListID"
android:layout_alignBottom="#+id/tvPayment"
android:layout_toEndOf="#+id/tvPayment" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="#drawable/pay" />
</RelativeLayout>
use this layout:
Remove height , width declaration and use match_parent attribute..and use FrameLayout as a Root layout.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_show_order"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="#f0ff4800"
android:minHeight="?attr/actionBarSize" />
<ListView
android:id="#+id/showOrderListID"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="#id/toolbar"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp" />
<TextView
android:id="#+id/tvPayment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/showOrderListID"
android:text="Payment Type:" />
<Spinner
android:id="#+id/paymentSpinner"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/tvPayment"
android:layout_below="#+id/showOrderListID"
android:layout_toEndOf="#+id/tvPayment"
android:background="#drawable/bottom_border_help"
android:stateListAnimator="#drawable/bottom_border_help" />
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_gravity="bottom|end"
android:src="#mipmap/ic_launcher" />
</FrameLayout>
<android.support.design.widget.FloatingActionButton xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/fbLiveAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="#dimen/scale_16dp"
android:layout_marginEnd="#dimen/scale_16dp"
android:layout_marginRight="#dimen/scale_16dp"
android:clickable="true"
android:src="#drawable/ic_add_black_24dp"
app:backgroundTint="#color/color_f27f17" />

How to best fit a customview of Floating Action Button together with Listview

I have a XML layout with edittext listview and a fab included in a linearlayout which it takes a large part on screen and if I remove weight or play with it I get a very small button or cropped.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/inputSearch"
android:hint="Αναζητηση" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="4dp">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/listCustomers"
android:layout_margin="5dp"
android:dividerHeight="2dp" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:layout_gravity="bottom|center"
android:gravity="right"
android:layout_margin="4dp">
<android.support.design.widget.FloatingActionButton
android:layout_width="56dp"
android:layout_height="56dp"
android:id="#+id/fab"
app:backgroundTint="#android:color/holo_orange_light"
android:layout_gravity="bottom|center"
android:layout_margin="10dp"
android:src="#drawable/ic_action_cross" />
</LinearLayout>
How I can have a best fit of these three elements here?
Replace your complete layout with below:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">
<EditText
android:id="#+id/inputSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Αναζητηση"
android:inputType="textPersonName" />
<ListView
android:id="#+id/listCustomers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/inputSearch"
android:layout_margin="9dp"
android:dividerHeight="2dp" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_margin="14dp"
android:src="#drawable/ic_action_cross"
app:backgroundTint="#android:color/holo_orange_light" />
</RelativeLayout>

Making the new floating action button's position static

How would I go about making my FAB have a static position. i.e it doesn't go up or down on scroll with coordinator layout? I don't see an option in res-auto or regular android namespaces..
Here's the layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
android:id="#+id/root"
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">
<RelativeLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/search_polls_toolbar"
android:layout_width="match_parent"
android:layout_height="?android:actionBarSize"
android:background="#color/icitizen_toolbar_orange"
android:weightSum="1"
>
<!--<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="2dp"
android:layout_marginTop="5dp"
android:background="#drawable/magnifying_glass"/>-->
<EditText
android:id="#+id/search_polls"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="#string/search_polls"
android:gravity="center_horizontal"
android:layout_weight=".5"
android:drawableLeft="#drawable/magnifying_glass"
android:drawableStart="#drawable/magnifying_glass"
android:layout_marginTop="5dp"
android:layout_marginLeft="15dp"
android:drawablePadding="-50dp"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:paddingBottom="10dp"
android:cursorVisible="false"
android:textSize="20sp"
android:background="#color/icitizen_light_orange"
/>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/poll_horizontal_recycler_view"
android:layout_width="match_parent"
android:layout_height="75dp"
android:layout_below="#id/search_polls_toolbar"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:scrollbars="none"
>
</android.support.v7.widget.RecyclerView>
<android.support.v7.widget.RecyclerView
android:id="#+id/poll_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_below="#id/poll_horizontal_recycler_view"
android:scrollbars="vertical" />
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/polls_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/white_plus_icon"
android:layout_marginBottom="70dp"
app:backgroundTint="#color/icitizen_orange"
app:layout_anchor="#id/container"
app:layout_anchorGravity="bottom|right|end"
app:borderWidth="0dp"
android:layout_marginRight="15dp"
android:layout_marginEnd="15dp"/>
</android.support.design.widget.CoordinatorLayout>
Tried to put fab button in side Frame layout.
this this,
<FrameLayout
android:id="#+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fabBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:src="#drawable/ic_plus"
app:fabSize="normal" />
</FrameLayout>

Categories

Resources