Android Question B4X can I set B4XFloatText to INPUT_TYPE_NONE

tsteward

Well-Known Member
Licensed User
Longtime User
How can I set B4XFloatText field to INPUT_TYPE_NONE as I don't want the keyboard to open at all. I am using my own buttons for input.
 

tsteward

Well-Known Member
Licensed User
Longtime User
I have the following code but its no achieving what I want.
I'm using multiple B4XFloatTextFields and as each one gets focus it raises the keyboard.

I can put IME.hidekeyboard in event focus changed but the keyboard flashes up then hides which looks really dodgy.

I don't want the keyboard to display at all as I control what values the user enters into the fields by selecting buttons I show.
They also need to be able to select a field to make that one current, then the field having focus gets the input from the buttons.

Hopefully I'm doing something wrong or maybe a different view should be used. (This is a cross platform B4XPages app)

B4X:
count = 0
    For Each b4txt As B4XFloatTextField In Array(cutsTxtA1,cutsTxtA2,cutsTxtA3,cutsTxtA4,cutsTxtA5,cutsTxtA6,cutsTxtA7,cutsTxtA8,cutsTxtA9,cutsTxtA10,cutsTxtA11,cutsTxtA12)
        CutsA(count) = b4txt
        CutsA(count).mBase.Visible=False
        #IF B4A
        Dim et As EditText = b4txt.TextField
        et.InputType = et.INPUT_TYPE_NONE
        #END IF
        count = count+1
    Next
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Hopefully I'm doing something wrong
How about this for your case:
B4X:
For Each v As B4XView In Root.GetAllViewsRecursive
        If v.Tag Is B4XFloatTextField Then
            Dim b4txt  As B4XFloatTextField  = v.Tag
            #IF B4A
            Dim et As EditText = b4txt.TextField
            et.InputType = et.INPUT_TYPE_NONE
            #END IF
        End If
    Next
 
Upvote 0
Top