Skip to content

Commit ba05f36

Browse files
committed
Update Kotlin version to 1.2.71, update SDK to 28 and migrate to AndroidX
1 parent 202cab7 commit ba05f36

File tree

12 files changed

+36
-139
lines changed

12 files changed

+36
-139
lines changed

.idea/misc.xml

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

.idea/vcs.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ apply plugin: 'kotlin-android-extensions'
44

55
android {
66
compileSdkVersion rootProject.compileSdkVersion
7+
78
defaultConfig {
89
applicationId "com.omega"
910
minSdkVersion rootProject.minSdkVersion
1011
targetSdkVersion rootProject.targetSdkVersion
1112
versionCode 1
1213
versionName "1.0"
13-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1414
}
15+
1516
buildTypes {
1617
release {
1718
minifyEnabled false
@@ -22,12 +23,8 @@ android {
2223

2324
dependencies {
2425
api fileTree(dir: 'libs', include: ['*.jar'])
25-
api "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
26-
api "com.android.support:appcompat-v7:$supportLibraryVersion"
26+
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
27+
api "androidx.appcompat:appcompat:$appCompatLibraryVersion"
2728

2829
api project(":center_icon_button")
29-
30-
testImplementation 'junit:junit:4.12'
31-
androidTestImplementation 'com.android.support.test:runner:1.0.1'
32-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
3330
}

app/src/androidTest/java/com/omega/ExampleInstrumentedTest.kt

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/src/main/java/com/omega/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.omega
22

3-
import android.support.v7.app.AppCompatActivity
43
import android.os.Bundle
4+
import androidx.appcompat.app.AppCompatActivity
55

66
class MainActivity : AppCompatActivity() {
77

app/src/test/java/com/omega/ExampleUnitTest.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.

build.gradle

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
31
buildscript {
4-
ext.kotlin_version = '1.2.30'
5-
ext.supportLibraryVersion = '27.1.1'
6-
ext.targetSdkVersion = 27
7-
ext.compileSdkVersion = 27
2+
ext.kotlinVersion = '1.2.71'
3+
ext.appCompatLibraryVersion = '1.0.0'
4+
ext.targetSdkVersion = 28
5+
ext.compileSdkVersion = 28
86
ext.minSdkVersion = 14
97

108

119
repositories {
1210
google()
1311
jcenter()
12+
mavenCentral()
1413
maven { url 'https://jitpack.io' }
1514
}
1615
dependencies {
17-
classpath 'com.android.tools.build:gradle:3.1.1'
18-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
19-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
20-
21-
// NOTE: Do not place your application dependencies here; they belong
22-
// in the individual module build.gradle files
16+
classpath 'com.android.tools.build:gradle:3.2.1'
17+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
18+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
2319
}
2420
}
2521

center_icon_button/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ android {
1010
targetSdkVersion rootProject.targetSdkVersion
1111
versionCode 1
1212
versionName "1.0"
13-
14-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15-
1613
}
1714

1815
buildTypes {
@@ -21,10 +18,9 @@ android {
2118
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2219
}
2320
}
24-
2521
}
2622

2723
dependencies {
2824
implementation fileTree(dir: 'libs', include: ['*.jar'])
29-
compileOnly "com.android.support:appcompat-v7:$supportLibraryVersion"
25+
compileOnly "androidx.appcompat:appcompat:$appCompatLibraryVersion"
3026
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.omega_r.libs.centericonbutton" />
1+
<manifest package="com.omega_r.libs.centericonbutton" />

center_icon_button/src/main/java/com/omega_r/libs/OmegaCenterIconButton.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
import android.graphics.Paint;
77
import android.graphics.Rect;
88
import android.graphics.drawable.Drawable;
9-
import android.support.annotation.ColorInt;
10-
import android.support.annotation.DrawableRes;
11-
import android.support.annotation.Nullable;
12-
import android.support.v4.graphics.drawable.DrawableCompat;
13-
import android.support.v7.widget.AppCompatButton;
149
import android.text.method.TransformationMethod;
1510
import android.util.AttributeSet;
1611

@@ -20,6 +15,12 @@
2015
import java.util.List;
2116
import java.util.StringTokenizer;
2217

18+
import androidx.annotation.ColorInt;
19+
import androidx.annotation.DrawableRes;
20+
import androidx.annotation.Nullable;
21+
import androidx.appcompat.widget.AppCompatButton;
22+
import androidx.core.graphics.drawable.DrawableCompat;
23+
2324
public class OmegaCenterIconButton extends AppCompatButton {
2425

2526
private static final String DELIMITERS = "\n";
@@ -181,11 +182,10 @@ private String divideText() {
181182
return isAllCaps() ? longPart.toUpperCase() : longPart;
182183
}
183184

184-
private boolean isAllCaps() {
185+
public boolean isAllCaps() {
185186
TransformationMethod method = getTransformationMethod();
186187
if(method == null) return false;
187188

188189
return method.getClass().getSimpleName().equals("AllCapsTransformationMethod");
189190
}
190-
191191
}

0 commit comments

Comments
 (0)