nstudio / nativescript-cardview

:diamonds: :clubs: NativeScript widget for Material Design CardView
MIT License
282 stars 51 forks source link

minimum android sdk version #101

Closed racknoris closed 5 years ago

racknoris commented 5 years ago

Is there a minimum sdk version for this plugin to work in Android?

vratojr commented 5 years ago

I'd say 25: https://developer.android.com/reference/android/support/v7/widget/CardView?hl=zh-tw

bradmartin commented 5 years ago

CardView is part of the android support library android.support.v7.widget.CardView (android.support) so it works on lower SDKs. Can read more here.

From docs: Some of the Support Library packages have package names to indicate the minimum level of the API they originally supported, using a v# notation, such as the support-v4 package. Starting with Support Library version 26.0.0 (released in July 2017), the minimum supported API level has changed to Android 4.0 (API level 14) for all support library packages.

Right now this plugin is still using a much older version of the support lib via gradle if your project doesn't have one, so we could definitely update that in the include.gradle


      def supportVer = "22.2.0";

      if(project.hasProperty("supportVersion")) {
       supportVer = supportVersion
      }

     compile "com.android.support:cardview-v7:$supportVer"
}```

Newer NS projects should be using a more updated support library so it shouldn't be an issue, but no harm in trying to use the latest in this plugin and then falling back to local version if specified for a project.