16 lines
433 B
Kotlin
16 lines
433 B
Kotlin
package com.adlerosn.brasilfurfest.helper
|
|
|
|
import android.app.Activity
|
|
import android.content.Context
|
|
import android.view.View
|
|
import android.view.inputmethod.InputMethodManager
|
|
|
|
|
|
fun Activity.hideKeyboard(){
|
|
hideKeyboard(currentFocus ?: View(this))
|
|
}
|
|
|
|
fun Context.hideKeyboard(view: View){
|
|
val imm = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
|
imm.hideSoftInputFromWindow(view.windowToken, 0)
|
|
} |