Compute content and visible insets even in voice mode
Bug: 4317779 Change-Id: If54d15466db9d0362b4470a2ba4618377bdffc2a
This commit is contained in:
parent
6d645e13e4
commit
46ca845848
1 changed files with 7 additions and 5 deletions
|
@ -901,15 +901,15 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
public void onComputeInsets(InputMethodService.Insets outInsets) {
|
public void onComputeInsets(InputMethodService.Insets outInsets) {
|
||||||
super.onComputeInsets(outInsets);
|
super.onComputeInsets(outInsets);
|
||||||
final KeyboardView inputView = mKeyboardSwitcher.getInputView();
|
final KeyboardView inputView = mKeyboardSwitcher.getInputView();
|
||||||
|
if (inputView == null)
|
||||||
|
return;
|
||||||
|
final int containerHeight = mCandidateViewContainer.getHeight();
|
||||||
|
int touchY = containerHeight;
|
||||||
// Need to set touchable region only if input view is being shown
|
// Need to set touchable region only if input view is being shown
|
||||||
if (inputView != null && mKeyboardSwitcher.isInputViewShown()) {
|
if (mKeyboardSwitcher.isInputViewShown()) {
|
||||||
final int containerHeight = mCandidateViewContainer.getHeight();
|
|
||||||
int touchY = containerHeight;
|
|
||||||
if (mCandidateViewContainer.getVisibility() == View.VISIBLE) {
|
if (mCandidateViewContainer.getVisibility() == View.VISIBLE) {
|
||||||
touchY -= mCandidateStripHeight;
|
touchY -= mCandidateStripHeight;
|
||||||
}
|
}
|
||||||
outInsets.contentTopInsets = touchY;
|
|
||||||
outInsets.visibleTopInsets = touchY;
|
|
||||||
final int touchWidth = inputView.getWidth();
|
final int touchWidth = inputView.getWidth();
|
||||||
final int touchHeight = inputView.getHeight() + containerHeight
|
final int touchHeight = inputView.getHeight() + containerHeight
|
||||||
// Extend touchable region below the keyboard.
|
// Extend touchable region below the keyboard.
|
||||||
|
@ -920,6 +920,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
}
|
}
|
||||||
setTouchableRegionCompat(outInsets, 0, touchY, touchWidth, touchHeight);
|
setTouchableRegionCompat(outInsets, 0, touchY, touchWidth, touchHeight);
|
||||||
}
|
}
|
||||||
|
outInsets.contentTopInsets = touchY;
|
||||||
|
outInsets.visibleTopInsets = touchY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue