Round soft input mode for Android Wear
- Configurable displayed characters
- Support up to 26 keys on screen
- Customizable fling gestures for special functions, by default:
- ⬅️ backspace
- ⬆️ toggle case
- ➡️ insert space
- ⬇️ cycle alternative keys
- Optimized for both right and left handed interaction
- Automatic detection of round or square screen
Add a dependency to your build.gradle
:
dependencies {
compile 'com.github.vmota:roundsoftinputlib:0.9.0'
}
And enable databinding:
dataBinding {
enabled = true
}
- Start SoftInputActivity
Intent intent = new Intent(this, SoftInputActivity.class);
startActivityForResult(intent, SoftInputActivity.TEXT_INSERT_REQUEST);
- Then get the inserted text 'onActivityResult' method
if (requestCode == SoftInputActivity.TEXT_INSERT_REQUEST) {
if (resultCode == RESULT_OK) {
final String insertedText = data.getStringExtra(SoftInputActivity.INSERTED_TEXT_KEY_NAME);
//do awesome stuff...
}
}
- Pre insert text (useful for text edition)
bundle.putString(SoftInputActivity.PRE_INSERTED_TEXT_KEY_NAME, mInputTextCustom.getText().toString());
- Custom key characters
intent.putExtra(SoftInputActivity.CUSTOM_CHAR_SET_KEY_NAME, "0123456789.");
- Optimized for right handed use
bundle.putBoolean(SoftInputActivity.RIGHT_HANDED_LAYOUT_KEY_NAME, true);
Check out the sample with all the code 😉
- Better handle screen obscuration
- Word prediction/auto-correction
- Customize exit overlay and initial greet message