Small clean up of KeyboardView.onMeasure
Change-Id: I46830f8482b46c6999b80793c8b4ae860b46e429
This commit is contained in:
parent
96b444d429
commit
4f1fdc30be
1 changed files with 6 additions and 5 deletions
|
@ -196,13 +196,14 @@ public class KeyboardView extends View {
|
|||
|
||||
@Override
|
||||
protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
|
||||
if (mKeyboard != null) {
|
||||
// The main keyboard expands to the display width.
|
||||
final int height = mKeyboard.mOccupiedHeight + getPaddingTop() + getPaddingBottom();
|
||||
setMeasuredDimension(widthMeasureSpec, height);
|
||||
} else {
|
||||
if (mKeyboard == null) {
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue