This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// change java source | |
android{ | |
compileOptions { | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
kotlinOptions { | |
jvmTarget = "1.8" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make EditText clickable not editable | |
fun makeEditTextClickable(et:EditText){ | |
et.isFocusableInTouchMode = false | |
et.isLongClickable = false | |
} | |
// extract activity from a given context | |
fun requireActivity(context: Context): Activity { | |
if (context is Activity) { | |
return context |