Skip to content

Commit a32ef2d

Browse files
Upgrade Kotlin plugin
1 parent c50c7db commit a32ef2d

File tree

7 files changed

+24
-22
lines changed

7 files changed

+24
-22
lines changed

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.2.30'
4+
ext.kotlin_version = '1.2.60'
55
repositories {
66
jcenter()
77
maven { url 'https://maven.google.com' }
8+
google()
89
}
910
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.0.1'
11+
classpath 'com.android.tools.build:gradle:3.1.4'
1112
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
1213
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1314
}

core/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply from: '../library.gradle'
22
apply plugin: 'kotlin-android'
33

44
dependencies {
5-
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
6-
compile fileTree(dir: 'libs', include: ['*.jar'])
7-
testCompile 'junit:junit:4.12'
5+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
6+
implementation fileTree(dir: 'libs', include: ['*.jar'])
7+
testImplementation 'junit:junit:4.12'
88
}

core/src/main/java/com/github/stephenvinouze/materialnumberpickercore/MaterialNumberPicker.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ class MaterialNumberPicker : NumberPicker {
156156
*/
157157
private fun updateTextAttributes() {
158158
val typeface = if (fontName != null) Typeface.createFromAsset(context.assets, "fonts/$fontName") else Typeface.create(Typeface.DEFAULT, textStyle)
159-
wheelPaint?.let {
160-
it.color = textColor
161-
it.textSize = textSize.toFloat()
162-
it.typeface = typeface
159+
wheelPaint?.let { paint ->
160+
paint.color = textColor
161+
paint.textSize = textSize.toFloat()
162+
paint.typeface = typeface
163163

164164
val childEditText = (0 until childCount).map { getChildAt(it) as? EditText }.firstOrNull()
165165
childEditText?.let {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PACKAGING=aar
2424
ANDROID_MIN_SDK_VERSION=11
2525
ANDROID_BUILD_SDK_VERSION=27
2626
ANDROID_BUILD_TOOLS_VERSION=27.0.3
27-
ANDROID_APPCOMPAT_VERSION=27.1.0
27+
ANDROID_APPCOMPAT_VERSION=27.1.1
2828

2929
POM_NAME=MaterialNumberPicker
3030
POM_REPO=maven

javasample/build.gradle

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

2222
dependencies {
23-
compile fileTree(dir: 'libs', include: ['*.jar'])
24-
compile project(':core')
25-
testCompile 'junit:junit:4.12'
23+
implementation fileTree(dir: 'libs', include: ['*.jar'])
24+
implementation project(':core')
25+
testImplementation 'junit:junit:4.12'
2626

27-
compile "com.android.support:appcompat-v7:$ANDROID_APPCOMPAT_VERSION"
27+
implementation "com.android.support:appcompat-v7:$ANDROID_APPCOMPAT_VERSION"
2828
}

sample/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ android {
2121
}
2222

2323
dependencies {
24-
compile fileTree(dir: 'libs', include: ['*.jar'])
25-
compile project(':core')
26-
testCompile 'junit:junit:4.12'
24+
implementation fileTree(dir: 'libs', include: ['*.jar'])
25+
implementation project(':core')
26+
testImplementation 'junit:junit:4.12'
2727

28-
compile "com.android.support:appcompat-v7:$ANDROID_APPCOMPAT_VERSION"
28+
implementation "com.android.support:appcompat-v7:$ANDROID_APPCOMPAT_VERSION"
29+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
2930
}

sample/src/main/java/com/github/stephenvinouze/materialnumberpickersample/MainActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class MainActivity : AppCompatActivity() {
4747
editable = false,
4848
wrapped = false,
4949
fontName = "Hand.ttf",
50-
formatter = NumberPicker.Formatter {
51-
return@Formatter "Value $it"
50+
formatter = NumberPicker.Formatter {value ->
51+
return@Formatter "Value $value"
5252
}
5353
)
5454
presentPickerInAlert(numberPicker, getString(R.string.alert_custom_title))
@@ -60,9 +60,9 @@ class MainActivity : AppCompatActivity() {
6060
.setTitle(title)
6161
.setView(numberPicker)
6262
.setNegativeButton(getString(android.R.string.cancel), null)
63-
.setPositiveButton(getString(android.R.string.ok), { _, _ ->
63+
.setPositiveButton(getString(android.R.string.ok)) { _, _ ->
6464
Toast.makeText(this, getString(R.string.picker_value, numberPicker.value), Toast.LENGTH_LONG).show()
65-
})
65+
}
6666
.show()
6767
}
6868

0 commit comments

Comments
 (0)