0

i have this two nested scroll views. the problem is that, it is only the left view that scroll while the right doesnt scroll at all. The views contains two different set of items in which i want them to scroll independently of each other.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:background="@color/blue_faint"
android:layout_height="match_parent"
android:fitsSystemWindows="true">

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight=".50"
    android:fillViewport="true"
    android:scrollbars="vertical">
<android.support.v7.widget.RecyclerView
    android:id="@+id/recycer_1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight=".50"/>
</android.support.v4.widget.NestedScrollView>
<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight=".50"
    android:fillViewport="true"
    android:scrollbars="vertical">
<android.support.v7.widget.RecyclerView
    android:id="@+id/recycler_2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight=".50"/>
</android.support.v4.widget.NestedScrollView>

</LinearLayout>

Am using them in BottomSheetDialog like this:

        myDiaog = new BottomSheetDialog(this);
        mDialog.setContentView(R.layout.dialog_content);

        mRecycler_1 = mDialog.findViewById(R.id.recycler_1);
        mRecycler_2 = mDialog.findViewById(R.id.recycler_2);


        mRecycler_1.setAdapter(mAdapter);
        mRecycler_2.setAdapter(mAdapter);


        mRecycler_1.setLayoutManager(new LinearLayoutManager(this));
        mRecycler_2.setLayoutManager(new LinearLayoutManager(this));


        mRecycler_1.setHasFixedSize(false);
        mRecycler_1.setHasFixedSize(false);
        mDialog.show()

0 Answers0