B4A Library TextDrawable V1.0.2

DonManfred

Expert
Licensed User
This light-weight library provides images with letter/text like the Gmail app. It extends the Drawable

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Dim td As TextDrawable
    Private Button1 As Button
    Private Button2 As Button
    Private Button3 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
    Button1.Background = td.CreateDrawableRect("B4i",Colors.DarkGray,Colors.Blue,-1,Typeface.MONOSPACE)
    Button2.Background = td.CreateDrawableRound("B4A",Colors.Magenta, Colors.Yellow,-1,Typeface.MONOSPACE)
    Button3.Background = td.CreateDrawableRoundRect("B4J",Colors.Cyan,50, Colors.Black,-1,Typeface.MONOSPACE)
End Sub
 

Attachments

Last edited:

DonManfred

Expert
Licensed User
Initialize method to CreateDrawable
CreateDrawableRect instead of InitializeRect?

It should work with lower apis too... i used 19 in eclipse... but i changed it to 8 now and works too..

Will update the lib in a few minutes so you can test it again if you want

Edit: V1.0.1 uploaded. Can you please check with lower sdk? i think 8 should be enough but i´m not sure ;)
 
Last edited:

NJDude

Expert
Licensed User
Also, compile with a current version of B4A, it seems you are using the latest BETA, the warning in the beginning might confuse some users.
 

incendio

Well-Known Member
Licensed User
Hi,

Thanks for the library, is that possible to set font size and font style(Bold/Italic/Underline) in the Button?
 

barx

Well-Known Member
Licensed User
I´m sorry. I have had a look... Maybe it´s my java-knowledge about Classes... I´m not able to change anything it seems. I can hardcode other values but that´s not what we need.

I can for sure give the source of this library. If there is someone who can do this.
maybe put the source on gitHub and baybe someone could help?
 

DonManfred

Expert
Licensed User
maybe put the source on gitHub and baybe someone could help?
I´ll first try to upload the Library here and maybe someone (look into the round ;)) want to have a look at it :rolleyes:
 

Attachments

NJDude

Expert
Licensed User
Actually no. But i´ll extend the Library for this...
I think the way this library is should be fine, after all, these buttons are just to "highlight" something, no need to get too fancy.

My opinion.
 

johndb

Active Member
Licensed User
I think the way this library is should be fine, after all, these buttons are just to "highlight" something, no need to get too fancy.

My opinion.
I'm in agreement with you NJDude except for one desired enhancement. It would be helpful to allow for the character color within the TextDrawable to be changed to a color other than white. White text on lighter backgrounds makes it difficult to see the character. If we had a minimum enhancement of either selecting White or Black as the character color that would be great?

John
 
Top