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: 687
  • 1597673547592.png
    1597673547592.png
    20.7 KB · Views: 1,569
  • Sample B4J.zip
    2.5 KB · Views: 604
  • Sample B4A.zip
    8.3 KB · Views: 965
  • SD_TextView.B4xLib
    9.3 KB · Views: 207
Last edited:

behnam_tr

Active Member
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

dont exist such object in b4j
 

Star-Dust

Expert
Licensed User
Longtime User
dont exist such object in b4j
As you may have noticed, it says B4A Sample.
While if you want to do it in B4J the view is TextField.

PS. In B4J there is no native method to filter the input, that I know of. I need to check when raising event while typing text
 

behnam_tr

Active Member
Licensed User
Longtime User
As you may have noticed, it says B4A Sample.
While if you want to do it in B4J the view is TextField.

PS. In B4J there is no native method to filter the input, that I know of. I need to check when raising event while typing text

i make a customview(textfield) for b4j
that have filter for numbers and convert to currency format runtime
but need some change
can you check that??
how can i send for you??
thanks
 

Star-Dust

Expert
Licensed User
Longtime User
It's a control you can insert into the EnterPressed event using a notification library.

I don't see the need to insert a control upstream of the event. It would burden the library because I would have to insert an extra class for notifications

I don't know Devexpress I'm sorry.
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
i make a customview(textfield) for b4j
that have filter for numbers and convert to currency format runtime
but need some change
can you check that??
how can i send for you??
thanks
I do not understand
 

Ertan

Active Member
Licensed User
Hello Thanks for your library. I noticed something.

If I change the font color to red, it also makes the frame color red. But I just want to make the EditText color red.
I did this with code;
B4X:
Dim EditText1 As EditText = SD_TextView4.NativeObject
    EditText1.TextColor=Colors.Blue
I still set the border color from Text Color.

In addition;

Screenshot_27.png


We are getting this error from two separate computers.
I use library versions : 0.07

Thanks.
 

Star-Dust

Expert
Licensed User
Longtime User
Hello Thanks for your library. I noticed something.

If I change the font color to red, it also makes the frame color red. But I just want to make the EditText color red.
Yes, it is actually designed that way. Did you need to separate the colors?

In addition;

View attachment 103159

We are getting this error from two separate computers.
I do not know. But does it only do this on some computers? B4A, Bai or B4J? Have you copied the b4xlib files to the additional libraries folder?
 

Ertan

Active Member
Licensed User
I do not know. But does it only do this on some computers?
I tried it on two computers in the office. I encountered the same error. There is no library in my library that will conflict. (I think so)..
Yes, it is actually designed that way. Did you need to separate the colors?
But this is a little tiring when it comes to design. It would have been nicer to be able to adjust the individual colors. We wouldn't have to write additional code :)

-----------

Screenshot_28.png


In your sample project, I could not see this either. Do you have a chance to add?
 

Ertan

Active Member
Licensed User
I do not know. But does it only do this on some computers? B4A, Bai or B4J? Have you copied the b4xlib files to the additional libraries folder?
I always copy the downloaded libraries to the Additional Libraries folder.

I checked the normal library folder but could not see it from the same library.

I just tried it with B4J, but it gave the same error.
Screenshot_29.png



We cannot adjust the panel corner edge radius either. Too many corners How can we reduce its angularity?
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update 0.08
  1. It is possible to choose the color of the frame from the design
 

Ertan

Active Member
Licensed User
Update 0.08
  1. It is possible to choose the color of the frame from the design
It would be nice to be able to adjust the spacing of the text from the area in the picture.
Screenshot_30.png

It can be done with code but is not functional.

B4X:
    Dim EditText1 As EditText = SD_TextView4.NativeObject
    EditText1.Gravity=Gravity.CENTER

We cannot adjust the panel corner edge radius either. Too many corners How can we reduce its angularity?

The error has not gone away yet. :/

I wanted to help you make this beautiful library more functional and beautiful.

I would be very grateful if you could show me how to create this component. :D
 

Star-Dust

Expert
Licensed User
Longtime User
I always copy the downloaded libraries to the Additional Libraries folder.

I checked the normal library folder but could not see it from the same library.

I just tried it with B4J, but it gave the same error.
View attachment 103163


We cannot adjust the panel corner edge radius either. Too many corners How can we reduce its angularity?
I always copy the downloaded libraries to the Additional Libraries folder.

I checked the normal library folder but could not see it from the same library.

I just tried it with B4J, but it gave the same error.
View attachment 103163


We cannot adjust the panel corner edge radius either. Too many corners How can we reduce its angularity?
Try the attached examples (which have been updated) and see if you run into the same problem.
The indicated object has the wrong class name. It is not _SD_TextView as it appears in the image but SD_TextView.
Also try deleting the views and inserting them again. Perhaps you entered an old class that no longer exists
 

Star-Dust

Expert
Licensed User
Longtime User
It would be nice to be able to adjust the spacing of the text from the area in the picture.
View attachment 103166
It can be done with code but is not functional.

B4X:
    Dim EditText1 As EditText = SD_TextView4.NativeObject
    EditText1.Gravity=Gravity.CENTER

We cannot adjust the panel corner edge radius either. Too many corners How can we reduce its angularity?

The error has not gone away yet. :/

I wanted to help you make this beautiful library more functional and beautiful.

I would be very grateful if you could show me how to create this component. :D
Be satisfied with the changes made. I don't have time to implement all your requests, sorry.
 

Ertan

Active Member
Licensed User
Be satisfied with the changes made. I don't have time to implement all your requests, sorry.
I found the source and solution of the problem.

I get this error when I right click on the design and click Add Layout.

Screenshot_31.png


This situation returns as an error on both computers.

But..

Screenshot_33.png

successfully adding layout.

When I add CustomView from the Add New button next to the file button, I do not get this error.
 

Star-Dust

Expert
Licensed User
Longtime User
I found the source and solution of the problem.

I get this error when I right click on the design and click Add Layout.

View attachment 103170

This situation returns as an error on both computers.

But..

View attachment 103171
successfully adding layout.

When I add CustomView from the Add New button next to the file button, I do not get this error.
I report this to Erel (Here). In fact it looks like a bugs in the IDE environment
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
I will ask Erel to delete my post
 

Star-Dust

Expert
Licensed User
Longtime User
NEXT UPDATE TwoIconTextView

1605718336954.png
 
Top