Skip to content

touchGuardDrawable doesn't work in fragment  #87

@albe3188

Description

@albe3188

I have a main activity on which fragments are displayed.

I use a library, SpaceTabLayout that needs two elements in the main_activity.xml:

  • View pager (match_parent and match_parent)
  • Space tab layuot (bar at the bottom which is wrap_content and wrap_content but still occupies the whole layout as if it were match_parent).

When I insert the FabSpeedDial (match_parent), everything works correctly apart from the touchGuardDrawable function that does not obscure the fragment.

<androidx.constraintlayout.widget.ConstraintLayout
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"
tools:context=".activity.MainActivity"
android:id="@+id/main_layout"
>

<androidx.viewpager.widget.ViewPager
    android:id="@+id/viewPager"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="@+id/spaceTabLayout"
    android:layout_marginBottom="58dp"
    />

<io.github.yavski.fabspeeddial.FabSpeedDial
    android:id="@+id/fab_menu"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="30dp"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:fabDrawable="@drawable/ic_info_white_48dp"
    app:fabBackgroundTint="@color/white"
    app:fabGravity="top_end"
    app:fabMenu="@menu/menu"
    app:miniFabBackgroundTint="@android:color/white"
    app:miniFabDrawableTint="?attr/colorPrimaryDark"
    app:miniFabTitleTextColor="?attr/colorPrimaryDark"
    app:touchGuard="true"
    android:touchscreenBlocksFocus="true"
    app:touchGuardDrawable="@color/white_semi_transparent"
    />

<eu.long1.spacetablayout.SpaceTabLayout
    android:id="@+id/spaceTabLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:icon_one="@drawable/ic_nfc_white_24dp"
    app:icon_two="@drawable/ic_home_white_24dp"
    app:icon_three="@drawable/ic_format_list_bulleted_white_24dp"
    app:icon_four="@drawable/ic_people_white_24dp"
    app:starting_position="three"
    app:number_of_tabs="four"
    app:layout_behavior="eu.long1.spacetablayout.SpaceTabLayoutBehavior"
    app:tab_color="@color/drfire_brand_primary_light_new"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:button_color="@color/grey"
    app:text_color="@color/white"
    />

</androidx.constraintlayout.widget.ConstraintLayout>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions