Android Question B4XFloatTextField Definitive Guide

mmieher

Active Member
Licensed User
Longtime User
Can someone please point me to the definitive guide to B4XFloatTextField? I have looked at almost every post in the forum, and plowed though all the Guides. The XUI example only does a B4XFloatTextField1.NextField. That's it.

I am trying to create a class that does something like the "..." next to the Text property in Visual Designer. I want to pop up a window where the abuser can enter a bunch of text. Maybe B4XFloatTextField is the wrong thing?

I have a class with a Designer LoadLayout in the DesignerCreateView. It has a Panel with a B4XFloatTextField in it. I cannot seem to get the height of B4XFloatTextField1.TextField to be more than 35dip. I change the height in DesignerCreateView. I log the result which looks good. But when I run the App, the TextField.Height is always 35dip. I want it to be 280dip.

Also, I have set lblClear.top and lblV.top to the same number, but they end up at different y-locs. They must be in different panels. I have tried looping through B4XFloatTextField.TextField.GetAllViewsRecursive but cannot figure out what is going on.

Marc
 

mmieher

Active Member
Licensed User
Longtime User
Ok. I "simply add it with the Designer".

Must be missing something simple. Attached is a small project. Crash on LoadLayout:
java.lang.RuntimeException: java.lang.ClassCastException: java.lang.String cannot be cast to android.widget.TextView

Main
B4X:
Sub Process_Globals
End Sub

Sub Globals
    Private mTextTest As mText
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")
    Sleep(0)
End Sub

mText Class
B4X:
Sub Class_Globals
    Private mEventName As String 'ignore
    Private mCallBack As Object 'ignore
    Private mBase As B4XView 'ignore
    Private xui As XUI 'ignore
    
    Private DebugLevel As Int = 1
    
    Public fxText As B4XFloatTextField
    
End Sub

Public Sub Initialize (Callback As Object, EventName As String)
    LogSub("Initialize: " & EventName)
    mEventName = EventName
    mCallBack = Callback
End Sub

Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
    '    Lbl is the entire view from the Designer.  fxWhatever
    LogSub("DesignerCreateView")
    mBase = Base
    mBase.LoadLayout("mTextLayout")
    
End Sub

Public Sub GetBase As Panel
    Return mBase
End Sub

Private Sub fxText_TextChanged (Old As String, New As String)
    LogSub("fxText_TextChanged")
End Sub

Public Sub LogSub(inText As String)
    If DebugLevel = 0 Then Return
    #If DEBUG
    Dim Unit As String = "mText"
    Dim clrLog As Int = 0xFF4DC244
    
    DateTime.TimeFormat = "hh:mm:ss"
    Dim ssTime As String = DateTime.Time(DateTime.Now)
    LogColor(Unit & " " & ssTime & " " & inText,clrLog)
    #End If
End Sub
 

Attachments

  • mTextTest.zip
    10.8 KB · Views: 220
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
You are so right about me making it too hard. Sorry about the error message thing. I did not even notice I left out the important part.
 
Upvote 0
Top