update for androidX

This commit is contained in:
vok 2019-06-19 14:37:21 +07:00
parent e28ae17579
commit 4f36eb1254
13 changed files with 4100 additions and 2511 deletions

View File

@ -5,8 +5,8 @@ def safeExtGet(prop, fallback) {
} }
android { android {
compileSdkVersion safeExtGet('compileSdkVersion', 27) compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '27.0.3') buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
compileOptions { compileOptions {
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
@ -15,7 +15,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16) minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 27) targetSdkVersion safeExtGet('targetSdkVersion', 28)
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
} }
@ -28,9 +28,12 @@ dependencies {
} }
// All support libs must use the same version // All support libs must use the same version
implementation "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '+')}" // implementation "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '+')}"
implementation "com.android.support:support-compat:${safeExtGet('supportLibVersion', '+')}" implementation "androidx.annotation:annotation:1.0.0"
implementation "com.android.support:support-media-compat:${safeExtGet('supportLibVersion', '+')}" // implementation "com.android.support:support-compat:${safeExtGet('supportLibVersion', '+')}"
implementation "androidx.core:core:1.0.0"
// implementation "com.android.support:support-media-compat:${safeExtGet('supportLibVersion', '+')}"
implementation "androidx.media:media:1.0.0"
implementation('com.google.android.exoplayer:extension-okhttp:2.9.3') { implementation('com.google.android.exoplayer:extension-okhttp:2.9.3') {
exclude group: 'com.squareup.okhttp3', module: 'okhttp' exclude group: 'com.squareup.okhttp3', module: 'okhttp'

View File

@ -2,7 +2,7 @@ package com.brentvatne.exoplayer;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
import android.view.Gravity; import android.view.Gravity;

View File

@ -1,6 +1,6 @@
package com.brentvatne.exoplayer; package com.brentvatne.exoplayer;
import android.support.annotation.IntDef; import androidx.annotation.IntDef;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@ -1,6 +1,6 @@
package com.brentvatne.exoplayer; package com.brentvatne.exoplayer;
import android.support.annotation.StringDef; import androidx.annotation.StringDef;
import android.view.View; import android.view.View;
import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.Arguments;

View File

@ -5,12 +5,12 @@ def safeExtGet(prop, fallback) {
} }
android { android {
compileSdkVersion safeExtGet('compileSdkVersion', 27) compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '27.0.3') buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
defaultConfig { defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16) minSdkVersion safeExtGet('minSdkVersion', 19)
targetSdkVersion safeExtGet('targetSdkVersion', 27) targetSdkVersion safeExtGet('targetSdkVersion', 28)
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
ndk { ndk {

View File

@ -83,13 +83,16 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false def enableProguardInReleaseBuilds = false
android { android {
compileSdkVersion 25 compileSdkVersion 28
buildToolsVersion '25.0.2' buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig { defaultConfig {
applicationId "com.videoplayer" applicationId "com.videoplayer"
minSdkVersion 16 minSdkVersion 19
targetSdkVersion 25 targetSdkVersion 28
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
ndk { ndk {
@ -108,6 +111,7 @@ android {
release { release {
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds minifyEnabled enableProguardInReleaseBuilds
matchingFallbacks = ['release', 'debug']
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
} }
} }
@ -127,9 +131,11 @@ android {
} }
dependencies { dependencies {
compile "com.android.support:appcompat-v7:25.2.0" implementation project(':react-native-video')
compile "com.facebook.react:react-native:+" // From node_modules // compile "com.android.support:appcompat-v7:25.2.0"
compile project(':react-native-video') implementation "androidx.appcompat:appcompat:1.0.0"
implementation "com.facebook.react:react-native:+" // From node_modules
// implementation project(':react-native-video')
// compile project(':react-native-video-exoplayer') // uncomment to use exoplayer // compile project(':react-native-video-exoplayer') // uncomment to use exoplayer
} }

View File

@ -7,8 +7,8 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-sdk <uses-sdk
android:minSdkVersion="16" android:minSdkVersion="19"
android:targetSdkVersion="22" /> android:targetSdkVersion="28" />
<application <application
android:name=".MainApplication" android:name=".MainApplication"

View File

@ -4,6 +4,8 @@ import android.app.Application;
import com.brentvatne.react.ReactVideoPackage; import com.brentvatne.react.ReactVideoPackage;
import com.facebook.react.ReactApplication; import com.facebook.react.ReactApplication;
import com.brentvatne.react.ReactVideoPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage; import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage; import com.facebook.react.shell.MainReactPackage;
@ -24,6 +26,8 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() { protected List<ReactPackage> getPackages() {
return Arrays.asList( return Arrays.asList(
new MainReactPackage(), new MainReactPackage(),
new ReactVideoPackage(),
new ReactVideoPackage(),
new ReactVideoPackage() new ReactVideoPackage()
); );
} }

View File

@ -1,11 +1,20 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories { repositories {
jcenter() jcenter()
google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.3.0' classpath 'com.android.tools.build:gradle:3.4.1'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
@ -15,6 +24,12 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
mavenLocal() mavenLocal()
maven {
url 'https://maven.google.com'
}
maven {
url "https://jitpack.io"
}
jcenter() jcenter()
maven { maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm

View File

@ -18,3 +18,5 @@
# org.gradle.parallel=true # org.gradle.parallel=true
android.useDeprecatedNdk=true android.useDeprecatedNdk=true
android.useAndroidX=true
android.enableJetifier=true

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

View File

@ -1,12 +1,12 @@
rootProject.name = 'VideoPlayer' rootProject.name = 'VideoPlayer'
include ':app', include ':react-native-video'
':react-native-video', project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')
':react-native-video-exoplayer'
// Quick Local Development // Quick Local Development
//project(':react-native-video').projectDir = new File(rootProject.projectDir, '../../android') //project(':react-native-video').projectDir = new File(rootProject.projectDir, '../../android')
//project(':react-native-video-exoplayer').projectDir = new File(rootProject.projectDir, '../../android-exoplayer') //project(':react-native-video-exoplayer').projectDir = new File(rootProject.projectDir, '../../android-exoplayer')
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../../android') // project(':react-native-video').projectDir = new File(rootProject.projectDir, '../../android')
project(':react-native-video-exoplayer').projectDir = new File(rootProject.projectDir, '../../android-exoplayer') // project(':react-native-video-exoplayer').projectDir = new File(rootProject.projectDir, '../../android-exoplayer')
include ':app'

File diff suppressed because it is too large Load Diff