B4A Library [B4X] [XUI] [B4XLib] SD TextView

I needed to develop a modern editText (or TextField), but different from the B4XFloatTextField, different in terms of graphics and style. So I created the SD_TextView
(see also xComboBox)

NOTE: You can use this library for personal and commercial use. Include it in your projects.. Attention, even if it is a B4XLib library, it is not allowed to decompress it, modify it, change its name or redistribute it without the permission of the author

SD_TextView

Author:
Star-Dust
Version: 0.24
  • SD_IconTextView
    • Events:
      • EnterPressed
      • FocusChanged (HasFocus As Boolean)
      • HintClick
      • TextChanged (OldText As String, Newtext As String)
    • Fields:
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
        Base type must be Object
      • GetBase As B4XView
      • Initialize (Callback As Object, EventName As String)
    • Properties:
      • Hint As String
      • HintFont As B4XFont
      • NativeObject As TextField [read only]
      • Text As String
      • TextFont As B4XFont
  • SD_TextView
    • Events:
      • EnterPressed
      • FocusChanged (HasFocus As Boolean)
      • TextChanged (OldText As String, Newtext As String)
    • Fields:
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
        Base type must be Object
      • GetBase As B4XView
      • Initialize (Callback As Object, EventName As String)
      • SetHintColor (HintTextColor As Int, HintBackGroundColor As Int)
      • SetTextViewColor (TextColor As Int, BackGroundColor As Int, Corner_Color As Int)
    • Properties:
      • AnimateHint As Boolean
      • Hint As String
      • HintFont As B4XFont
      • NativeObject As TextField [read only]
      • Text As String
      • TextFont As B4XFont
  • SD_TwoIconTextView
    • Events:
      • Click
      • EnterPressed
      • FocusChanged (HasFocus As Boolean)
      • HintClick
      • TextChanged (OldText As String, Newtext As String)
      • Unfocus
    • Fields:
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
        Base type must be Object
      • GetBase As B4XView
      • Initialize (Callback As Object, EventName As String)
    • Properties:
      • Hint As String
      • HintFont As B4XFont
      • NativeObject As TextField [read only]
      • Text As String
      • TextConfirmButton As String
        Char fontAwesone
      • TextFont As B4XFont
  • SD_UnderLineTextView
    • Events:
      • EnterPressed
      • FocusChanged (HasFocus As Boolean)
      • TextChanged (OldText As String, Newtext As String)
    • Fields:
      • ExpansionTime As Int
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
        Base type must be Object
      • GetBase As B4XView
      • Initialize (Callback As Object, EventName As String)
      • UnderLine (Show As Boolean)
    • Properties:
      • Hint As String
      • HintFont As B4XFont
      • NativeObject As TextField [read only]
      • Text As String
      • TextFont As B4XFont

1605734557938.png


1605734432742.png


Video.gif
Underline1.gif


1645032504598.png
1645129052006.png
 

Attachments

  • Sample B4i.zip
    110.6 KB · Views: 833
  • 1597673547592.png
    1597673547592.png
    20.7 KB · Views: 1,721
  • Sample B4J.zip
    2.5 KB · Views: 766
  • Sample B4A.zip
    8.3 KB · Views: 1,157
  • SD_TextView.B4xLib
    9.3 KB · Views: 411
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update 0.16
  • Fix Bugs
 

JohnJ

Member
Licensed User
Longtime User
I didn't quite understand what is not working well and which class you are writing about

This is the expected behavior. By Hint we mean the icon (if you use FontAwesone) or the text (if you use a normal font) enclosed in the drop.
While if you want the traditional hint you have to access the native property.
Hi

I downloaded this library last week. Nice work, these text fields look really nice. I have noticed that the EnterPressed event does not fire if the Password check box is enabled, this is for the sd_icontextview in B4J on Windows 10. I have not checked the other text fields.

Thanks
John
 

Star-Dust

Expert
Licensed User
Longtime User
Hi

I downloaded this library last week. Nice work, these text fields look really nice. I have noticed that the EnterPressed event does not fire if the Password check box is enabled, this is for the sd_icontextview in B4J on Windows 10. I have not checked the other text fields.

Thanks
John
If your problem was on B4J try the latest update
 

JohnJ

Member
Licensed User
Longtime User
If your problem was on B4J try the latest update
I have the latest version of B4J. If you take your B4J sample that was included in your post and add the ENTERPRESSED event to SD_ICONTEXTVIEW2, then in your code add a line in the generated event to log something. Run the program, enter something into that field, and press enter. The log will show whatever you keyed into the log statement. Now change SD_ICONTEXTVIEW2 by making it a password field and run that. The log does not show anything as the event is not fired.
 

Star-Dust

Expert
Licensed User
Longtime User
I have the latest version of B4J. If you take your B4J sample that was included in your post and add the ENTERPRESSED event to SD_ICONTEXTVIEW2, then in your code add a line in the generated event to log something. Run the program, enter something into that field, and press enter. The log will show whatever you keyed into the log statement. Now change SD_ICONTEXTVIEW2 by making it a password field and run that. The log does not show anything as the event is not fired.
What version are you using?
 

werner_Fourie

Member
Licensed User
Longtime User
Hi Everyone

How can I use the force done with this...
Very nice control but I need that option..

Regards
 

Star-Dust

Expert
Licensed User
Longtime User
Use the NativeObject method to access the native properties of the view and you can select ForceDone to True
 

werner_Fourie

Member
Licensed User
Longtime User
Use the NativeObject method to access the native properties of the view and you can select ForceDone to True
Hi Star Dust..

Nice control..

Do You have an example for me please..Don't know how to do it yet with NativeObject..

Thank You for the response
 

Star-Dust

Expert
Licensed User
Longtime User
Hi Star Dust..

Nice control..

Do You have an example for me please..Don't know how to do it yet with NativeObject..

Thank You for the response
Which class are you using?
 

Star-Dust

Expert
Licensed User
Longtime User
Use the NativeObject method to access the native properties of the view and you can select multi-line
 

Star-Dust

Expert
Licensed User
Longtime User
B4X:
#IF B4A
SD_IconTextView1.NativeObject.SingleLine=False
#ELSE IF B4i
' do not possible - TextField is only sigle line
#ELSE IF B4J
' do not possible - TextField is only sigle line
#END IF
 

Ganiadi

Active Member
Licensed User
Longtime User
B4X:
#IF B4A
SD_IconTextView1.NativeObject.SingleLine=False
#ELSE IF B4i
' do not possible - TextField is only sigle line
#ELSE IF B4J
' do not possible - TextField is only sigle line
#END IF
Tks for your example, but a Pity it's not possible for b4j

Tks
 
Top