B4A Library CharCounter

NJDude

Expert
Licensed User
This library will allow you to add a character counter to EditTexts.

The counter can be ascending or descending.


Requirements:

1- Copy the CharCounter.jar and CharCounter.xml to your additional libraries directory.


Usage:
B4X:
'Initialize the library
Dim Ascending As CharCounter

'Add the counter to an EditText
Ascending.Initialize(Activity, EditText1, 10, "A", "L", "Length: ")


'Add this line to the TextChanged event (in this sample, EditText1)
Sub EditText1_TextChanged(Old As String, New As String)

    Ascending.Update(Old, New)

End Sub
That's it.

A sample project is attached.
 

Attachments

Last edited:

cds-soft

Member
Licensed User
Thanks for this. Should be the posibility to hide the prompt? If i pass "" or Null it still appear. I'm ussing this in a scrollview, and the prompt is not attached with the edit and doesn't scroll with it. Thanks.
 

cds-soft

Member
Licensed User
How are you initializing the EditTexts?, do you have a small sample code for me to try?, if you do, please attach the ZIP file to a post.
Well, it's a big project now, so I have to make a simple example. This weekend.
Now i make the charcounter not visible and it's enough from now.
Thanks for your reply.
 
Top