Android输入法PinyinIME 或 Softkeyboard,在ORIENTATION_LANDSCAPE的机器上就会进入全屏模式,也就是文本框变大,除了文本框和什么都不显示了(其实可能也没有太多空间显示,不过如果是个大屏幕就难看的很了),要想解除全屏模式,需要参考如下的办法。
其实修改很简单,代码路径:platform/frameworks/base/core/java/android/inputmethodservice/InputMethodService.java
/**
* Re-evaluate whether the input method should be running in fullscreen
* mode, and update its UI if this has changed since the last time it
* was evaluated. This will call {@link #onEvaluateFullscreenMode()} to
* determine whether it should currently run in fullscreen mode. You
* can use {@link #isFullscreenMode()} to determine if the input method
* is currently running in fullscreen mode.
*/
public void updateFullscreenMode() {
-- boolean isFullscreen = mShowInputRequested && onEvaluateFullscreenMode();
++ boolean isFullscreen = false;
boolean changed = mLastShowInputRequested != mShowInputRequested;
if (mIsFullscreen != isFullscreen || !mFullscreenApplied) {
changed = true;
mIsFullscreen = isFullscreen;
InputConnection ic = getCurrentInputConnection();
if (ic != null) ic.reportFullscreenMode(isFullscreen);
mFullscreenApplied = true;
/**
* Override this to control when the input method should run in
* fullscreen mode. The default implementation runs in fullsceen only
* when the screen is in landscape mode. If you change what
* this returns, you will need to call {@link #updateFullscreenMode()}
* yourself whenever the returned value may have changed to have it
* re-evaluated and applied.
*/
public boolean onEvaluateFullscreenMode() {
Configuration config = getResources().getConfiguration();
if (config.orientation != Configuration.ORIENTATION_LANDSCAPE) {
return false;
}
if (mInputEditorInfo != null
&& (mInputEditorInfo.imeOptions & EditorInfo.IME_FLAG_NO_FULLSCREEN) != 0) {
return false;
}
return true;
}
ORIENTATION_LANDSCAPE模式就是所谓的横屏模式,参见Layout。只要LANDSCAPE就全屏,那必须是横屏又不能全屏的直接设置为false即可。