Android Tutorial Similar to FloatLabeledEditText

Someone asked me to do something like FloatLabeledEditText.

I made this example. It is not identical, but it is a track or a point of partenzs for those who want to create a similar one
 

Attachments

Inside there is the source code. You should try with the Accessibility library to get an overview of EditText.

But I think we can do it. At the moment I'm busy on another front :-p
 
In the class, add the declaration of events to the top of the code
Code:
#Event: TextChanged (Old As String, New As String)
#Event: FocusChanged (HasFocus As Boolean)
#Event: EnterPressed

Edit the Sub TextChanged as shown below:
Code:
Private Sub MyEditText_TextChanged (Old As String, New As String)
    HintAnimation(New.Length>0)
    If SubExists(mCallBack,mEventName & "_TextChanged") Then CallSub3(mCallBack,mEventName & "_TextChanged",Old,New)
End Sub

Add these two SUB
Code:
Private Sub MyEditText_FocusChanged (HasFocus As Boolean)
    If SubExists(mCallBack,mEventName & "_FocusChanged") Then CallSub2(mCallBack,mEventName & "_FocusChanged",HasFocus)
End Sub

private Sub MyEditText_EnterPressed
    If SubExists(mCallBack,mEventName & "_EnterPressed") Then CallSub(mCallBack,mEventName & "_EnterPressed")
End Sub
 
thank you so much for reply ,, Grazie Mille

sorry , but it seems there is no top properties
Code:
Sub txtCard_FocusChanged (HasFocus As Boolean)
    Dim Send As LabelExended '
        If HasFocus Then
        Send = Sender
        Log(Sender)
        SV.ScrollPosition = Send.Top - 20dip
    End If
End Sub
 
Last edited:
thank you so much for reply ,, Grazie Mille

sorry , but it seems there is no top properties
Code:
Sub txtCard_FocusChanged (HasFocus As Boolean)
    Dim Send As LabelExended '
        If HasFocus Then
        Send = Sender
        Log(Sender)
        SV.ScrollPosition = Send.Top - 20dip
    End If
End Sub
I do not understand what you mean. Sorry
 
There is a quite powerful and cross platform implementation of a float labeled text field in XUI Views.

yes i know , but in FloatLabeledEditText i can't set the right gravity property for the Hint especially during typing in Edittext and there is no animation for hint.
 
I do not understand what you mean. Sorry
 
Back
Top