diff options
| author | Chet Haase <chet@google.com> | 2011-09-19 16:21:53 -0700 |
|---|---|---|
| committer | Chet Haase <chet@google.com> | 2011-09-19 16:52:13 -0700 |
| commit | a95e1087b2258b118a7ccb2bedb44da359d3abd0 (patch) | |
| tree | 01af6397105d1cece7cdf628090a19107e57c02e /core/java/android/inputmethodservice/KeyboardView.java | |
| parent | 4b5441a7201a2f28becf3ab7fb33694f137e1998 (diff) | |
Fix 5335993, calculate correct size of lockscreen buttons
The buttons on the lockscreen were sized at startup time,
before the actual size of the keyboard's container (KeyboardView)
was known. Also, horizontal/vertical gaps were not taken into
account in calculating perecent sizes of the keys. This change
causes resize events (including the first one where the container
size is finally known) to recalculate the keys' sizes and positions
according to correct sizing of the container and the keyboard's gaps.
Change-Id: I5ba7a401226ed4b100e5739f3405388955d97997
Diffstat (limited to 'core/java/android/inputmethodservice/KeyboardView.java')
| -rw-r--r-- | core/java/android/inputmethodservice/KeyboardView.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/inputmethodservice/KeyboardView.java b/core/java/android/inputmethodservice/KeyboardView.java index 05444f628ffe..1119c1eb1b31 100644 --- a/core/java/android/inputmethodservice/KeyboardView.java +++ b/core/java/android/inputmethodservice/KeyboardView.java @@ -376,6 +376,7 @@ public class KeyboardView extends View implements View.OnClickListener { initGestureDetector(); } + private void initGestureDetector() { mGestureDetector = new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() { @Override @@ -615,6 +616,9 @@ public class KeyboardView extends View implements View.OnClickListener { @Override public void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); + if (mKeyboard != null) { + mKeyboard.resize(w, h); + } // Release the buffer, if any and it will be reallocated on the next draw mBuffer = null; } |
