Skip to content

Commit

Permalink
removed android dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-dev committed Oct 30, 2017
1 parent f22d5b9 commit 7b6a6d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap-1.2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-rc1'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' // for jitpack
}
Expand Down
6 changes: 0 additions & 6 deletions lib/src/main/java/ds/bindingtools/ViewBindings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package ds.bindingtools

import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleOwner
import android.os.Looper
import android.util.Log
import android.widget.CompoundButton
import android.widget.TextView
Expand All @@ -22,7 +21,6 @@ inline fun <reified T : Any?> binding(): ReadWriteProperty<Bindable, T> = Bindin
class BindingProperty<T : Any?>(private var value: T?, private val type: Class<T>) : ReadWriteProperty<Bindable, T> {

override fun getValue(thisRef: Bindable, property: KProperty<*>): T {
ensureUiThread()
val getter = Binder.getAccessors<T>(thisRef, property)?.getter
if (getter != null) {
log("${property.name}.get: filling from getter")
Expand All @@ -34,7 +32,6 @@ class BindingProperty<T : Any?>(private var value: T?, private val type: Class<T
}

override fun setValue(thisRef: Bindable, property: KProperty<*>, value: T) {
ensureUiThread()
val oldValue = this.value
if (oldValue != value) {
log("${property.name}.set: internal value [$value] has been set")
Expand Down Expand Up @@ -70,9 +67,6 @@ fun Bindable.debugBindings() {
}
}

private val isUiThread: Boolean get() = Thread.currentThread() === Looper.getMainLooper().thread
private fun ensureUiThread() = isUiThread || error("UI thread expected")

private class Accessors<T : Any?, R : Any?>(val name: String) {
var getter: (() -> R)? = null
val setters = mutableListOf<(T) -> Unit>()
Expand Down

0 comments on commit 7b6a6d3

Please sign in to comment.