B4A Library [B4X] B4XThreeState - B4XView

I needed something similar to StateListDrawable B4A but cross-platform (B4X).

Since I was in a hurry, I settled for developing it just for the images.

Obviously you can replace the 3 images (for the 3 states: ENABLED, DISABLED, PRESSED) via properties.

Events: Click and LongClick.

java_gRjns2nRUZ.gif


I don't own Apple stuff (iOS, Mac, ...), so I can't guarantee that it will also work with B4i (but being a B4XLib library, you have the source code and can fix it if necessary).

java_2dUuogzCHE.gif
 

Attachments

  • B4XThreeState.b4xlib
    37.4 KB · Views: 157
Last edited:

LucaMs

Expert
Licensed User
Longtime User
Cool, it seems like it has a bug :confused:
I was in too much of a hurry.

For some strange reason the B4XImageView used seems not to be ready when you set other images (strange, because in the example, the animated gif, it works without problems).

Now I can't fix it, I don't have time; I'll do it in a couple of hours, most likely. Besides, I also have to create a thread for this today, which should be ok.
 

LucaMs

Expert
Licensed User
Longtime User
Cool, it seems like it has a bug :confused:
I was in too much of a hurry.

For some strange reason the B4XImageView used seems not to be ready when you set other images (strange, because in the example, the animated gif, it works without problems).

Now I can't fix it, I don't have time; I'll do it in a couple of hours, most likely. Besides, I also have to create a thread for this today, which should be ok.

Fixed.
 
Last edited:
Top