I use Android Studio 2.0 . I have used RecyclerView and CardView which render properly on kitkat but when the app is run on SAMSUNG A5 with android 5.1.1 (lollipop) the RecyclerView doesn't scroll and my CardView doesn't have elevation and corner.
I tried solutions suggested in SO such as adding
card_view:cardUseCompatPadding="true"
and adding margin.
Even changed
xmlns:card_view="http://schemas.android.com/apk/res-auto"
to
xmlns:card_view="http://schemas.android.com/tools"
But these didn't work
This is my RecyclerView:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/grid_cards_recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:layoutDirection="rtl"
android:padding="2dp"
android:background="#e0e0e0"
/>
RecyclerView GridRecyclerView = (RecyclerView) getActivity().findViewById(R.id.grid_cards_recyclerview);
GridLayoutManager gll = new GridLayoutManager(getActivity(), 2);
GridRecyclerView.setLayoutManager(gll);
GridAdapter gridAdapter = new GridAdapter(getActivity(), mylist);
GridRecyclerView.setAdapter(gridAdapter);
this is a strange behavior: if I move up my finger on screen (scroll down), recyclerview doesn't show any change but if I go to another activity and come back I see the recyclerview has scrolled down!! How do you explain this behavior?! Recyclerview recognizes scroll motion but doesn't show its reaction and doesn't update its view!