Skip to content

Commit

Permalink
fixed bug with rebinding
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-dev committed Oct 24, 2017
1 parent f16d637 commit 3576f57
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/main/java/ds/bindingtools/ViewBindings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ private class Binding(
fun <T : Bindable> Any.withBindable(bindable: T, block: T.() -> Unit) {
val binding = Binder[bindable]
if (binding != null && binding.view.get() == this) {
log("Already binded to this view. rebinding...")
log("Already binded to this view.")
} else {
Binder[bindable] = Binding(WeakReference(this))
}
Binder[bindable] = Binding(WeakReference(this))
block(bindable)
}

Expand Down

0 comments on commit 3576f57

Please sign in to comment.