Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. /* 拡張したメソッドの一部 */
  2. public fun <V : View> View.bindView(id: Int, exInit: (V) -> V)
  3. : ReadOnlyProperty<View, V> = required(id, viewFinder, exInit)
  4. @Suppress("UNCHECKED_CAST")
  5. private fun <T, V : View> required(id: Int, finder: T.(Int) -> View?, exInit:(V) -> V)
  6. = Lazy({t: T, desc -> exInit(t.finder(id) as V? ?: viewNotFound(id, desc)) })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement