btelman96/letsrobot-android

View on GitHub
app/src/main/java/tv/letsrobot/controller/android/utils/EditTextUtils.kt

Summary

Maintainability
A
0 mins
Test Coverage
package tv.letsrobot.controller.android.utils

import android.widget.EditText

fun EditText.string() : String{
    return text.toString()
}

fun EditText.toIntOrZero() : Int{
    return string().toIntOrNull()?.let { it } ?: 0
}