For Each vw As View In Activity.GetAllViewsRecursive
If Not(vw Is EditText) Then
SetFocusable(vw, False)
End If
Next
B4X:
Sub SetFocusable(Vw As View, Focusable As Boolean)
Dim obj1 As Reflector
obj1.Target = Vw
If Focusable Then
obj1.RunMethod2("setFocusable", "True", "java.lang.boolean")
Else
obj1.RunMethod2("setFocusable", "False", "java.lang.boolean")
End If
End Sub
Ultima cosa se può servire ...
In b4J nel codice di LucaMs va modificata la view in node e il metodo da usare è setFocusTraversable che è comune a tutti gli oggetti.
B4X:
For Each n As Node In MainForm.RootPane.GetAllViewsRecursive
If Not(n Is TextField) Then
Log(n)
Globals.SetFocusable(n, False)
End If
Next
B4X:
Sub SetFocusable(n As Node, Focusable As Boolean)
Dim obj1 As Reflector
obj1.Target = n
If Focusable Then
obj1.RunMethod2("setFocusTraversable", "True", "java.lang.boolean")
Else
obj1.RunMethod2("setFocusTraversable", "False", "java.lang.boolean")
End If
End Sub