amarjain07 / StickyScrollView

Sticky header and footer for android ScrollView.
MIT License
533 stars 86 forks source link

Changes in recycler view the button sticky in bottom blink and disappear #8

Closed javieritis closed 2 years ago

javieritis commented 6 years ago

`<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/refresh_layout" android:layout_width="wrap_content" android:layout_height="wrap_content">

<com.amar.library.ui.StickyScrollView
    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/scrollView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/Pale"
    android:descendantFocusability="blocksDescendants"
    app:stickyFooter="@+id/layout_button_search_opponent"
    tools:context="com.myapp.ui.ListNew">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/White"
            android:descendantFocusability="blocksDescendants">

            <TextView
                android:id="@+id/empty_view_"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:gravity="center"
                android:paddingBottom="20dp"
                android:paddingLeft="16dp"
                android:paddingRight="16dp"
                android:paddingTop="20dp"
                android:textAlignment="center"
                android:textColor="@color/Concrete"
                android:textSize="16sp"
                app:font_type="roboto_regular" />

            <com.myapp.ui.widget.recycler.EmptyRecyclerView
                android:id="@+id/recyclerview"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/White"
                android:nestedScrollingEnabled="false"
                android:orientation="vertical"
                android:overScrollMode="never" />

        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/layout_button_search_opponent"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingBottom="55dp">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/margin_bottom_color_1dp"
                android:paddingBottom="10dp"
                android:paddingLeft="16dp"
                android:paddingRight="16dp"
                android:paddingTop="10dp">

                <TextView
                    android:id="@+id/button_search_opponent"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:background="@drawable/button_rounded_wasabi"
                    android:clickable="true"
                    android:focusable="true"
                    android:foreground="?android:attr/selectableItemBackground"
                    android:gravity="center"
                    android:maxLines="2"
                    android:padding="16dp"
                    android:singleLine="false"
                    android:text="@string/search_opponents"
                    android:textColor="@color/white_ghost"
                    android:textSize="18sp"
                    android:visibility="visible"
                    app:font_type="roboto_medium" />
            </RelativeLayout>

        </RelativeLayout>
    </LinearLayout>
</com.amar.library.ui.StickyScrollView>

</android.support.v4.widget.SwipeRefreshLayout>`

i have this xml, with my recycler view and the button in the bottom of this. I've configured app:stickyFooter = app:stickyFooter="@+id/layout_button_search_opponent"

and when have changes in my recycler view, (notifyItemChanged, notifyItemRemoved, notifyDataSetChanged, etc...) the button sticky in bottom blink and disappears 🤔, its very strange.

any solution? @amarjain07

gouravatwork commented 4 years ago

having same issue.

amarjain07 commented 2 years ago

Fixed in v1.0.3