2019-07-01 03:35 AM
In my current project i have a menu. The graphic guy decide every menu part have an icon, a text and a small arrow, all are gray end when are pressed they became blue. any way to make them all show pressed state when i click one? Or should i make a big image(mostly empty) with all 3 image on it?
Thanks
2019-07-01 05:43 AM
Hi @Zui,
It sounds to me like your graphics guy did not know that it would make your life MUCH easier to just make one single image =) Yes, you can do what you ask, simply call bitmap.setBitmap() on your images witth the new bitmap id (The color you want) and then bitmap.invalidate();
/Martin
2019-07-01 05:44 AM
(But, i would just ask him to redo the image - It makes the code less complex also)
2019-07-01 06:11 AM
that's not clear to me, where i call the setBitmap() function? because the image should change when button is pressed, but function is called when button is released. let's say mu butto call foo(), when it is pressed it switch the image to his pressed image (and here i should call my function to change other images, but i have no idea how to intercept this event, i can't reimplement handleClickEvent because i can intercept every ClickEvent::PRESSED, but can't distingue the source of the click event) and he call his assign fuction when is released, here i can add what i want, but i need to switch image when it's pressed and holded, not released...
2019-07-01 06:40 AM
another problem is i should also change the color of a text, so i can't use an image, because text will change with language selected, so i really need a way to call a function when a button is pressed o make the color change when that button is holded
2019-07-01 07:14 AM
EDIT: i solved, thanks for hints!
2019-07-02 12:47 AM
Great, @Zui,
I'm assuming you figured out that you can change the color of a text programatically.
/Martin
2019-07-02 01:38 AM
well, i'm not that unskilled, problem was change only when button was clicked and holded and chage it back when button was released(both released with his function called, and released my mocing finger away like when u change your mind or have pressed the wrong button, but i made that work by messing around with handleClickEvent and handleDragEvent
2019-07-02 01:56 AM
I know, i'm Just highlighting it here for others to see if they were wondering what you did.
Best regards,
Martin