Methods Summary |
---|
public void | changeCase(boolean lowerCase)
ToggleState state = getToggleState();
if (null != state && null != state.mKeyLabel) {
if (lowerCase)
state.mKeyLabel = state.mKeyLabel.toLowerCase();
else
state.mKeyLabel = state.mKeyLabel.toUpperCase();
}
|
public com.android.inputmethod.pinyin.SoftKeyToggle$ToggleState | createToggleState()
return new ToggleState();
|
public boolean | disableAllToggleStates()
int oldStateId = (mKeyMask & KEYMASK_TOGGLE_STATE);
mKeyMask &= (~KEYMASK_TOGGLE_STATE);
return oldStateId != 0;
|
public boolean | disableToggleState(int stateId, boolean resetIfNotFound)
int oldStateId = (mKeyMask & KEYMASK_TOGGLE_STATE);
if (oldStateId == stateId) {
mKeyMask &= (~KEYMASK_TOGGLE_STATE);
return stateId != 0;
}
if (resetIfNotFound) {
mKeyMask &= (~KEYMASK_TOGGLE_STATE);
return oldStateId != 0;
}
return false;
|
public boolean | enableToggleState(int stateId, boolean resetIfNotFound)
int oldStateId = (mKeyMask & KEYMASK_TOGGLE_STATE);
if (oldStateId == stateId) return false;
mKeyMask &= (~KEYMASK_TOGGLE_STATE);
if (stateId > 0) {
mKeyMask |= (KEYMASK_TOGGLE_STATE & stateId);
if (getToggleState() == null) {
mKeyMask &= (~KEYMASK_TOGGLE_STATE);
if (!resetIfNotFound && oldStateId > 0) {
mKeyMask |= (KEYMASK_TOGGLE_STATE & oldStateId);
}
return resetIfNotFound;
} else {
return true;
}
} else {
return true;
}
|
public int | getColor()
ToggleState state = getToggleState();
if (null != state && null != state.mKeyType) {
return state.mKeyType.mColor;
}
return mKeyType.mColor;
|
public int | getColorBalloon()
ToggleState state = getToggleState();
if (null != state && null != state.mKeyType) {
return state.mKeyType.mColorBalloon;
}
return mKeyType.mColorBalloon;
|
public int | getColorHl()
ToggleState state = getToggleState();
if (null != state && null != state.mKeyType) {
return state.mKeyType.mColorHl;
}
return mKeyType.mColorHl;
|
public android.graphics.drawable.Drawable | getKeyBg()
ToggleState state = getToggleState();
if (null != state && null != state.mKeyType) {
return state.mKeyType.mKeyBg;
}
return mKeyType.mKeyBg;
|
public int | getKeyCode()
ToggleState state = getToggleState();
if (null != state) return state.mKeyCode;
return mKeyCode;
|
public android.graphics.drawable.Drawable | getKeyHlBg()
ToggleState state = getToggleState();
if (null != state && null != state.mKeyType) {
return state.mKeyType.mKeyHlBg;
}
return mKeyType.mKeyHlBg;
|
public android.graphics.drawable.Drawable | getKeyIcon()
ToggleState state = getToggleState();
if (null != state) return state.mKeyIcon;
return super.getKeyIcon();
|
public android.graphics.drawable.Drawable | getKeyIconPopup()
ToggleState state = getToggleState();
if (null != state) {
if (null != state.mKeyIconPopup) {
return state.mKeyIconPopup;
} else {
return state.mKeyIcon;
}
}
return super.getKeyIconPopup();
|
public java.lang.String | getKeyLabel()
ToggleState state = getToggleState();
if (null != state) return state.mKeyLabel;
return mKeyLabel;
|
private com.android.inputmethod.pinyin.SoftKeyToggle$ToggleState | getToggleState()
int stateId = (mKeyMask & KEYMASK_TOGGLE_STATE);
if (0 == stateId) return null;
ToggleState state = mToggleState;
while ((null != state)
&& (state.mIdAndFlags & KEYMASK_TOGGLE_STATE) != stateId) {
state = state.mNextState;
}
return state;
|
public int | getToggleStateId()
return (mKeyMask & KEYMASK_TOGGLE_STATE);
|
public boolean | isKeyCodeKey()
ToggleState state = getToggleState();
if (null != state) {
if (state.mKeyCode > 0) return true;
return false;
}
return super.isKeyCodeKey();
|
public boolean | isUniStrKey()
ToggleState state = getToggleState();
if (null != state) {
if (null != state.mKeyLabel && state.mKeyCode == 0) {
return true;
}
return false;
}
return super.isUniStrKey();
|
public boolean | isUserDefKey()
ToggleState state = getToggleState();
if (null != state) {
if (state.mKeyCode < 0) return true;
return false;
}
return super.isUserDefKey();
|
public boolean | needBalloon()
ToggleState state = getToggleState();
if (null != state) {
return (state.mIdAndFlags & KEYMASK_BALLOON) != 0;
}
return super.needBalloon();
|
public boolean | repeatable()
ToggleState state = getToggleState();
if (null != state) {
return (state.mIdAndFlags & KEYMASK_REPEAT) != 0;
}
return super.repeatable();
|
public boolean | setToggleStates(com.android.inputmethod.pinyin.SoftKeyToggle$ToggleState rootState)
if (null == rootState) return false;
mToggleState = rootState;
return true;
|