ksoichiro / Android-ObservableScrollView

Android library to observe scroll events on scrollable views.
http://ksoichiro.github.io/Android-ObservableScrollView/
Apache License 2.0
9.66k stars 2.06k forks source link

Using ObservableScrollView with RecyclerView (RecyclerView is hidden) #16

Open manpreetsinghsodhi opened 9 years ago

manpreetsinghsodhi commented 9 years ago

Hi i am trying to use ObservableScrollView in a fragment and for that my layout is as follows <com.github.ksoichiro.android.observablescrollview.ObservableScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scroll" android:layout_width="match_parent" android:layout_height="match_parent"

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

    <android.support.v7.widget.RecyclerView
        android:id="@+id/cardList"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</LinearLayout>

</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>

but the problem is this scroll view widget is hiding my RecyclerView widget. I even tried to make ObservableScrollView widget transparent but still not working.

Thanks

ksoichiro commented 9 years ago

Thank you for your feedback! I think it's better to use its own callbacks for RecyclerView (RecyclerView.OnScrollListener). If you still want to use this library for RecyclerView, ObservableRecyclerView is provided for it. Please try them if you haven't.

kardasch commented 9 years ago

I have the same problem. My layout looks like this, can you help me:

<com.github.ksoichiro.android.observablescrollview.ObservableScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scroll" android:layout_width="match_parent" android:layout_height="match_parent"

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

    <com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView
        android:id="@+id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</LinearLayout>

</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>