0

I use RecylerView and CardView in my app and this my dependencies in build.gradle file:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    compile 'co.ronash.pushe:android-lib:0.9.1'        
    compile('com.mikepenz:materialdrawer:5.1.2@aar') {
        transitive = true
    }        
    compile('com.mikepenz:crossfadedrawerlayout:0.3.2@aar')
    compile 'com.mikepenz:google-material-typeface:2.2.0.1@aar'
    compile 'com.mikepenz:fontawesome-typeface:4.4.0.1@aar'
    compile 'com.mikepenz:octicons-typeface:3.0.0.1@aar'

    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
    compile 'com.github.bluejamesbond:textjustify-android:2.1.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.github.jd-alexander:LikeButton:0.2.0'
    compile project(':material_rey')
    }

my app works in kitkat correctly. Should I add these dependencies to my build.gradle or not? what is the difference?

compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'

I use Android Studio 2.0 . when I run my app on SAMSUNG A5 with android 5.1.1 (lollipop) my RecyclerView doesn't scroll and my CardView doesn't have shadow and corner. I try solutions suggested in SO such as adding card_view:cardUseCompatPadding="true" or adding margin .even change xmlns:card_view="http://schemas.android.com/apk/res-auto" to xmlns:card_view="http://schemas.android.com/tools" doesn't work.
Are these issues relative to dependencies?

Mneckoee
  • 2,802
  • 6
  • 23
  • 34

1 Answers1

1

com.android.support:design:23.2.1 includes RecyclerView in it. While cardView is not mentioned in the link, but if you are not finding any errors, and cardview is rendering then, it too is included. Hence, you needn't add these to the dependencies.

Recyclerview will not scroll if its rows fit in the screen. You can raise separate SO questions for these.

suku
  • 10,507
  • 16
  • 75
  • 120
  • could you explain more about recyclerView rows? it scrolls in kitkat but not in A5 – Mneckoee May 15 '16 at 07:44
  • lets say you have 5 rows/items in a recyclerview and their dimensions is such that they fit in the screen of your device. Then there is no need for scroll and hence, it won't be scrollable. So your A5 screen may be able to accommodate all the items of the recyclerview – suku May 15 '16 at 08:58
  • :) . NO. my list has enough items for scrolling, there is items which not shown completely means need to be scrolled. there is a strange behavior: if I move up my finger on screen (scroll down), recycler doesn't show any change but if I go to another activity and come back I see the recycler scrolled down!! – Mneckoee May 15 '16 at 11:44
  • raise another SO question with this issue. Add the code for your adapter and activity/fragment rendering the recyclerview – suku May 15 '16 at 12:38
  • I raised it: http://stackoverflow.com/questions/37235950/android-support-features-dont-apear-in-android-l – Mneckoee May 15 '16 at 12:51