Sivalingaraja
Sivalingaraja

Reputation: 91

Android -How to use RecyclerView in 4.0 API 14

I have implemented RecyclerView with CardView successfully. But now I want to support from API 14 also. Presently it looks like we need API 17 to support recyclerview.

Can anybody know is it possible to use RecyclerView in 4.0 OS or any other solution to this?

Upvotes: 3

Views: 10257

Answers (3)

piotrek1543
piotrek1543

Reputation: 19361

According to CommonsWare answer, please read this guide: Maintaining Compatibility

Here you would find:

The RecyclerView and CardView widgets are available in earlier versions of Android through the Android v7 Support Library with these limitations:

  • CardView falls back to a programmatic shadow implementation using additional padding.
  • CardView does not clip its children views that intersect with rounded corners.

Dependencies:

To use these features in versions of Android earlier than 5.0 (API level 21), include the Android v7 Support Library in your project as a Gradle dependency:

dependencies {
    compile 'com.android.support:appcompat-v7:21.0.+'
    compile 'com.android.support:cardview-v7:21.0.+'
    compile 'com.android.support:recyclerview-v7:21.0.+'
}

Moreover in source code of RecyclerView, you would find this line

        if (className.length() != 0) {  // Can't use isEmpty since it was added in API 9.
            className = getFullClassName(context, className);

I don't know a guy using API 9, but it seems to be that it's really well backward supported kibrary.

Check also: android support(cardView, RecyclerView)library in older versions with target kitkat

Hope it help

Upvotes: 6

ʍѳђઽ૯ท
ʍѳђઽ૯ท

Reputation: 16976

No idea about supporting that official RecyclerView on 4.0 android, but there are always Librarys such as:https://github.com/h6ah4i/android-advancedrecyclerview

Which those librarys can support these things, for example the above library can support this:

Target platforms

API level 9 or later (However, some animations are not supported on Gingerbread.)

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007276

But now I want to support from API 14 also. Presently it looks like we need API 17 to support recyclerview.

RecyclerView comes from the recyclerview-v7 library, which works back to API Level 7.

Upvotes: 9

Related Questions