Merge "Small clean up of KeyboardView.onMeasure"

main
Tadashi G. Takaoka 2013-08-09 03:00:12 +00:00 committed by Android (Google) Code Review
commit 6ca0b371de
1 changed files with 6 additions and 5 deletions

View File

@ -196,13 +196,14 @@ public class KeyboardView extends View {
@Override @Override
protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) { protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
if (mKeyboard != null) { if (mKeyboard == null) {
// The main keyboard expands to the display width.
final int height = mKeyboard.mOccupiedHeight + getPaddingTop() + getPaddingBottom();
setMeasuredDimension(widthMeasureSpec, height);
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec); super.onMeasure(widthMeasureSpec, heightMeasureSpec);
return;
} }
// The main keyboard expands to the entire this {@link KeyboardView}.
final int width = mKeyboard.mOccupiedWidth + getPaddingLeft() + getPaddingRight();
final int height = mKeyboard.mOccupiedHeight + getPaddingTop() + getPaddingBottom();
setMeasuredDimension(width, height);
} }
@Override @Override