4
votes

I'm looking for an answer to this exact question, but from the perspective of the user. That is, if tablets show the normal app UI even when the keyboard is visible in landscape mode, what causes phones to not do this? I hate that "full-screen" edit box and would much rather see the remaining half of the app's normal UI (although there may be less of it visible; with today's huge phones, there's still "plenty" of screen real estate available).

Is there, for instance, a configuration file somewhere in which one might tweak a setting (viz. making the device believe its screen is bigger, or some similar effect)? I'm fully aware that this would probably require root, and I'm fine with that. To be clear, I know that altering all the "offending" apps is neither feasible nor desirable.

I realize that this isn't strictly a programming question, but it's extremely difficult to put together phrase that will get even a few sensible search results. For the record, I'm using a Nexus 4, but the issue is basically device- and version-agnostic.

2

2 Answers

6
votes

According to the docs:

IME_FLAG_NO_EXTRACT_UI: For input methods that may be fullscreen, often when in landscape mode, this allows them to be smaller and let part of the application be shown behind. Though there will likely be limited access to the application available from the user, it can make the experience of a (mostly) fullscreen IME less jarring. Note that when this flag is specified the IME may not be set up to be able to display text, so it should only be used in situations where this is not needed.

Because a phone has smaller screen real estate, it may make it harder for the user to see the entire UI and be able to operate it correctly, especially if you have some "taller" UI elements which may not fit into screen in landscape mode.

Update: Looking at an OS-level perspective, the solution lies within (at least in ICS) android/inputmethodservice/InputMethodService.java:2107:

/**
 * Called when the fullscreen-mode extracting editor info has changed,
 * to determine whether the extracting (extract text and candidates) portion
 * of the UI should be shown.  The standard implementation hides or shows
 * the extract area depending on whether it makes sense for the
 * current editor.  In particular, a {@link InputType#TYPE_NULL}
 * input type or {@link EditorInfo#IME_FLAG_NO_EXTRACT_UI} flag will
 * turn off the extract area since there is no text to be shown.
 */
public void onUpdateExtractingVisibility(EditorInfo ei) {
    if (ei.inputType == InputType.TYPE_NULL ||
            (ei.imeOptions&EditorInfo.IME_FLAG_NO_EXTRACT_UI) != 0) {
        // No reason to show extract UI!
        setExtractViewShown(false);
        return;
    }

    setExtractViewShown(true);
}

To remove this functionality you would have to override onUpdateExtractingVisibility(EditorInfo) and call perhaps setExtractViewShown(false) within without calling super.

1
votes

This simple solution works for me on runtime

editTxt.setImeOptions(editTxt.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);

IME_FLAG_NO_EXTRACT_UI is the only solution

for xml layouts add this line in edit text

android:imeOptions="flagNoExtractUi"

--- there are other options like onUpdateExtractingVisibility onCreateInputConnection

but by above options you have flexibility whether to show fullscreen keyboard layout or not