How to call the Horizontal Keyboard when clicking on Edittext?

Asked

Viewed 473 times

1

Explanation:

I have an application that has a field of type EditText used for observation, of which it is too small, because there is no room for it.

If I open the screen in "horizontal orientation" mode and click on the field, Android takes care of opening a horizontal keyboard which has space to type and a button "finish", as we can see in the image below:

campo automatico android

I would like it to activate this Android feature always. Theoretically it is only triggered if the orientation is "lying down", that is, in the horizontal mode.

Question:

I want to know how to activate the Horizontal Keyboard regardless of the orientation that the user is, how can I do this?

2 answers

1

Could you display the Edittext XML you are using? In my case, the keyboard always works for both directions. Follow example.

<EditText
    android:id="@+id/user_name"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/edittext_bg_selector"
    android:hint="@string/user_name_hint"
    android:inputType="text"
    android:maxLength="@integer/user_name_max_length"
    android:maxWidth="@dimen/user_name_max_width"
    android:nextFocusDown="@+id/user_password"
    android:textColor="@android:color/black"
    android:textSize="@dimen/user_name_text_size"
    app:colorHint="@android:color/black"/>

0

I have the same problem of yours, but the need is reversed, because in my case I always wanted to open the keyboard of the orientation Portrait (vertical). For the research I did not how to change this setting by your app, because this layout is the keyboard you are using. To solve this you have to install a new keyboard template or develop one for your needs.

Follow the documentation to create a Custom Keyboard on Android

  • It didn’t work here, I tried everything that says there on the link, but it seems that it is no longer done that way, who knows this is depreciated, I do not know.... but I can’t implement.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.