1

rcvLatestPromotions.addOnScrollListener(....).. is not calling because of the use of Scrollview. Is there Any solution for this issue? I need both the recyclerViews with addOnScrollListenerworking, having its parent ScrollView.

Please help me to get rid of this issue I will be greatful to you. Thanking in Anticipation.

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@+id/flContainer"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ebebed"
xmlns:app="http://schemas.android.com/apk/res-auto">

    <ScrollView
        android:id="@+id/svContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        android:fitsSystemWindows="true"
        tools:context=".activities.MainNavigationActivity"
        tools:showIn="@layout/app_bar_main_navigation">


            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical"
                android:visibility="visible">

                <TextView
                    android:id="@+id/txtNearPromotions"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="2dp"
                    android:background="@color/colorWhite"
                    android:text="Near by"
                    android:textColor="@color/colorBlack"
                    android:textSize="18sp"/>

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/rcvNearPromotions"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@color/colorRecyclerViewBg"
                    android:nestedScrollingEnabled="false"
                    android:orientation="horizontal"/>

                <TextView
                    android:id="@+id/txtLatestPromotions"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="2dp"
                    android:background="@color/colorWhite"
                    android:text="Latest"
                    android:textColor="@color/colorBlack"
                    android:textSize="18sp"/>

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/rcvLatestPromotions"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@color/colorRecyclerViewBg"
              app:layout_behavior="@string/appbar_scrolling_view_behavior"
                    android:nestedScrollingEnabled="false"/>
            </LinearLayout>
    </ScrollView>

    <com.dev.promotionapp.utils.VerticalTextView
        android:id="@+id/txtOpenDrawer"
        style="@style/verticalTextStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_gravity="center_vertical"
        android:background="@color/colorPrimaryDark"
        android:rotation="180"
        android:text="   Lahore   "
        android:textColor="@color/colorWhite"
        android:textSize="18sp"/>
</FrameLayout>
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

0

It is not a good choice using a scrollable view in a scrollable layout, I think it is not possible, you can not make it, if you needed a use recyclerView/listview in the ScrollView this is the good library to use. https://github.com/paolorotolo/ExpandableHeightListView

haliltprkk
  • 1,428
  • 3
  • 14
  • 26