From d0fb56e03e74f636fd0f7f485c914536e80834af Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Sat, 20 Apr 2019 12:02:44 +0200 Subject: [PATCH] Migrate to AndroidX support libraries. --- CuckooChessApp/build.gradle | 8 ++++---- DroidFishApp/build.gradle | 12 ++++++------ .../java/org/petero/droidfish/book/EcoTest.java | 4 ++-- DroidFishApp/src/main/AndroidManifest.xml | 2 +- .../floatingactionbutton/FloatingActionButton.java | 13 ++++++------- .../main/java/org/petero/droidfish/DroidFish.java | 10 +++++----- .../org/petero/droidfish/activities/EditBoard.java | 4 ++-- .../tourguide/tourguide/FrameLayoutWithHole.java | 2 +- DroidFishApp/src/main/res/layout-land/editboard.xml | 4 ++-- DroidFishApp/src/main/res/layout-land/main.xml | 4 ++-- DroidFishApp/src/main/res/layout/editboard.xml | 4 ++-- DroidFishApp/src/main/res/layout/main.xml | 4 ++-- .../src/main/res/layout/main_left_handed.xml | 4 ++-- gradle.properties | 2 ++ 14 files changed, 39 insertions(+), 38 deletions(-) diff --git a/CuckooChessApp/build.gradle b/CuckooChessApp/build.gradle index 579e175..e83dd4c 100644 --- a/CuckooChessApp/build.gradle +++ b/CuckooChessApp/build.gradle @@ -10,7 +10,7 @@ android { versionCode 2 versionName "1.05" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } if(project.hasProperty("RELEASE_STORE_FILE")) { @@ -37,9 +37,9 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.appcompat:appcompat:1.0.0-beta01' 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' + androidTestImplementation 'androidx.test:runner:1.1.0-alpha4' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4' implementation project(':CuckooChessEngine') } diff --git a/DroidFishApp/build.gradle b/DroidFishApp/build.gradle index 547811f..59e2596 100644 --- a/DroidFishApp/build.gradle +++ b/DroidFishApp/build.gradle @@ -8,7 +8,7 @@ android { targetSdkVersion 28 versionCode 84 versionName "1.74" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { ndkBuild { arguments '-j8' @@ -50,12 +50,12 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' - implementation 'com.android.support:design:28.0.0' + implementation 'androidx.appcompat:appcompat:1.0.0-beta01' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'com.google.android.material:material:1.0.0-beta01' 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' + androidTestImplementation 'androidx.test:runner:1.1.0-alpha4' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4' implementation project(':CuckooChessEngine') implementation 'com.caverock:androidsvg-aar:1.3' } diff --git a/DroidFishApp/src/androidTest/java/org/petero/droidfish/book/EcoTest.java b/DroidFishApp/src/androidTest/java/org/petero/droidfish/book/EcoTest.java index a4b8616..960b19c 100644 --- a/DroidFishApp/src/androidTest/java/org/petero/droidfish/book/EcoTest.java +++ b/DroidFishApp/src/androidTest/java/org/petero/droidfish/book/EcoTest.java @@ -23,8 +23,8 @@ import org.petero.droidfish.gamelogic.Game; import org.petero.droidfish.gamelogic.GameTree; import org.petero.droidfish.gamelogic.TimeControlData; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; +import androidx.test.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/DroidFishApp/src/main/AndroidManifest.xml b/DroidFishApp/src/main/AndroidManifest.xml index f996605..6d62a2c 100644 --- a/DroidFishApp/src/main/AndroidManifest.xml +++ b/DroidFishApp/src/main/AndroidManifest.xml @@ -122,7 +122,7 @@ android:configChanges="orientation|screenSize|keyboardHidden|screenLayout|smallestScreenSize"> diff --git a/DroidFishApp/src/main/java/net/i2p/android/ext/floatingactionbutton/FloatingActionButton.java b/DroidFishApp/src/main/java/net/i2p/android/ext/floatingactionbutton/FloatingActionButton.java index 3304d06..48d933e 100644 --- a/DroidFishApp/src/main/java/net/i2p/android/ext/floatingactionbutton/FloatingActionButton.java +++ b/DroidFishApp/src/main/java/net/i2p/android/ext/floatingactionbutton/FloatingActionButton.java @@ -20,14 +20,13 @@ import android.graphics.drawable.StateListDrawable; import android.graphics.drawable.shapes.OvalShape; import android.os.Build; import android.os.Build.VERSION_CODES; -import android.support.annotation.ColorRes; -import android.support.annotation.DimenRes; -import android.support.annotation.DrawableRes; -import android.support.annotation.IntDef; -import android.support.annotation.NonNull; -import android.support.v7.widget.AppCompatImageButton; +import androidx.annotation.ColorRes; +import androidx.annotation.DimenRes; +import androidx.annotation.DrawableRes; +import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.appcompat.widget.AppCompatImageButton; import android.util.AttributeSet; -import android.widget.ImageButton; import android.widget.TextView; import java.lang.annotation.Retention; diff --git a/DroidFishApp/src/main/java/org/petero/droidfish/DroidFish.java b/DroidFishApp/src/main/java/org/petero/droidfish/DroidFish.java index be8ea19..53a2774 100644 --- a/DroidFishApp/src/main/java/org/petero/droidfish/DroidFish.java +++ b/DroidFishApp/src/main/java/org/petero/droidfish/DroidFish.java @@ -119,11 +119,11 @@ import android.os.Handler; import android.os.StrictMode; import android.os.Vibrator; import android.preference.PreferenceManager; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; -import android.support.v4.content.FileProvider; -import android.support.v4.view.MotionEventCompat; -import android.support.v4.widget.DrawerLayout; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import androidx.core.content.FileProvider; +import androidx.core.view.MotionEventCompat; +import androidx.drawerlayout.widget.DrawerLayout; import android.text.Editable; import android.text.Html; import android.text.Spannable; diff --git a/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditBoard.java b/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditBoard.java index dd84689..493d51d 100644 --- a/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditBoard.java +++ b/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditBoard.java @@ -55,8 +55,8 @@ import android.os.Bundle; import android.os.Handler; import android.os.Vibrator; import android.preference.PreferenceManager; -import android.support.v4.view.MotionEventCompat; -import android.support.v4.widget.DrawerLayout; +import androidx.core.view.MotionEventCompat; +import androidx.drawerlayout.widget.DrawerLayout; import android.text.TextUtils; import android.view.Gravity; import android.view.KeyEvent; diff --git a/DroidFishApp/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java b/DroidFishApp/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java index 05e5b46..7ac53d8 100644 --- a/DroidFishApp/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java +++ b/DroidFishApp/src/main/java/tourguide/tourguide/FrameLayoutWithHole.java @@ -6,7 +6,7 @@ import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Path.FillType; -import android.support.v4.view.MotionEventCompat; +import androidx.core.view.MotionEventCompat; import android.text.TextPaint; import android.util.AttributeSet; import android.util.Log; diff --git a/DroidFishApp/src/main/res/layout-land/editboard.xml b/DroidFishApp/src/main/res/layout-land/editboard.xml index 3677102..5623939 100644 --- a/DroidFishApp/src/main/res/layout-land/editboard.xml +++ b/DroidFishApp/src/main/res/layout-land/editboard.xml @@ -1,5 +1,5 @@ - @@ -162,4 +162,4 @@ - + diff --git a/DroidFishApp/src/main/res/layout-land/main.xml b/DroidFishApp/src/main/res/layout-land/main.xml index 779d0f9..5473222 100644 --- a/DroidFishApp/src/main/res/layout-land/main.xml +++ b/DroidFishApp/src/main/res/layout-land/main.xml @@ -1,5 +1,5 @@ - @@ -114,4 +114,4 @@ - + diff --git a/DroidFishApp/src/main/res/layout/editboard.xml b/DroidFishApp/src/main/res/layout/editboard.xml index 7452be4..2e5f2db 100644 --- a/DroidFishApp/src/main/res/layout/editboard.xml +++ b/DroidFishApp/src/main/res/layout/editboard.xml @@ -1,5 +1,5 @@ - @@ -52,4 +52,4 @@ - + diff --git a/DroidFishApp/src/main/res/layout/main.xml b/DroidFishApp/src/main/res/layout/main.xml index 26fbcb1..2b07460 100644 --- a/DroidFishApp/src/main/res/layout/main.xml +++ b/DroidFishApp/src/main/res/layout/main.xml @@ -1,5 +1,5 @@ - @@ -113,4 +113,4 @@ - + diff --git a/DroidFishApp/src/main/res/layout/main_left_handed.xml b/DroidFishApp/src/main/res/layout/main_left_handed.xml index 68e8bb0..ba4b0b3 100644 --- a/DroidFishApp/src/main/res/layout/main_left_handed.xml +++ b/DroidFishApp/src/main/res/layout/main_left_handed.xml @@ -1,5 +1,5 @@ - @@ -115,4 +115,4 @@ - + diff --git a/gradle.properties b/gradle.properties index 82618ce..d546dea 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