title: Inline onFocusChange kotlin
body: <p>I'm trying to build an inline function for <code>setOnFocusChangeListener</code></p>
  
  <p>This is what I got so far:</p>
  
  <pre><code>inline fun EditText.onFocusChange(crossinline hasFocus: (Boolean) -&gt; Unit) {
      setOnFocusChangeListener(View.OnFocusChangeListener { view, b -&gt; })
  }
  </code></pre>
  
  <p>And I use it like this</p>
  
  <pre><code>freightTimeOfDay.onFocusChange { doSomething() }
  </code></pre>
  
  <p>Unfortunately though it gives me no errors, <code>doSomething()</code> is never called.</p>
  
  <p>I'm looking for two things here:</p>
  
  <p><strong>1 -</strong> Get a param in there so I can pass it on to doSomething().
  For example</p>
  
  <pre><code>freightTimeOfDay.onFocusChange { doSomething(hasFocus) }
  </code></pre>
  
  <p><strong>2 -</strong> Make it work :p, as right now nothing is happening.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Seems like kotlin already has some type of inline for this</p>
  
  <pre><code>editText.setOnFocusChangeListener { view, b -&gt; doSomething(b) }
  </code></pre>
  
  <p>However this isn't working for me either, <code>doSomething(hasFocus: Boolean)</code> is never called.</p>
  
  <p>Thanks in advance!</p>