Allow Mock IME to customize window height
With this CL, the height of the the input view of Mock IME can be
customized as follows:
try(MockImeSession imeSession = MockImeSession.create(
InstrumentationRegistry.getContext(),
InstrumentationRegistry.getInstrumentation().getUiAutomation(),
new ImeSettings.Builder()
.setInputViewHeightWithoutSystemWindowInset(300)) {
// Use imeSession to interact with the Mock IME here.
}
Note that, with a recent change in Android O [1], IMEs can opt-out
so-called NavigationGuard in DecorView with FLAG_LAYOUT_IN_OVERSCAN
so that IMEs can render contents behind the navigation bar. To avoid
confusions in "height" in that situation, the setting here does not
include that navigation bar height.
[1]: I2cecadb82d14564d7019a9636918b06c3bcf433c
af2e20e166171ba318da6fdcd824489ecead680f
Bug: 69845539
Test: atest CtsInputMethodTestCases
Change-Id: I5407539a31be7545e943303d578bbe1a860fcee0
2 files changed