Skip to content

Commit 5bf4208

Browse files
author
zagum
committed
-moved to kotlin
1 parent 5dbf826 commit 5bf4208

File tree

8 files changed

+345
-417
lines changed

8 files changed

+345
-417
lines changed

build.gradle

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
buildscript {
2-
repositories {
3-
jcenter()
4-
google()
5-
}
6-
dependencies {
7-
classpath 'com.android.tools.build:gradle:3.1.4'
8-
}
2+
ext.kotlin_version = '1.3.31'
3+
repositories {
4+
jcenter()
5+
google()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:3.4.1'
9+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10+
}
911
}
1012

1113
allprojects {
12-
repositories {
13-
jcenter()
14-
google()
15-
}
14+
repositories {
15+
jcenter()
16+
google()
17+
}
1618
}
1719

1820
ext {
19-
compileSdkVersion = 27
20-
buildToolsVersion = '27.0.3'
21-
minSdkVersion = 15
22-
targetSdkVersion = compileSdkVersion
21+
compileSdkVersion = 28
22+
buildToolsVersion = '28.0.3'
23+
minSdkVersion = 15
24+
targetSdkVersion = compileSdkVersion
2325

24-
supportLibVersion = '27.1.1'
26+
supportLibVersion = '1.0.2'
2527
}
2628

2729
task clean(type: Delete) {
28-
delete rootProject.buildDir
30+
delete rootProject.buildDir
2931
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Mar 29 16:29:46 MSK 2018
1+
#Wed May 29 15:32:16 MSK 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

switchicon-sample/build.gradle

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android-extensions'
3+
apply plugin: 'kotlin-android'
24

35
dependencies {
4-
implementation project(":switchicon")
5-
implementation "com.android.support:appcompat-v7:$supportLibVersion"
6+
implementation project(":switchicon")
7+
implementation "androidx.appcompat:appcompat:$supportLibVersion"
8+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
69
}
710

811
android {
9-
compileSdkVersion rootProject.ext.compileSdkVersion
10-
buildToolsVersion rootProject.ext.buildToolsVersion
12+
compileSdkVersion rootProject.ext.compileSdkVersion
13+
buildToolsVersion rootProject.ext.buildToolsVersion
1114

12-
defaultConfig {
13-
applicationId "com.github.zagum.switchicon.sample"
14-
minSdkVersion rootProject.ext.minSdkVersion
15-
targetSdkVersion rootProject.ext.targetSdkVersion
16-
versionCode 1
17-
versionName "1.0"
15+
defaultConfig {
16+
applicationId "com.github.zagum.switchicon.sample"
17+
minSdkVersion rootProject.ext.minSdkVersion
18+
targetSdkVersion rootProject.ext.targetSdkVersion
19+
versionCode 1
20+
versionName "1.0"
1821

19-
vectorDrawables.useSupportLibrary = true
20-
}
22+
vectorDrawables.useSupportLibrary = true
23+
}
24+
}
25+
repositories {
26+
mavenCentral()
2127
}

switchicon-sample/src/main/java/com/github/zagum/switchicon/sample/SampleActivity.java

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.github.zagum.switchicon.sample
2+
3+
import android.app.Activity
4+
import android.os.Bundle
5+
import kotlinx.android.synthetic.main.activity_sample.*
6+
7+
class SampleActivity : Activity() {
8+
override fun onCreate(savedInstanceState: Bundle?) {
9+
super.onCreate(savedInstanceState)
10+
setContentView(R.layout.activity_sample)
11+
button1.setOnClickListener { switchIconView1.switchState() }
12+
button2.setOnClickListener { switchIconView2.switchState() }
13+
button3.setOnClickListener { switchIconView3.switchState() }
14+
}
15+
}

switchicon/build.gradle

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'kotlin-android-extensions'
3+
apply plugin: 'kotlin-android'
24

35
dependencies {
4-
implementation "com.android.support:appcompat-v7:$supportLibVersion"
6+
implementation "androidx.appcompat:appcompat:$supportLibVersion"
7+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
58
}
69

710
android {
8-
compileSdkVersion rootProject.ext.compileSdkVersion
9-
buildToolsVersion rootProject.ext.buildToolsVersion
11+
compileSdkVersion rootProject.ext.compileSdkVersion
12+
buildToolsVersion rootProject.ext.buildToolsVersion
1013

11-
defaultConfig {
12-
minSdkVersion rootProject.ext.minSdkVersion
13-
}
14+
defaultConfig {
15+
minSdkVersion rootProject.ext.minSdkVersion
16+
}
17+
}
18+
repositories {
19+
mavenCentral()
1420
}

0 commit comments

Comments
 (0)