Browse Source

feat(android): Migrate to Android X (#520)

BREAKING CHANGE:
If you override compileSdkVersion<28  it won't work anymore.
Mike Diarmid 5 years ago
parent
commit
1d6c88dcf5

+ 0
- 2
android/build.gradle View File

@@ -119,12 +119,10 @@ repositories {
119 119
   }
120 120
 }
121 121
 
122
-def support_version = getExtOrDefault('supportLibVersion')
123 122
 def kotlin_version = getExtOrDefault('kotlinVersion')
124 123
 
125 124
 dependencies {
126 125
   //noinspection GradleDynamicVersion
127 126
   api 'com.facebook.react:react-native:+'
128 127
   implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
129
-  implementation "com.android.support:appcompat-v7:$support_version"
130 128
 }

+ 1
- 1
android/gradle.properties View File

@@ -2,4 +2,4 @@ ReactNativeWebView_kotlinVersion=1.3.11
2 2
 ReactNativeWebView_compileSdkVersion=28
3 3
 ReactNativeWebView_buildToolsVersion=28.0.3
4 4
 ReactNativeWebView_targetSdkVersion=28
5
-ReactNativeWebView_supportLibVersion=28.0.0
5
+android.useAndroidX=true

+ 1
- 1
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewFileProvider.java View File

@@ -1,6 +1,6 @@
1 1
 package com.reactnativecommunity.webview;
2 2
 
3
-import android.support.v4.content.FileProvider;
3
+import androidx.core.content.FileProvider;
4 4
 
5 5
 /**
6 6
  * Providing a custom {@code FileProvider} prevents manifest {@code <provider>} name collisions.

+ 3
- 3
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModule.java View File

@@ -11,9 +11,9 @@ import android.os.Build;
11 11
 import android.os.Environment;
12 12
 import android.os.Parcelable;
13 13
 import android.provider.MediaStore;
14
-import android.support.annotation.RequiresApi;
15
-import android.support.v4.content.ContextCompat;
16
-import android.support.v4.content.FileProvider;
14
+import androidx.annotation.RequiresApi;
15
+import androidx.core.content.ContextCompat;
16
+import androidx.core.content.FileProvider;
17 17
 import android.util.Log;
18 18
 import android.webkit.MimeTypeMap;
19 19
 import android.webkit.ValueCallback;