JorgeCastilloPrz / FABProgressCircle

Material progress circle around any FloatingActionButton. 100% Guidelines.
1.25k stars 181 forks source link

FABPC + CoordinatorLayout in Fragment + TabLayout = Wrong Placement #38

Open dmfrey opened 7 years ago

dmfrey commented 7 years ago

I put a FABProgressCircle in CoordinatorLayout, which is in a Fragment. The parent activity also sets up a TabLayout, also in a CoordinatorLayout. The FABProgressCircle is partially covered by the phone's bottom navigation.

Take a look at this screenshot. screenshot_20170208-205233

activity layout:

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                android:title="@string/all_videos"
                app:layout_scrollFlags="scroll|enterAlways"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:tabGravity="fill"
                app:tabMode="fixed" />

        </android.support.design.widget.AppBarLayout>

        <FrameLayout
            android:id="@+id/frame_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    </android.support.design.widget.CoordinatorLayout>

    <include layout="@layout/mini_controller" />

</RelativeLayout>

<include layout="@layout/phone_navigation_view" />

</android.support.v4.widget.DrawerLayout>

fragment layout

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.v7.widget.RecyclerView
    android:id="@+id/rv_mediaItems"
    android:scrollbars="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<include
    layout="@layout/phone_fab_view" />

</android.support.design.widget.CoordinatorLayout>

fab layout

<com.github.jorgecastilloprz.FABProgressCircle xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fabProgressCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
app:arcColor="@color/accent"
app:arcWidth="7dp"
app:finalIcon="@drawable/ic_check_white_24dp"
app:reusable="true"
app:layout_behavior="org.mythtv.android.presentation.utils.FABProgressCircleBehavior">

<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="@drawable/ic_autorenew_white_24dp"
    app:layout_behavior="org.mythtv.android.presentation.utils.ScrollAwareFABBehavior" />

</com.github.jorgecastilloprz.FABProgressCircle>
dmfrey commented 7 years ago

It doesn't seem to have anything to do with the TabLayout. I put it on another page without one (and any tabs) and it still happens. I originally was thinking it was from extra space in the action bar tabs.

dmfrey commented 7 years ago

I believe this was a result of multiple coordinator layouts (one in activity and one in fragment). Can someone confirm?