Skip to content

Instantly share code, notes, and snippets.

View miguelhincapie's full-sized avatar

MiguelHincapieC miguelhincapie

View GitHub Profile
@miguelhincapie
miguelhincapie / TalkBackFacade.kt
Created April 4, 2020 00:34
Decoupled Kotlin class which allows start or stop TalkBack service.
class TalkBackFacade @Inject constructor(private val contextWeakReference: WeakReference<Context>) {
fun isTalkBackEnabled() = Settings.Secure.getString(
contextWeakReference.get()?.contentResolver,
Settings.Secure.ACCESSIBILITY_ENABLED
)?.toInt()?.toBoolean()
?: false
fun enableTalkBack() = changeAccessibilityServicesState(
true,
@miguelhincapie
miguelhincapie / bintray
Created January 22, 2018 06:28
gradle configuration file used to publish an android library to jcenter (gradle:3.0.1)
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
// load properties
Properties properties = new Properties()
File localPropertiesFile = project.file("local.properties")
if(localPropertiesFile.exists()){
properties.load(localPropertiesFile.newDataInputStream())
}
else {