Android Question [B4A] "Pressed" colors of Labels and Panels

ziovec

Member
Licensed User
Hello there, hope I'm posting this question in the right section ;)

In my project I have a slide menu made with B4XDrawer.
Menu entries are basically panels with two labels inside: one for the icon and one for the text.
Is there a way to change the color of the entire panel when it's pressed and make those act like button?
I noticed that using ListView for menu entries let the single lines acting like i would like, but I'm not sure I can add an icon to the left using FontAwesome...am I dumb? :p

Here's some screenshots.
Hope you can help me out! :D

Annotazione 2020-07-21 190518.png


Annotazione 2020-07-21 190619.png
 

ziovec

Member
Licensed User
Never use ListView.

Use xCustomListView. It is very simple to create a list with images.
.
I'll give it a look, thanks for the tip!

By the way, is there a "easy" way to change label/panel color while they're pressed?
I guess I could set a different background color in sub label_click and after a while reset it to the original, but it looks unconventional to me ?
 
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
Though it is recommended to use xcustomlistview, sometimes it is overkill for the job in hand.

but I'm not sure I can add an icon to the left using FontAwesome...am I dumb?
You can use csbuilder to have FontAwesome/MaterialIcons as icon on left,
B4X:
    Dim cs As CSBuilder
...
    lstMenu.AddSingleLine( cs.Initialize.Typeface(Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE887)).PopAll.Append(" Help using this app") )
...

Regards,

Anand
 
Upvote 0
Top