From d450a381666357a7ca98aafddecbcfa6107d0993 Mon Sep 17 00:00:00 2001 From: Georgy Dzutsev Date: Tue, 29 Nov 2022 08:47:14 +0300 Subject: [PATCH 1/2] Migrate to AndroidX --- build.gradle | 6 +++--- gradle.properties | 2 ++ gradle/wrapper/gradle-wrapper.properties | 6 +++--- mathview/build.gradle | 19 +++++++++++-------- .../mathview/ExampleInstrumentedTest.java | 6 +++--- mathview/src/main/AndroidManifest.xml | 3 +-- .../java/com/zanvent/mathview/MathView.java | 2 -- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index 69b3a1a..c9b944b 100644 --- a/build.gradle +++ b/build.gradle @@ -4,10 +4,10 @@ buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.2' + classpath 'com.android.tools.build:gradle:7.3.1' // NOTE: Do not place your application dependencies here; they belong @@ -18,7 +18,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() maven { url 'https://jitpack.io' } } } diff --git a/gradle.properties b/gradle.properties index 743d692..8de5058 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,8 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 42e5538..5409d03 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu May 17 21:03:13 BDT 2018 +#Tue Nov 29 08:13:06 MSK 2022 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +zipStoreBase=GRADLE_USER_HOME diff --git a/mathview/build.gradle b/mathview/build.gradle index b4778fd..641d127 100644 --- a/mathview/build.gradle +++ b/mathview/build.gradle @@ -1,15 +1,17 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 27 + namespace = "com.zanvert.mathview" + + compileSdkVersion 33 defaultConfig { minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 33 versionCode 1 - versionName "1.0" + versionName "1.2" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } @@ -24,8 +26,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:27.1.1' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation "androidx.webkit:webkit:1.5.0" + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.4' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' } diff --git a/mathview/src/androidTest/java/com/zanvent/mathview/ExampleInstrumentedTest.java b/mathview/src/androidTest/java/com/zanvent/mathview/ExampleInstrumentedTest.java index ae1ad8e..8f07054 100644 --- a/mathview/src/androidTest/java/com/zanvent/mathview/ExampleInstrumentedTest.java +++ b/mathview/src/androidTest/java/com/zanvent/mathview/ExampleInstrumentedTest.java @@ -1,8 +1,8 @@ package com.zanvent.mathview; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,7 +19,7 @@ public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.zanvent.mathview.test", appContext.getPackageName()); } diff --git a/mathview/src/main/AndroidManifest.xml b/mathview/src/main/AndroidManifest.xml index 551f82c..cc947c5 100644 --- a/mathview/src/main/AndroidManifest.xml +++ b/mathview/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/mathview/src/main/java/com/zanvent/mathview/MathView.java b/mathview/src/main/java/com/zanvent/mathview/MathView.java index c40850f..7c1c8ef 100644 --- a/mathview/src/main/java/com/zanvent/mathview/MathView.java +++ b/mathview/src/main/java/com/zanvent/mathview/MathView.java @@ -45,8 +45,6 @@ private void init() { getSettings().setLoadWithOverviewMode(true); getSettings().setJavaScriptEnabled(true); - getSettings().setAppCachePath(getContext().getCacheDir().getAbsolutePath()); - getSettings().setAppCacheEnabled(true); getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); // disable click From 208af5bac306ef33911ed21b9425da367267dc1b Mon Sep 17 00:00:00 2001 From: Georgy Dzutsev Date: Tue, 29 Nov 2022 08:53:35 +0300 Subject: [PATCH 2/2] Remove webview dependency --- mathview/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/mathview/build.gradle b/mathview/build.gradle index 641d127..669d020 100644 --- a/mathview/build.gradle +++ b/mathview/build.gradle @@ -27,7 +27,6 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.5.1' - implementation "androidx.webkit:webkit:1.5.0" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.4' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'