Skip to content

Commit

Permalink
-moved to kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
zagum committed Jul 4, 2019
1 parent 5dbf826 commit 5bf4208
Show file tree
Hide file tree
Showing 8 changed files with 345 additions and 417 deletions.
36 changes: 19 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
ext.kotlin_version = '1.3.31'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
jcenter()
google()
}
repositories {
jcenter()
google()
}
}

ext {
compileSdkVersion = 27
buildToolsVersion = '27.0.3'
minSdkVersion = 15
targetSdkVersion = compileSdkVersion
compileSdkVersion = 28
buildToolsVersion = '28.0.3'
minSdkVersion = 15
targetSdkVersion = compileSdkVersion

supportLibVersion = '27.1.1'
supportLibVersion = '1.0.2'
}

task clean(type: Delete) {
delete rootProject.buildDir
delete rootProject.buildDir
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Mar 29 16:29:46 MSK 2018
#Wed May 29 15:32:16 MSK 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
30 changes: 18 additions & 12 deletions switchicon-sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

dependencies {
implementation project(":switchicon")
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation project(":switchicon")
implementation "androidx.appcompat:appcompat:$supportLibVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
applicationId "com.github.zagum.switchicon.sample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
defaultConfig {
applicationId "com.github.zagum.switchicon.sample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"

vectorDrawables.useSupportLibrary = true
}
vectorDrawables.useSupportLibrary = true
}
}
repositories {
mavenCentral()
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.github.zagum.switchicon.sample

import android.app.Activity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_sample.*

class SampleActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_sample)
button1.setOnClickListener { switchIconView1.switchState() }
button2.setOnClickListener { switchIconView2.switchState() }
button3.setOnClickListener { switchIconView3.switchState() }
}
}
18 changes: 12 additions & 6 deletions switchicon/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

dependencies {
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation "androidx.appcompat:appcompat:$supportLibVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
}
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
}
}
repositories {
mavenCentral()
}
Loading

0 comments on commit 5bf4208

Please sign in to comment.