0

Problem is I am unable to scroll through my content I have generated through recyclerview and cardview nest inside it as a repeating layout for adapter, but scrolling isn't working by Touch but when I press down keyboard key content is scrolling

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
        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:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/bgSec"
        tools:context=".MainActivity">
    <android.support.v4.widget.DrawerLayout
            android:id="@+id/drawer_layout"
            android:elevation="50dp"
            android:layout_width="match_parent"
            android:fitsSystemWindows="true"
            android:layout_height="match_parent">
        <include layout="@layout/app_bar"
                 android:layout_height="match_parent"
                 android:layout_width="match_parent"/>
        <android.support.design.widget.NavigationView
                android:id="@+id/nav_view"
                android:layout_gravity="start"
                android:fitsSystemWindows="true"
                app:headerLayout="@layout/header_layout"
                app:menu="@menu/side_menu"
                android:layout_width="wrap_content"
                android:layout_height="match_parent">
            <LinearLayout
                    android:layout_width="match_parent"
                    android:orientation="vertical"
                    android:layout_gravity="bottom"
                    android:background="#000"
                    android:layout_height="150dp">
            </LinearLayout>
        </android.support.design.widget.NavigationView>
    </android.support.v4.widget.DrawerLayout>

    <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent" android:layout_alignParentStart="true"
            android:layout_alignParentTop="true"/>
</RelativeLayout>

and card_view.xml is below

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content">
    <android.support.v7.widget.CardView
            android:id="@+id/card_view"
            android:background="@color/bgWhite"
            app:cardElevation="5dp"
            android:layout_width="match_parent"
            android:layout_margin="10dp"
            android:layout_height="300dp">

        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="None"
                android:id="@+id/category_name"/>

    </android.support.v7.widget.CardView>
</RelativeLayout>

Expected to scroll by touch but scrolling by keyboard down arrow key instead

Markus Kauppinen
  • 3,025
  • 4
  • 20
  • 30
Reactorboy
  • 41
  • 5
  • I tried to compare it to a similar project that i made the only difference i found was that inside RecyclerView i have this line android:scrollbars="vertical" I am not sure if that would help but give it a try any way. you should also give a try to this [RecyclerView doesn't scroll](https://stackoverflow.com/a/47922567/9233991) TL;DR they put the content inside DrawerLayout and it started working – Dor Jun 12 '19 at 07:35
  • already done that scrollbar thing and also done thing from post you have referenced, still no help is it because constrain layout @Dor – Reactorboy Jun 12 '19 at 09:52
  • Could be, some one said he got a problem with scrolling in constrain layout [here](https://stackoverflow.com/a/45397257/9233991) – Dor Jun 12 '19 at 09:59
  • problem solved when Recyclerview inside drawer but ovverlapping navigation bar – Reactorboy Jun 12 '19 at 12:24

0 Answers0