diff --git a/android/build.gradle b/android/build.gradle index 40f4f265c..c91558b9a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,27 +1,39 @@ +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + +buildscript { + if (project == rootProject) { + // The Android Gradle plugin is only required when opening the android folder stand-alone. + // This avoids unnecessary downloads and potential conflicts when the library is included as a + // module dependency in an application project. + repositories { + google() + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:3.5.2' + } + } +} + apply plugin: 'com.android.library' android { - compileSdkVersion 27 - buildToolsVersion "23.0.1" - + compileSdkVersion safeExtGet('compileSdkVersion', 28) + buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3') defaultConfig { - minSdkVersion 16 - targetSdkVersion 27 + minSdkVersion safeExtGet('minSdkVersion', 16) + targetSdkVersion safeExtGet('targetSdkVersion', 28) versionCode 1 versionName "1.0" - - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } + lintOptions { + abortOnError false } } dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.facebook.react:react-native:+' + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'com.facebook.react:react-native:+' } diff --git a/android/src/main/java/com/beefe/picker/PickerViewModule.java b/android/src/main/java/com/beefe/picker/PickerViewModule.java index 813a0bddf..27277cfb9 100644 --- a/android/src/main/java/com/beefe/picker/PickerViewModule.java +++ b/android/src/main/java/com/beefe/picker/PickerViewModule.java @@ -6,7 +6,6 @@ import android.graphics.Color; import android.graphics.PixelFormat; import android.graphics.Typeface; -import android.support.annotation.Nullable; import android.text.TextUtils; import android.view.Gravity; import android.view.View; @@ -16,6 +15,8 @@ import android.widget.TextView; import android.os.Build; +import androidx.annotation.Nullable; + import com.beefe.picker.util.MIUIUtils; import com.beefe.picker.view.OnSelectedListener; import com.beefe.picker.view.PickerViewAlone;