Skip to content

Commit 7cc91a8

Browse files
author
Roman Zimmer
committed
Use AndroidX libraries
Update to AndroidX libraries as a replacement for the obsolete Android Support libraries. Additionally, update Gradle to version 6.9.4 and set `compileSdkVersion` + `targetSdkVersion` to API level 33.
1 parent 8c43b53 commit 7cc91a8

File tree

14 files changed

+323
-230
lines changed

14 files changed

+323
-230
lines changed

app/build.gradle

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 29
4+
compileSdkVersion 33
55
defaultConfig {
66
applicationId "com.adityaarora.liveedgedetection"
77
minSdkVersion 21
8-
targetSdkVersion 29
8+
targetSdkVersion 33
99
versionCode 1
1010
versionName "1.0"
11-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
11+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
}
13+
14+
compileOptions {
15+
sourceCompatibility JavaVersion.VERSION_1_8
16+
targetCompatibility JavaVersion.VERSION_1_8
17+
}
18+
1319
buildTypes {
1420
release {
1521
minifyEnabled false
@@ -20,10 +26,11 @@ android {
2026

2127
dependencies {
2228
implementation fileTree(include: ['*.jar'], dir: 'libs')
23-
implementation 'com.android.support:appcompat-v7:26.1.0'
24-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
25-
testImplementation 'junit:junit:4.13'
26-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
27-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
29+
implementation 'androidx.appcompat:appcompat:1.6.1'
30+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
31+
testImplementation 'junit:junit:4.13.2'
32+
androidTestImplementation 'androidx.test:runner:1.5.2'
33+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
34+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
2835
implementation project(':liveedgedetection')
2936
}

app/src/androidTest/java/com/adityaarora/liveedgedetection/ExampleInstrumentedTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package com.adityaarora.liveedgedetection;
22

33
import android.content.Context;
4-
import android.support.test.InstrumentationRegistry;
5-
import android.support.test.runner.AndroidJUnit4;
4+
5+
import androidx.test.ext.junit.runners.AndroidJUnit4;
6+
import androidx.test.platform.app.InstrumentationRegistry;
67

78
import org.junit.Test;
89
import org.junit.runner.RunWith;
@@ -19,7 +20,7 @@ public class ExampleInstrumentedTest {
1920
@Test
2021
public void useAppContext() throws Exception {
2122
// Context of the app under test.
22-
Context appContext = InstrumentationRegistry.getTargetContext();
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getContext();
2324

2425
assertEquals("com.adityaarora.liveedgedetection", appContext.getPackageName());
2526
}

app/src/main/java/com/adityaarora/liveedgedetection/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
import android.content.Intent;
55
import android.graphics.Bitmap;
66
import android.os.Bundle;
7-
import android.support.v7.app.AppCompatActivity;
87
import android.widget.ImageView;
98

9+
import androidx.appcompat.app.AppCompatActivity;
10+
1011
import com.adityaarora.liveedgedetection.activity.ScanActivity;
1112
import com.adityaarora.liveedgedetection.constants.ScanConstants;
1213
import com.adityaarora.liveedgedetection.util.ScanUtils;

app/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
@@ -12,4 +12,4 @@
1212
android:layout_height="match_parent"
1313
android:scaleType="center" />
1414

15-
</android.support.constraint.ConstraintLayout>
15+
</androidx.constraintlayout.widget.ConstraintLayout>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.6.3'
10+
classpath 'com.android.tools.build:gradle:3.6.4'
1111
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
1212

1313
// NOTE: Do not place your application dependencies here; they belong

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ org.gradle.jvmargs=-Xmx1536m
1414
# This option should only be used with decoupled projects. More details, visit
1515
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1616
# org.gradle.parallel=true
17+
android.useAndroidX=true

gradle/wrapper/gradle-wrapper.jar

5.44 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Mar 03 23:14:26 CET 2023
1+
#Thu Apr 13 16:29:32 CEST 2023
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)