The missing Android keyboard API
// momentum
// why it's here
- Active: last commit today
- Around since 2016 and still shipping
// how to help
// readme
Teleprinter
The missing Android keyboard API
Dependency
Add mavenCentral() to your dependency repositories, then use the latest published version:
dependencies {
implementation("com.commit451:teleprinter:3.0.1")
}
Usage
//this == AppCompatActivity
val teleprinter = Teleprinter(this)
teleprinter.showKeyboard(edittext)
//later...
teleprinter.hideKeyboard()
//alternatively...
teleprinter.toggleKeyboard()
You can add listeners too:
teleprinter.addOnKeyboardOpenedListener {
Toast.makeText(this, "Keyboard opened", Toast.LENGTH_SHORT)
.show()
}
and
teleprinter.addOnKeyboardClosedListener {
Toast.makeText(this, "Keyboard closed", Toast.LENGTH_SHORT)
.show()
}
Note
It is worth noting that this library is a βhackβ around a lack of an official keyboard API from Google, therefore it is potentially breakable with each Android version, and does not work with certain keyboard configurations, such as βfloating keyboardsβ or very small keyboards, or even hardware keyboards. Keep these things in mind when using this library.
License
Copyright 2019 Commit 451