public final class KeyboardShortcutInfo extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<KeyboardShortcutInfo> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
KeyboardShortcutInfo(CharSequence label,
char baseCharacter,
int modifiers) |
KeyboardShortcutInfo(CharSequence label,
Icon icon,
int keycode,
int modifiers) |
KeyboardShortcutInfo(CharSequence label,
int keycode,
int modifiers) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
char |
getBaseCharacter()
Returns the base character that, combined with the modifiers, triggers this shortcut.
|
Icon |
getIcon()
Returns the icon to be used to describe this shortcut.
|
int |
getKeycode()
Returns the base keycode that, combined with the modifiers, triggers this shortcut.
|
CharSequence |
getLabel()
Returns the label to be used to describe this shortcut.
|
int |
getModifiers()
Returns the set of modifiers that, combined with the key, trigger this shortcut.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public static final Parcelable.Creator<KeyboardShortcutInfo> CREATOR
public KeyboardShortcutInfo(CharSequence label, Icon icon, int keycode, int modifiers)
label
- The label that identifies the action performed by this shortcut.icon
- An icon that identifies the action performed by this shortcut.keycode
- The keycode that triggers the shortcut. This should be a valid constant
defined in KeyEvent
.modifiers
- The set of modifiers that, combined with the key, trigger the shortcut.
These should be a combination of KeyEvent.META_CTRL_ON
,
KeyEvent.META_SHIFT_ON
, KeyEvent.META_META_ON
,
KeyEvent.META_ALT_ON
, KeyEvent.META_FUNCTION_ON
and
KeyEvent.META_SYM_ON
.public KeyboardShortcutInfo(CharSequence label, int keycode, int modifiers)
label
- The label that identifies the action performed by this shortcut.keycode
- The keycode that triggers the shortcut. This should be a valid constant
defined in KeyEvent
.modifiers
- The set of modifiers that, combined with the key, trigger the shortcut.
These should be a combination of KeyEvent.META_CTRL_ON
,
KeyEvent.META_SHIFT_ON
, KeyEvent.META_META_ON
,
KeyEvent.META_ALT_ON
, KeyEvent.META_FUNCTION_ON
and
KeyEvent.META_SYM_ON
.public KeyboardShortcutInfo(CharSequence label, char baseCharacter, int modifiers)
label
- The label that identifies the action performed by this shortcut.baseCharacter
- The character that triggers the shortcut.modifiers
- The set of modifiers that, combined with the key, trigger the shortcut.
These should be a combination of KeyEvent.META_CTRL_ON
,
KeyEvent.META_SHIFT_ON
, KeyEvent.META_META_ON
,
KeyEvent.META_ALT_ON
, KeyEvent.META_FUNCTION_ON
and
KeyEvent.META_SYM_ON
.public CharSequence getLabel()
public Icon getIcon()
public int getKeycode()
KeyEvent.KEYCODE_UNKNOWN
. Valid keycodes are
defined as constants in KeyEvent
.public char getBaseCharacter()
Character.MIN_VALUE
.public int getModifiers()
KeyEvent.META_CTRL_ON
, KeyEvent.META_SHIFT_ON
,
KeyEvent.META_META_ON
, KeyEvent.META_ALT_ON
,
KeyEvent.META_FUNCTION_ON
and KeyEvent.META_SYM_ON
.public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.