Merge "Remove unnecessary Drawable.setState"
This commit is contained in:
commit
9c440d1373
1 changed files with 1 additions and 4 deletions
|
@ -808,10 +808,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
||||||
final KeyDrawParams drawParams = mKeyDrawParams;
|
final KeyDrawParams drawParams = mKeyDrawParams;
|
||||||
previewText.setTextColor(drawParams.mPreviewTextColor);
|
previewText.setTextColor(drawParams.mPreviewTextColor);
|
||||||
final Drawable background = previewText.getBackground();
|
final Drawable background = previewText.getBackground();
|
||||||
if (background != null) {
|
|
||||||
background.setState(KEY_PREVIEW_BACKGROUND_DEFAULT_STATE);
|
|
||||||
background.setAlpha(PREVIEW_ALPHA);
|
|
||||||
}
|
|
||||||
final String label = key.getPreviewLabel();
|
final String label = key.getPreviewLabel();
|
||||||
// What we show as preview should match what we show on a key top in onDraw().
|
// What we show as preview should match what we show on a key top in onDraw().
|
||||||
if (label != null) {
|
if (label != null) {
|
||||||
|
@ -865,6 +861,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
||||||
if (background != null) {
|
if (background != null) {
|
||||||
final int hasMoreKeys = (key.mMoreKeys != null) ? STATE_HAS_MOREKEYS : STATE_NORMAL;
|
final int hasMoreKeys = (key.mMoreKeys != null) ? STATE_HAS_MOREKEYS : STATE_NORMAL;
|
||||||
background.setState(KEY_PREVIEW_BACKGROUND_STATE_TABLE[statePosition][hasMoreKeys]);
|
background.setState(KEY_PREVIEW_BACKGROUND_STATE_TABLE[statePosition][hasMoreKeys]);
|
||||||
|
background.setAlpha(PREVIEW_ALPHA);
|
||||||
}
|
}
|
||||||
ViewLayoutUtils.placeViewAt(
|
ViewLayoutUtils.placeViewAt(
|
||||||
previewText, previewX, previewY, previewWidth, previewHeight);
|
previewText, previewX, previewY, previewWidth, previewHeight);
|
||||||
|
|
Loading…
Reference in a new issue