Open jb55 opened 7 months ago
The input types have many variations:
public interface InputType {
field public static final int TYPE_CLASS_DATETIME = 4; // 0x4
field public static final int TYPE_CLASS_NUMBER = 2; // 0x2
field public static final int TYPE_CLASS_PHONE = 3; // 0x3
field public static final int TYPE_CLASS_TEXT = 1; // 0x1
field public static final int TYPE_DATETIME_VARIATION_DATE = 16; // 0x10
field public static final int TYPE_DATETIME_VARIATION_NORMAL = 0; // 0x0
field public static final int TYPE_DATETIME_VARIATION_TIME = 32; // 0x20
field public static final int TYPE_MASK_CLASS = 15; // 0xf
field public static final int TYPE_MASK_FLAGS = 16773120; // 0xfff000
field public static final int TYPE_MASK_VARIATION = 4080; // 0xff0
field public static final int TYPE_NULL = 0; // 0x0
field public static final int TYPE_NUMBER_FLAG_DECIMAL = 8192; // 0x2000
field public static final int TYPE_NUMBER_FLAG_SIGNED = 4096; // 0x1000
field public static final int TYPE_NUMBER_VARIATION_NORMAL = 0; // 0x0
field public static final int TYPE_NUMBER_VARIATION_PASSWORD = 16; // 0x10
field public static final int TYPE_TEXT_FLAG_AUTO_COMPLETE = 65536; // 0x10000
field public static final int TYPE_TEXT_FLAG_AUTO_CORRECT = 32768; // 0x8000
field public static final int TYPE_TEXT_FLAG_CAP_CHARACTERS = 4096; // 0x1000
field public static final int TYPE_TEXT_FLAG_CAP_SENTENCES = 16384; // 0x4000
field public static final int TYPE_TEXT_FLAG_CAP_WORDS = 8192; // 0x2000
field public static final int TYPE_TEXT_FLAG_ENABLE_TEXT_CONVERSION_SUGGESTIONS = 1048576; // 0x100000
field public static final int TYPE_TEXT_FLAG_IME_MULTI_LINE = 262144; // 0x40000
field public static final int TYPE_TEXT_FLAG_MULTI_LINE = 131072; // 0x20000
field public static final int TYPE_TEXT_FLAG_NO_SUGGESTIONS = 524288; // 0x80000
field public static final int TYPE_TEXT_VARIATION_EMAIL_ADDRESS = 32; // 0x20
field public static final int TYPE_TEXT_VARIATION_EMAIL_SUBJECT = 48; // 0x30
field public static final int TYPE_TEXT_VARIATION_FILTER = 176; // 0xb0
field public static final int TYPE_TEXT_VARIATION_LONG_MESSAGE = 80; // 0x50
field public static final int TYPE_TEXT_VARIATION_NORMAL = 0; // 0x0
field public static final int TYPE_TEXT_VARIATION_PASSWORD = 128; // 0x80
field public static final int TYPE_TEXT_VARIATION_PERSON_NAME = 96; // 0x60
field public static final int TYPE_TEXT_VARIATION_PHONETIC = 192; // 0xc0
field public static final int TYPE_TEXT_VARIATION_POSTAL_ADDRESS = 112; // 0x70
field public static final int TYPE_TEXT_VARIATION_SHORT_MESSAGE = 64; // 0x40
field public static final int TYPE_TEXT_VARIATION_URI = 16; // 0x10
field public static final int TYPE_TEXT_VARIATION_VISIBLE_PASSWORD = 144; // 0x90
field public static final int TYPE_TEXT_VARIATION_WEB_EDIT_TEXT = 160; // 0xa0
field public static final int TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS = 208; // 0xd0
field public static final int TYPE_TEXT_VARIATION_WEB_PASSWORD = 224; // 0xe0
}
This is needed for setting the keyboard type from rust. It currently doesn't exist. Needed for
For autocompletion to work, we need to be able to set various softkeyboard input options. This is done via
GameActivity_setImeEditorInfo
. Unfortunately this is not exposed in android-activity yet. Let's add this.@lucasmerlin has a patch that simply sets some sane default in
but it would make more sense to have this as something you can call independently from showing the keyboard.
First thing we need to do is make the interface a bit more rusty by making the
imeOptions
andinputTypes
into proper bitflag types.Winit updates
todo: split this off into a separate issue
One thing to note is that
winit
abstracts the IME a bit, but it does provide anImePurpose
enum with the following variants:We can definitely update the
imeOptions
depending onPassword
for example fromIME_FLAG_FORCE_ASCII
:As for
inputType
, we might want to look into updatingImePurpose
to includeDateTime
,Number
,Phone
so that we can show the correct input type from winit. (cc @lukaslihotzki)