Janekxyz
Janekxyz

Reputation: 111

SlidingUpPanelLayout problem with visibility

I have a problem with SlidingUpPanelLayout. My view is build like that:

 <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
        android:id="@+id/list_sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="top"
        sothree:umanoDragView="@+id/dragView"
        sothree:umanoOverlay="true"
        sothree:umanoPanelHeight="@dimen/filtering_list_closed_height"
        sothree:umanoShadowHeight="@dimen/app_bar_elevation">

        <androidx.coordinatorlayout.widget.CoordinatorLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            // some views

        </androidx.coordinatorlayout.widget.CoordinatorLayout>

        <FrameLayout
            android:id="@+id/list_filtering_fragment_container"
            android:name="com.example.test.scenes.list.filtering.FilteringFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </com.sothree.slidinguppanel.SlidingUpPanelLayout>

and it was working until I've added new feature where I have to set list_filtering_fragment_container visibility to GONE. Everything works fine when I switch visibility status but it's not working when I move to another fragment and come back to previous one.

EDIT

It looks like:

Normal state that I want to achieve after set visibility to VISIBLE

BEFORE

State that I have after set visibility to VISIBLE (after changing fragments)

enter image description here

also I can see in layout inspector that location on Screen and height of this element is different for both cases. I tried to use slidingUpPanel.setPanelState(PanelState.HIDDEN) but it for some reason doesn't work in 100% cases. It look like view goes outside screen and doesn't come back to it's proper position. And question is why it behaves like that?

Upvotes: 0

Views: 266

Answers (0)

Related Questions