diff options
| author | Satoshi Kataoka <satok@google.com> | 2013-10-10 17:03:51 +0900 |
|---|---|---|
| committer | Satoshi Kataoka <satok@google.com> | 2013-10-15 14:35:18 +0900 |
| commit | 658c7b896a751b971db1292d86655dbb97f00067 (patch) | |
| tree | 935ab36bf8212c9912076c2cc0e78b884cacb9ae /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | 8bca372a4017e237c3379b1033c459fe44f328b8 (diff) | |
Introduce an API to get the recommended height of the InputMethodWindow
Bug: 11035379
Bug: 5137498
Change-Id: I0e920ee79c526c3aea6872b063cf294e2ab081c8
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 1b7d9eab9fc1..81ad28bba41d 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -2322,6 +2322,21 @@ public class InputMethodService extends AbstractInputMethodService { } /** + * @return The recommended height of the input method window. + * An IME author can get the last input method's height as the recommended height + * by calling this in + * {@link android.inputmethodservice.InputMethodService#onStartInputView(EditorInfo, boolean)}. + * If you don't need to use a predefined fixed height, you can avoid the window-resizing of IME + * switching by using this value as a visible inset height. It's efficient for the smooth + * transition between different IMEs. However, note that this may return 0 (or possibly + * unexpectedly low height). You should thus avoid relying on the return value of this method + * all the time. Please make sure to use a reasonable height for the IME. + */ + public int getInputMethodWindowRecommendedHeight() { + return mImm.getInputMethodWindowVisibleHeight(); + } + + /** * Performs a dump of the InputMethodService's internal state. Override * to add your own information to the dump. */ |
