Skip to content

Commit 367c193

Browse files
authored
Merge pull request #85 from mantas84/migrate-androidx
migrate to androidX
2 parents 8d82795 + 86c78ee commit 367c193

File tree

18 files changed

+47
-42
lines changed

18 files changed

+47
-42
lines changed

app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ android {
2222
}
2323

2424
dependencies {
25-
implementation "com.android.support:appcompat-v7:$supportLibVersion"
26-
implementation "com.android.support:design:$supportLibVersion"
27-
25+
implementation "androidx.appcompat:appcompat:$appcompatLibVersion"
26+
implementation "com.google.android.material:material:$materialLibVersion"
2827
implementation "com.jakewharton:butterknife:$butterKnifeVersion"
2928

3029
implementation project(':library')

app/src/main/java/com/vansuita/materialabout/sample/act/ActivitySample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.vansuita.materialabout.sample.act;
22

33
import android.os.Bundle;
4-
import android.support.v7.app.AppCompatActivity;
4+
import androidx.appcompat.app.AppCompatActivity;
55

66
import com.vansuita.materialabout.sample.R;
77
import com.vansuita.materialabout.sample.helper.SampleHelper;

app/src/main/java/com/vansuita/materialabout/sample/act/FragmentActivitySample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.vansuita.materialabout.sample.act;
22

33
import android.os.Bundle;
4-
import android.support.annotation.Nullable;
5-
import android.support.v4.app.Fragment;
6-
import android.support.v7.app.AppCompatActivity;
4+
import androidx.annotation.Nullable;
5+
import androidx.fragment.app.Fragment;
6+
import androidx.appcompat.app.AppCompatActivity;
77
import android.view.LayoutInflater;
88
import android.view.View;
99
import android.view.ViewGroup;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
android:layout_width="match_parent"
99
android:layout_height="wrap_content">
1010

11-
<android.support.v7.widget.AppCompatButton
11+
<androidx.appcompat.widget.AppCompatButton
1212
android:id="@+id/dark"
1313
android:layout_width="0dp"
1414
android:layout_height="wrap_content"
1515
android:layout_weight="0.33"
1616
android:text="@string/dark_theme" />
1717

18-
<android.support.v7.widget.AppCompatButton
18+
<androidx.appcompat.widget.AppCompatButton
1919
android:id="@+id/light"
2020
android:layout_width="0dp"
2121
android:layout_height="wrap_content"
2222
android:layout_weight="0.33"
2323
android:text="@string/light_theme" />
2424

25-
<android.support.v7.widget.AppCompatButton
25+
<androidx.appcompat.widget.AppCompatButton
2626
android:id="@+id/custom"
2727
android:layout_width="0dp"
2828
android:layout_height="wrap_content"

build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
google()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.0.1'
9+
classpath 'com.android.tools.build:gradle:3.2.0'
1010
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
1111
}
1212
}
@@ -20,11 +20,13 @@ allprojects {
2020
}
2121

2222
ext {
23-
compileSdkVersion = 27
23+
compileSdkVersion = 28
2424
buildToolsVersion = '28.0.0'
2525
targetSdkVersion = compileSdkVersion
2626

27-
supportLibVersion = '27.1.1'
27+
appcompatLibVersion = '1.1.0'
28+
cardViewLibVersion = '1.0.0'
29+
materialLibVersion = '1.0.0'
2830
iconHandlerVersion = 'v2.0.0'
2931
butterKnifeVersion = '8.8.1'
3032
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
12+
android.enableJetifier=true
13+
android.useAndroidX=true
1214
org.gradle.jvmargs=-Xmx1536m
1315

1416
# When configured, Gradle will run in incubating parallel mode.

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ android {
2020
}
2121

2222
dependencies {
23-
implementation "com.android.support:appcompat-v7:$supportLibVersion"
24-
implementation "com.android.support:cardview-v7:$supportLibVersion"
23+
implementation "androidx.appcompat:appcompat:$appcompatLibVersion"
24+
implementation "androidx.cardview:cardview:$cardViewLibVersion"
2525
implementation "com.github.jrvansuita:IconHandler:$iconHandlerVersion"
2626
}

library/src/main/java/com/vansuita/materialabout/builder/AboutBuilder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
import android.graphics.Bitmap;
88
import android.graphics.drawable.BitmapDrawable;
99
import android.net.Uri;
10-
import android.support.annotation.NonNull;
10+
import androidx.annotation.NonNull;
1111
import android.view.View;
1212

13+
import androidx.cardview.widget.CardView;
14+
1315
import com.vansuita.materialabout.R;
1416
import com.vansuita.materialabout.util.ColorUtil;
1517
import com.vansuita.materialabout.util.IconUtil;
@@ -1964,7 +1966,7 @@ public AboutBuilder addDonateAction(Intent intent) {
19641966
}
19651967

19661968
/**
1967-
* Wraps the content in a {@link android.support.v7.widget.CardView}
1969+
* Wraps the content in a {@link CardView}
19681970
*
19691971
* @param showAsCard true if show in a CardView
19701972
* @return the same {@link AboutBuilder} instance

library/src/main/java/com/vansuita/materialabout/util/ColorUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import android.content.Context;
44
import android.content.res.Resources;
5-
import android.support.annotation.NonNull;
6-
import android.support.v4.content.ContextCompat;
5+
import androidx.annotation.NonNull;
6+
import androidx.core.content.ContextCompat;
77

88

99
/**

library/src/main/java/com/vansuita/materialabout/util/IconUtil.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import android.graphics.BitmapFactory;
66
import android.graphics.drawable.BitmapDrawable;
77
import android.graphics.drawable.Drawable;
8-
import android.support.annotation.DrawableRes;
9-
import android.support.annotation.NonNull;
10-
import android.support.annotation.Nullable;
11-
import android.support.v4.content.ContextCompat;
8+
import androidx.annotation.DrawableRes;
9+
import androidx.annotation.NonNull;
10+
import androidx.annotation.Nullable;
11+
import androidx.core.content.ContextCompat;
1212

1313
/**
1414
* Static utilities.

0 commit comments

Comments
 (0)