Fields Summary |
---|
protected static final int | KEYMASK_REPEAT |
protected static final int | KEYMASK_BALLOON |
public static final int | MAX_MOVE_TOLERANCE_XFor a finger touch device, after user presses a key, there will be some
consequent moving events because of the changing in touching pressure. If
the moving distance in x is within this threshold, the moving events will
be ignored. |
public static final int | MAX_MOVE_TOLERANCE_YFor a finger touch device, after user presses a key, there will be some
consequent moving events because of the changing in touching pressure. If
the moving distance in y is within this threshold, the moving events will
be ignored. |
protected int | mKeyMaskUsed to indicate the type and attributes of this key. the lowest 8 bits
should be reserved for SoftkeyToggle. |
protected SoftKeyType | mKeyType |
protected android.graphics.drawable.Drawable | mKeyIcon |
protected android.graphics.drawable.Drawable | mKeyIconPopup |
protected String | mKeyLabel |
protected int | mKeyCode |
public int | mPopupSkbIdIf this value is not 0, this key can be used to popup a sub soft keyboard
when user presses it for some time. |
public float | mLeftF |
public float | mRightF |
public float | mTopF |
public float | mBottomF |
public int | mLeft |
public int | mRight |
public int | mTop |
public int | mBottom |
Methods Summary |
---|
public void | changeCase(boolean upperCase)
if (null != mKeyLabel) {
if (upperCase)
mKeyLabel = mKeyLabel.toUpperCase();
else
mKeyLabel = mKeyLabel.toLowerCase();
}
|
public int | getColor()
return mKeyType.mColor;
|
public int | getColorBalloon()
return mKeyType.mColorBalloon;
|
public int | getColorHl()
return mKeyType.mColorHl;
|
public android.graphics.drawable.Drawable | getKeyBg()
return mKeyType.mKeyBg;
|
public int | getKeyCode()
return mKeyCode;
|
public android.graphics.drawable.Drawable | getKeyHlBg()
return mKeyType.mKeyHlBg;
|
public android.graphics.drawable.Drawable | getKeyIcon()
return mKeyIcon;
|
public android.graphics.drawable.Drawable | getKeyIconPopup()
if (null != mKeyIconPopup) {
return mKeyIconPopup;
}
return mKeyIcon;
|
public java.lang.String | getKeyLabel()
return mKeyLabel;
|
public int | getPopupResId()
return mPopupSkbId;
|
public int | height()
return mBottom - mTop;
|
public boolean | isKeyCodeKey()
if (mKeyCode > 0) return true;
return false;
|
public boolean | isUniStrKey()
if (null != mKeyLabel && mKeyCode == 0) return true;
return false;
|
public boolean | isUserDefKey()
if (mKeyCode < 0) return true;
return false;
|
public boolean | moveWithinKey(int x, int y)
if (mLeft - MAX_MOVE_TOLERANCE_X <= x
&& mTop - MAX_MOVE_TOLERANCE_Y <= y
&& mRight + MAX_MOVE_TOLERANCE_X > x
&& mBottom + MAX_MOVE_TOLERANCE_Y > y) {
return true;
}
return false;
|
public boolean | needBalloon()
return (mKeyMask & KEYMASK_BALLOON) != 0;
|
public boolean | repeatable()
return (mKeyMask & KEYMASK_REPEAT) != 0;
|
public void | setKeyAttribute(int keyCode, java.lang.String label, boolean repeat, boolean balloon)
mKeyCode = keyCode;
mKeyLabel = label;
if (repeat) {
mKeyMask |= KEYMASK_REPEAT;
} else {
mKeyMask &= (~KEYMASK_REPEAT);
}
if (balloon) {
mKeyMask |= KEYMASK_BALLOON;
} else {
mKeyMask &= (~KEYMASK_BALLOON);
}
|
public void | setKeyDimensions(float left, float top, float right, float bottom)
mLeftF = left;
mTopF = top;
mRightF = right;
mBottomF = bottom;
|
public void | setKeyType(SoftKeyType keyType, android.graphics.drawable.Drawable keyIcon, android.graphics.drawable.Drawable keyIconPopup)
mKeyType = keyType;
mKeyIcon = keyIcon;
mKeyIconPopup = keyIconPopup;
|
public void | setPopupSkbId(int popupSkbId)
mPopupSkbId = popupSkbId;
|
public void | setSkbCoreSize(int skbWidth, int skbHeight)
mLeft = (int) (mLeftF * skbWidth);
mRight = (int) (mRightF * skbWidth);
mTop = (int) (mTopF * skbHeight);
mBottom = (int) (mBottomF * skbHeight);
|
public java.lang.String | toString()
String str = "\n";
str += " keyCode: " + String.valueOf(mKeyCode) + "\n";
str += " keyMask: " + String.valueOf(mKeyMask) + "\n";
str += " keyLabel: " + (mKeyLabel == null ? "null" : mKeyLabel) + "\n";
str += " popupResId: " + String.valueOf(mPopupSkbId) + "\n";
str += " Position: " + String.valueOf(mLeftF) + ", "
+ String.valueOf(mTopF) + ", " + String.valueOf(mRightF) + ", "
+ String.valueOf(mBottomF) + "\n";
return str;
|
public int | width()
return mRight - mLeft;
|