Skip to content

vitormota/RoundSoftInput

Repository files navigation

Round Soft Input

Round soft input mode for Android Wear

DemoRound DemoSquare

Features

  • 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

Usage

Add a dependency to your build.gradle:

dependencies {
  compile 'com.github.vmota:roundsoftinputlib:0.9.0'
}

And enable databinding:

dataBinding {
 enabled = true
}

Basic

  1. Start SoftInputActivity
  Intent intent = new Intent(this, SoftInputActivity.class);
  startActivityForResult(intent, SoftInputActivity.TEXT_INSERT_REQUEST);
  1. 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...
		}
	}

Customized

  1. Pre insert text (useful for text edition)
	bundle.putString(SoftInputActivity.PRE_INSERTED_TEXT_KEY_NAME, mInputTextCustom.getText().toString());
  1. Custom key characters
	intent.putExtra(SoftInputActivity.CUSTOM_CHAR_SET_KEY_NAME, "0123456789.");
  1. Optimized for right handed use
  bundle.putBoolean(SoftInputActivity.RIGHT_HANDED_LAYOUT_KEY_NAME, true);

Check out the sample with all the code 😉

Coming up

  • Better handle screen obscuration
  • Word prediction/auto-correction
  • Customize exit overlay and initial greet message

Trouble sleeping? Read all about this work here 😁

About

Round soft input mode for Android Wear

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages