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
   }
119
   }
120
 }
120
 }
121
 
121
 
122
-def support_version = getExtOrDefault('supportLibVersion')
123
 def kotlin_version = getExtOrDefault('kotlinVersion')
122
 def kotlin_version = getExtOrDefault('kotlinVersion')
124
 
123
 
125
 dependencies {
124
 dependencies {
126
   //noinspection GradleDynamicVersion
125
   //noinspection GradleDynamicVersion
127
   api 'com.facebook.react:react-native:+'
126
   api 'com.facebook.react:react-native:+'
128
   implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
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
 ReactNativeWebView_compileSdkVersion=28
2
 ReactNativeWebView_compileSdkVersion=28
3
 ReactNativeWebView_buildToolsVersion=28.0.3
3
 ReactNativeWebView_buildToolsVersion=28.0.3
4
 ReactNativeWebView_targetSdkVersion=28
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
 package com.reactnativecommunity.webview;
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
  * Providing a custom {@code FileProvider} prevents manifest {@code <provider>} name collisions.
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
 import android.os.Environment;
11
 import android.os.Environment;
12
 import android.os.Parcelable;
12
 import android.os.Parcelable;
13
 import android.provider.MediaStore;
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
 import android.util.Log;
17
 import android.util.Log;
18
 import android.webkit.MimeTypeMap;
18
 import android.webkit.MimeTypeMap;
19
 import android.webkit.ValueCallback;
19
 import android.webkit.ValueCallback;