Android Question IMEX Keyboard layout

Rusty

Well-Known Member
Licensed User
Longtime User
I am using a small device (Samsung S7 for example, not a tablet) in landscape mode to enter an ID and Password into individual edittexts.
When the IMEX keyboard comes up, it covers the entire screen and the user can't see anything except the keyboard and the IMEX version of the edittext field.
Is there a way to shrink the "input area" (where the edittext field is displayed) so that the keyboard and display do not cover the entire screen and the input area is only as large as it needs to be?
I tried:
B4X:
Sub edtID_FocusChanged (HasFocus As Boolean)
    If HasFocus Then
        Dim Ref As Reflector
        Ref.Target = edtID
        Ref.RunMethod2("setImeOptions", 268435456, "java.lang.int") 'IME_FLAG_NO_EXTRACT_UI
        IMEx.ShowKeyboard(edtID)
...
End Sub

This doesn't work.
UPDATE: It doesn't work the first time the edtID gains focus and the above code is executed. However, if I click the DONE button and then cause the focuschanged event to fire again, the keyboard is correct. …?? no idea why...??
Further, every time the focuschanged event fires the process starts over again with the keyboard covering the entire screen; touch DONE button and it shrinks appropriately; do the data entry; Done button; re-focus the edtID edittext and the screen is covered again...
Any suggestions?
Thanks,
Rusty
 
Last edited:

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks Erel,
I've tried this alone and also upon Layout load; and also after layout load AND upon focus...
B4X:
Sub Activity_Create(FirstTime As Boolean)

...

    Activity.LoadLayout("Security")
    Dim Ref As Reflector
    Ref.Target = edtID
    Ref.RunMethod2("setImeOptions", 268435456, "java.lang.int")
    Ref.Target = edtPassword
    Ref.RunMethod2("setImeOptions", 268435456, "java.lang.int")
...
End Sub
 
 ...
 
previously posted focus event code (see above post)

Still no happiness
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
The attached is a small application that demonstrates the problem.
I should note that as I was building this example, I tested each step as I copied code into it.
At first the IMEX keyboard was working until I added the class INPUTTYPE, which sets the inputtype for both edittext views.
Then my problem began.
I need to be able to set the input types as well as hide suggestions and to not show the settings bar at the top of the keyboard, thus the InputType class.
I appreciate your help, ideas and suggestions...
Rusty
 

Attachments

  • EditText Tester.zip
    12.6 KB · Views: 163
Last edited:
Upvote 0
Top