Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun Context.toast(message: CharSequence, duration: Int = Toast.LENGTH_SHORT) = Toast.makeText(this, message, duration).show()
- fun List<String>.containsAny(other: List<String>): Boolean {
- forEach { left ->
- other.forEach { right ->
- if (left.equals(right)) {
- return true
- }
- }
- }
- return false
- }
- fun View.hideKeyboard() {
- val keyboard = getContext().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
- keyboard.hideSoftInputFromWindow(getApplicationWindowToken(), 0)
- }
- fun Context.openBrowser(url: String) = startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement