Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dmfrey opened this issue Feb 9, 2017 · 2 comments
Open

Comments

@dmfrey
Copy link

dmfrey commented Feb 9, 2017

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
Copy link
Author

dmfrey commented Feb 9, 2017

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
Copy link
Author

dmfrey commented Feb 11, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant