Android Question Input order in Edit Text

Cesaral

Member
I have a page with many input field that have numeric values:

1672667684635.png


How can I set up from the code the input order of these fields? They all have PHONES and numbers. When the keyboard appears to fill in one field, if I press the SIG key on it it goes to the next field. How can I decide which one is the next field from the layout designer?
 

spsp

Active Member
Licensed User
Longtime User
I have a page with many input field that have numeric values:

View attachment 137591

How can I set up from the code the input order of these fields? They all have PHONES and numbers. When the keyboard appears to fill in one field, if I press the SIG key on it it goes to the next field. How can I decide which one is the next field from the layout designer?
Hi,

in the designer, in the 'View List tab' you can reorder the views.

1672688981855.png


Click on a view and move it where you want. the focus follows this order.

spsp
 
Upvote 0

Cesaral

Member
Unfortunatelly it still does not work. This is the code I added to Activity_Create:

B4X:
    Dim Access As Accessibility
    Access.SetNextFocusDown(EditText1, EditText2)
    Access.SetNextFocusDown(EditText2, EditText3)
    Access.SetNextFocusDown(EditText3, EditText4)
    Access.SetNextFocusDown(EditText4, EditText5)
    Access.SetNextFocusDown(EditText5, EditText6)
    Access.SetNextFocusDown(EditText6, EditText7)
    Access.SetNextFocusDown(EditText7, EditText8)
    Access.SetNextFocusDown(EditText8, EditText9)
    Access.SetNextFocusDown(EditText9, EditText10)
    Access.SetNextFocusDown(EditText10, EditText_R1)
    Access.SetNextFocusDown(EditText_R1, EditText_R2)
    Access.SetNextFocusDown(EditText_R2, EditText_R3)
    Access.SetNextFocusDown(EditText_R3, EditText_R4)

The navigation is erratic when I press the "Sig" (Next) button:

1672738126103.png
 
Upvote 0

Cesaral

Member
Why are you wasting your time with activities???

Switch to B4XPages. You can also use B4XFloatTextField from XUI Views. It has a NextField property which you can assign.
My App is already done, without B4Xpages....sorry. Is there any way to make it work with what I already have? I followed the designer guide and the Accessibility library and none worked. Thanks!
 
Upvote 0

Cesaral

Member
Also
Why are you wasting your time with activities???

Switch to B4XPages. You can also use B4XFloatTextField from XUI Views. It has a NextField property which you can assign.also if I use B4XFloatTextField
But using B4XFloatTextField, some of the properties that I currently use and need, basically Textcolor, SelectionStart, and Enabled seem to be no longer available, and this is a big problem for me as I need them also.
 
Upvote 0

Cesaral

Member
B4XFloatTextField.TextField returns the internal EditText. You can modify it as needed.
Thanks! But what about the other properties I need (basically Textcolor, SelectionStart, and Enabled)? Wouldn´t it not be better to make EditText work well?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Thanks! But what about the other properties I need (basically Textcolor, SelectionStart, and Enabled)?
B4X:
Dim et As EditText = B4XFloatTextField1.TextField
et.<all properties>

Wouldn´t it not be better to make EditText work well?
EditText is a native view. B4XFloatTextField wraps it and adds more features. And is cross platform.
 
Upvote 0
Top