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: 793
  • 1597673547592.png
    1597673547592.png
    20.7 KB · Views: 1,676
  • Sample B4J.zip
    2.5 KB · Views: 721
  • Sample B4A.zip
    8.3 KB · Views: 1,109
  • SD_TextView.B4xLib
    9.3 KB · Views: 352
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
found & worked.
Some improvement please > in RTL mode, right padding is zero & 1st letter fused with right border! You should increase right padding.
It seemed only in B4A. Fixed with version 0.04
 

giannimaione

Well-Known Member
Licensed User
Longtime User
wish:
max length (numbers of characters) and type (alfa, number, decimal, max decimal, .....)
 

Star-Dust

Expert
Licensed User
Longtime User
wish:
max length (numbers of characters) and type (alfa, number, decimal, max decimal, .....)
Already this you can do as in native view:

MaxLength
B4X:
Private Sub SD_IconTextView1_TextChanged (OldText As String, Newtext As String)
    If Newtext.Length>MaxLength Then
        SD_IconTextView1.Text=OldText
    End If
End Sub

B4A InputType
B4X:
SD_IconTextView1.NativeObject.InputType=SD_IconTextView1.NativeObject.INPUT_TYPE_DECIMAL_NUMBERS

B4i InputType
B4X:
SD_IconTextView1.NativeObject.KeyboardType=SD_IconTextView1.NativeObject.TYPE_NUMBER_PAD
 

aletayyeb

Member
I want add with designer but have error :

an error occurred.
unknown view:_sd_Icontextview
 

Attachments

  • uknown.png
    uknown.png
    81.1 KB · Views: 285

Star-Dust

Expert
Licensed User
Longtime User
I want add with designer but have error :

an error occurred.
unknown view:_sd_Icontextview
It's strange. Have you updated with the latest version?
You have to copy the xml file and the jar file to the libraries folder (or additional libraries)
 
Last edited:

aletayyeb

Member
Thank's for reply
I have lastest version(0.05)
but that's B4Xlib Type and I put on the additional library and cant find jar and xml files
and my b4a version is 10
 

Attachments

  • sd.png
    sd.png
    68.7 KB · Views: 261
  • sd_b4xlib.png
    sd_b4xlib.png
    55 KB · Views: 278

Star-Dust

Expert
Licensed User
Longtime User
Thank's for reply
I have lastest version(0.05)
but that's B4Xlib Type and I put on the additional library and cant find jar and xml files
and my b4a version is 10
you're right, my mistake, just the b4xlib file in the library folder is enough.

Make sure you don't have an older version in the Additional Libraries folder

I recommend that you delete the b4xlib file and download it again.
 

Star-Dust

Expert
Licensed User
Longtime User
If you experience this problem on other libraries, check if one library is conflicting with the others.

But a good thing is to get technical support.
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.06
Fix bug
 

Star-Dust

Expert
Licensed User
Longtime User
you can set other filters using the NativeObject property and assigning it to EditText (For Android) or TextField (B4i or B4j)

B4A sample
B4X:
Dim EditText1 As EditText = TextView.NativeObject
EditText1.InputType = EditText1.INPUT_TYPE_PHONE
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.07
Fix bug​
 
Top