am 9bda1989: Merge "Stop dimming main keyboard while showing more keys keyboard"

* commit '9bda19891ceb5571cb92a164061eb7912c81f2a7':
  Stop dimming main keyboard while showing more keys keyboard
main
Tadashi G. Takaoka 2014-10-08 13:18:47 +00:00 committed by Android Git Automerger
commit 83d7e4cfef
1 changed files with 0 additions and 21 deletions

View File

@ -146,7 +146,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
// More keys keyboard // More keys keyboard
private final Paint mBackgroundDimAlphaPaint = new Paint(); private final Paint mBackgroundDimAlphaPaint = new Paint();
private boolean mNeedsToDimEntireKeyboard;
private final View mMoreKeysKeyboardContainer; private final View mMoreKeysKeyboardContainer;
private final View mMoreKeysKeyboardForActionContainer; private final View mMoreKeysKeyboardForActionContainer;
private final WeakHashMap<Key, Keyboard> mMoreKeysKeyboardCache = new WeakHashMap<>(); private final WeakHashMap<Key, Keyboard> mMoreKeysKeyboardCache = new WeakHashMap<>();
@ -673,7 +672,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
locatePreviewPlacerView(); locatePreviewPlacerView();
panel.showInParent(mDrawingPreviewPlacerView); panel.showInParent(mDrawingPreviewPlacerView);
mMoreKeysPanel = panel; mMoreKeysPanel = panel;
dimEntireKeyboard(true /* dimmed */);
} }
public boolean isShowingMoreKeysPanel() { public boolean isShowingMoreKeysPanel() {
@ -687,7 +685,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
@Override @Override
public void onDismissMoreKeysPanel() { public void onDismissMoreKeysPanel() {
dimEntireKeyboard(false /* dimmed */);
if (isShowingMoreKeysPanel()) { if (isShowingMoreKeysPanel()) {
mMoreKeysPanel.removeFromParent(); mMoreKeysPanel.removeFromParent();
mMoreKeysPanel = null; mMoreKeysPanel = null;
@ -815,24 +812,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
invalidateKey(mSpaceKey); invalidateKey(mSpaceKey);
} }
private void dimEntireKeyboard(final boolean dimmed) {
final boolean needsRedrawing = mNeedsToDimEntireKeyboard != dimmed;
mNeedsToDimEntireKeyboard = dimmed;
if (needsRedrawing) {
invalidateAllKeys();
}
}
@Override
protected void onDraw(final Canvas canvas) {
super.onDraw(canvas);
// Overlay a dark rectangle to dim.
if (mNeedsToDimEntireKeyboard) {
canvas.drawRect(0.0f, 0.0f, getWidth(), getHeight(), mBackgroundDimAlphaPaint);
}
}
@Override @Override
protected void onDrawKeyTopVisuals(final Key key, final Canvas canvas, final Paint paint, protected void onDrawKeyTopVisuals(final Key key, final Canvas canvas, final Paint paint,
final KeyDrawParams params) { final KeyDrawParams params) {