Create ooi extension

This commit is contained in:
Benoit Marty 2019-11-29 11:20:46 +01:00
parent 9f9c418085
commit 46d96429e0
2 changed files with 4 additions and 1 deletions

View file

@ -21,6 +21,8 @@ import androidx.fragment.app.Fragment
fun Boolean.toOnOff() = if (this) "ON" else "OFF"
inline fun <T> T.ooi(block: (T) -> Unit): T = also(block)
/**
* Apply argument to a Fragment
*/

View file

@ -27,6 +27,7 @@ import android.view.inputmethod.InputConnection
import androidx.appcompat.widget.AppCompatEditText
import androidx.core.view.inputmethod.EditorInfoCompat
import androidx.core.view.inputmethod.InputConnectionCompat
import im.vector.riotx.core.extensions.ooi
import im.vector.riotx.core.platform.SimpleTextWatcher
import im.vector.riotx.features.html.PillImageSpan
import timber.log.Timber
@ -75,7 +76,7 @@ class ComposerEditText @JvmOverloads constructor(context: Context, attrs: Attrib
// Get the first span at this position
spanToRemove = editableText.getSpans(deleteCharPosition, deleteCharPosition, PillImageSpan::class.java)
.also { Timber.v("Pills: beforeTextChanged: found ${it.size} span(s)") }
.ooi { Timber.v("Pills: beforeTextChanged: found ${it.size} span(s)") }
.firstOrNull()
}
}