daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private class ClickListener(setValue: (Int) -> (Unit), getValue: () -> (Int)) : View.OnClickListener {
  2.  
  3.     override fun onClick(v: View?) {
  4.             val oldValue = getValue2()
  5.             val newValue = v?.text.toString().toInt()
  6.             if (newValue != oldValue) {
  7.                 if (oldValue != 0)
  8.                     textViews[oldValue - 1].run {
  9.                         isSelected = false
  10.                         clearFocus()
  11.                     }
  12.                 v?.isSelected = true
  13.                 v?.requestFocus()
  14.                 setValue(newValue)
  15.             }
  16.     }
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top