4

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.

Community
  • 1
  • 1
KlaymenDK
  • 714
  • 9
  • 31

2 Answers2

6

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.

Oleg Vaskevich
  • 12,444
  • 6
  • 63
  • 80
  • Thank you for your quick reply. This is good information, but it seems to me that the information you link to pertains to settings in the source code of an app. I would rather know if there is an OS-level solution, that being favourable over modifying all "offending" apps (pretending that that were even possible). I am quite aware that there would be less screen real estate for the app UI, but with a modern phone there is still "plenty" for most uses. – KlaymenDK Jan 05 '13 at 16:46
  • Ooohkay, that does not look like something one "simply" does. Even so, I'm very glad to know it. It's odd, though, that the referenced code seems to not be dependent on display size. – KlaymenDK Jan 05 '13 at 20:48
  • Oh, now I get it! `InputMethodService` is used to make custom keyboards; for example, see [this link](http://eyes-free.googlecode.com/svn-history/r405/trunk/CircleIME/src/com/marvin/circleime/SoftKeyboard.java) - the code is commented out. My guess is that on tablets the Android keyboard used comment out this code as well. You'll also notice that some other keyboards (such as Swype, I believe) do not have this behavior even on smaller screens. – Oleg Vaskevich Jan 05 '13 at 21:01
  • I marked this as accepted. Not because it works, but to close this question that apparently has no good answer. Thanks, Oleg! – KlaymenDK Apr 05 '16 at 08:57
1

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

Diljeet
  • 1,896
  • 20
  • 24