Skip to content

Commit 5de90b1

Browse files
committed
Added anko dependency (to demonstrate a short example in tutorial)
1 parent e793ce7 commit 5de90b1

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

gradle/android-databinding/app/build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,17 @@ dependencies {
3030
exclude group: 'com.android.support', module: 'support-annotations'
3131
})
3232
compile 'com.android.support:appcompat-v7:25.3.1'
33-
testCompile 'junit:junit:4.12'
3433
compile 'com.android.support.constraint:constraint-layout:1.0.1'
3534
compile "com.android.support:recyclerview-v7:25.3.1"
35+
compile 'com.github.bumptech.glide:glide:3.7.0'
36+
3637
kapt "com.android.databinding:compiler:$android_plugin_version"
3738
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
38-
compile 'com.github.bumptech.glide:glide:3.7.0'
39+
40+
compile "org.jetbrains.anko:anko-sdk25:$anko_version"
41+
compile "org.jetbrains.anko:anko-appcompat-v7-common:$anko_version"
42+
43+
testCompile 'junit:junit:4.12'
3944
}
4045
repositories {
4146
mavenCentral()

gradle/android-databinding/app/src/main/java/org/example/kotlin/databinding/MainActivity.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.example.kotlin.databinding
22

3-
import android.content.Intent
43
import android.databinding.DataBindingUtil
54
import android.os.Bundle
65
import android.support.v7.app.AppCompatActivity
76
import android.view.View
87
import org.example.kotlin.databinding.databinding.ActivityMainBinding
8+
import org.jetbrains.anko.startActivity
99

1010

1111
class MainActivity : AppCompatActivity() {
@@ -33,7 +33,5 @@ class MainActivity : AppCompatActivity() {
3333
weather.notifyChange()
3434
}
3535

36-
fun startActivity(view: View) {
37-
startActivity(Intent(this, OtherActivity::class.java))
38-
}
36+
fun startActivity(view: View) = startActivity<OtherActivity>()
3937
}

gradle/android-databinding/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
buildscript {
44
ext.android_plugin_version = '2.4.0-alpha7'
55
ext.kotlin_version = '1.1.2-3'
6+
ext.anko_version = '0.10.0-beta-2'
7+
68
repositories {
79
jcenter()
810
}
911
dependencies {
10-
classpath "com.android.tools.build:gradle:$android_plugin_version"
12+
classpath 'com.android.tools.build:gradle:2.3.1'
1113
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1214

1315
// NOTE: Do not place your application dependencies here; they belong
@@ -18,6 +20,9 @@ buildscript {
1820
allprojects {
1921
repositories {
2022
jcenter()
23+
24+
// for anko library
25+
maven { url "http://dl.bintray.com/kotlin/kotlin-dev" }
2126
}
2227
}
2328

0 commit comments

Comments
 (0)