Skip to content

Commit 0f5ba3a

Browse files
Update Android Gradle plugin and sdk
- Gradle plugin 3.6.1 - Gradle Wrapper 5.6.4 - Update min and target sdk - Migrate to androidx
1 parent e82a955 commit 0f5ba3a

10 files changed

Lines changed: 198 additions & 158 deletions

File tree

app/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 22
5-
buildToolsVersion '25.0.0'
6-
4+
compileSdkVersion 29
5+
buildToolsVersion '29.0.2'
76
defaultConfig {
87
applicationId "cpr.name.videoenabledwebview"
9-
minSdkVersion 8
10-
targetSdkVersion 22
8+
minSdkVersion 15
9+
targetSdkVersion 29
1110
versionCode 2
1211
versionName "1.0.1"
1312
}
@@ -20,6 +19,6 @@ android {
2019
}
2120

2221
dependencies {
23-
compile fileTree(dir: 'libs', include: ['*.jar'])
24-
compile 'com.android.support:appcompat-v7:22.0.0'
22+
implementation fileTree(dir: 'libs', include: ['*.jar'])
23+
implementation 'androidx.appcompat:appcompat:1.1.0'
2524
}

app/proguard-rules.pro

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# Add project specific ProGuard rules here.
2-
# By default, the flags in this file are appended to flags specified
3-
# in C:\Program Files\Android Studio\sdk/tools/proguard/proguard-android.txt
4-
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
64
#
75
# For more details, see
86
# http://developer.android.com/guide/developing/tools/proguard.html
97

10-
# Add any project specific keep options here:
11-
128
# If your project uses WebView with JS, uncomment the following
139
# and specify the fully qualified class name to the JavaScript interface
1410
# class:
15-
-keepclassmembers class name.cpr.VideoEnabledWebView$JavascriptInterface {
16-
public *;
17-
}
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

app/src/main/java/name/cpr/ExampleActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package name.cpr;
22

33
import android.os.Bundle;
4-
import android.support.v7.app.ActionBarActivity;
54
import android.view.View;
65
import android.view.ViewGroup;
76
import android.view.WindowManager;
87
import android.webkit.WebView;
98
import android.webkit.WebViewClient;
109

10+
import androidx.appcompat.app.AppCompatActivity;
1111
import cpr.name.videoenabledwebview.R;
1212

13-
public class ExampleActivity extends ActionBarActivity
13+
public class ExampleActivity extends AppCompatActivity
1414
{
1515
private VideoEnabledWebView webView;
1616
private VideoEnabledWebChromeClient webChromeClient;
@@ -76,7 +76,7 @@ public void toggledFullscreen(boolean fullscreen)
7676
webView.setWebViewClient(new InsideWebViewClient());
7777

7878
// Navigate anywhere you want, but consider that this classes have only been tested on YouTube's mobile site
79-
webView.loadUrl("http://m.youtube.com");
79+
webView.loadUrl("https://www.youtube.com/watch?v=HGZYtDZhOEQ");
8080

8181
}
8282

build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
31
buildscript {
42
repositories {
3+
google()
54
jcenter()
65
}
76
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.3'
9-
10-
// NOTE: Do not place your application dependencies here; they belong
11-
// in the individual module build.gradle files
7+
classpath 'com.android.tools.build:gradle:3.6.1'
128
}
139
}
1410

1511
allprojects {
1612
repositories {
13+
google()
1714
jcenter()
1815
}
1916
}

gradle.properties

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
# Project-wide Gradle settings.
22

33
# IDE (e.g. Android Studio) users:
4-
# Settings specified in this file will override any Gradle settings
5-
# configured through the IDE.
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
66

77
# For more details on how to configure your build environment visit
88
# http://www.gradle.org/docs/current/userguide/build_environment.html
99

1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
12-
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
12+
org.gradle.jvmargs=-Xmx1536m
1413

1514
# When configured, Gradle will run in incubating parallel mode.
1615
# This option should only be used with decoupled projects. More details, visit
1716
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1817
# org.gradle.parallel=true
18+
19+
# AndroidX package structure to make it clearer which packages are bundled with the
20+
# Android operating system, and which are packaged with your app's APK
21+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
22+
android.useAndroidX=true
23+
# Automatically convert third-party libraries to use AndroidX
24+
android.enableJetifier=true

gradle/wrapper/gradle-wrapper.jar

5.59 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Mon Oct 16 21:46:15 PDT 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

gradlew

100644100755
Lines changed: 61 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)