public class PasswordEntryKeyboardHelper extends Object implements KeyboardView.OnKeyboardActionListener
Modifier and Type | Field and Description |
---|---|
static int |
KEYBOARD_MODE_ALPHA |
static int |
KEYBOARD_MODE_NUMERIC |
Constructor and Description |
---|
PasswordEntryKeyboardHelper(Context context,
KeyboardView keyboardView,
View targetView) |
PasswordEntryKeyboardHelper(Context context,
KeyboardView keyboardView,
View targetView,
boolean useFullScreenWidth) |
PasswordEntryKeyboardHelper(Context context,
KeyboardView keyboardView,
View targetView,
boolean useFullScreenWidth,
int[] layouts) |
Modifier and Type | Method and Description |
---|---|
void |
createKeyboards() |
void |
handleBackspace() |
boolean |
isAlpha() |
void |
onKey(int primaryCode,
int[] keyCodes)
Send a key press to the listener.
|
void |
onPress(int primaryCode)
Called when the user presses a key.
|
void |
onRelease(int primaryCode)
Called when the user releases a key.
|
void |
onText(CharSequence text)
Sends a sequence of characters to the listener.
|
void |
sendDownUpKeyEvents(int keyEventCode) |
void |
setEnableHaptics(boolean enabled) |
void |
setKeyboardMode(int mode) |
void |
setVibratePattern(int id)
Sets and enables vibrate pattern.
|
void |
swipeDown()
Called when the user quickly moves the finger from up to down.
|
void |
swipeLeft()
Called when the user quickly moves the finger from right to left.
|
void |
swipeRight()
Called when the user quickly moves the finger from left to right.
|
void |
swipeUp()
Called when the user quickly moves the finger from down to up.
|
public static final int KEYBOARD_MODE_ALPHA
public static final int KEYBOARD_MODE_NUMERIC
public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView)
public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView, boolean useFullScreenWidth)
public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView, boolean useFullScreenWidth, int[] layouts)
public void createKeyboards()
public void setEnableHaptics(boolean enabled)
public boolean isAlpha()
public void setKeyboardMode(int mode)
public void sendDownUpKeyEvents(int keyEventCode)
public void onKey(int primaryCode, int[] keyCodes)
KeyboardView.OnKeyboardActionListener
onKey
in interface KeyboardView.OnKeyboardActionListener
primaryCode
- this is the key that was pressedkeyCodes
- the codes for all the possible alternative keys
with the primary code being the first. If the primary key code is
a single character such as an alphabet or number or symbol, the alternatives
will include other characters that may be on the same key or adjacent keys.
These codes are useful to correct for accidental presses of a key adjacent to
the intended key.public void setVibratePattern(int id)
id
- resource id for array containing vibrate pattern.public void handleBackspace()
public void onPress(int primaryCode)
KeyboardView.OnKeyboardActionListener
KeyboardView.OnKeyboardActionListener.onKey(int, int[])
is called.
For keys that repeat, this is only called once.onPress
in interface KeyboardView.OnKeyboardActionListener
primaryCode
- the unicode of the key being pressed. If the touch is not on a valid
key, the value will be zero.public void onRelease(int primaryCode)
KeyboardView.OnKeyboardActionListener
KeyboardView.OnKeyboardActionListener.onKey(int, int[])
is called.
For keys that repeat, this is only called once.onRelease
in interface KeyboardView.OnKeyboardActionListener
primaryCode
- the code of the key that was releasedpublic void onText(CharSequence text)
KeyboardView.OnKeyboardActionListener
onText
in interface KeyboardView.OnKeyboardActionListener
text
- the sequence of characters to be displayed.public void swipeDown()
KeyboardView.OnKeyboardActionListener
swipeDown
in interface KeyboardView.OnKeyboardActionListener
public void swipeLeft()
KeyboardView.OnKeyboardActionListener
swipeLeft
in interface KeyboardView.OnKeyboardActionListener
public void swipeRight()
KeyboardView.OnKeyboardActionListener
swipeRight
in interface KeyboardView.OnKeyboardActionListener
public void swipeUp()
KeyboardView.OnKeyboardActionListener
swipeUp
in interface KeyboardView.OnKeyboardActionListener