В моем файле макета xml у меня есть вложенное представление прокрутки, внутри вложенного просмотра прокрутки есть повторный просмотр. Но проблема в том, что когда я помещаю recycleview во вложенный scrollview, я не получаю
- findFirstCompletelyVisibleItemPosition ()
- findFirstVisibleItemPosition ()
и другим методом.
Согласно моему требованию требуется вложенная прокрутка, так что мне нужно сделать для получения findFirstVisibleItemPosition или findFirstVisibleItemPosition. если я прокручиваю прокрутку с вложенными комментариями, то я получаю и то и другое, но необходима вложенность Пожалуйста, помогите мне решить эту проблему.
Код:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/rvPost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
// other layout view also here...
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
И для получения позиции:
poistion.add(((GridLayoutManager) mCurrentLayoutManager).findFirstCompletelyVisibleItemPosition());
Над кодом работает без вложенной прокрутки, но не работает с вложенный свиток.