Android Question New view.setanimation

Humberto

Active Member
Licensed User
I´m trying to use the new SetTextSizeAnimated, SetColorAnimated and SetTextColorAnimated and I create a test program with a Horizontal Panel and 5 buttons.
When a button receive a click it changes the text size, text color and the background color.
But when I click in any button the last one change also all sets but textcolor.
I could not find why.

I tried also with 6 buttons and always the problem is in the last one

I attach the source.
 

Attachments

derez

Expert
Licensed User
The problem is that you use the same cd for all buttons.
Try this:
B4X:
cd.Initialize2 (Colors.DarkGray,10,2dip,Colors.Green)
Bt_1.Background = cd
cd.Initialize2 (Colors.DarkGray,10,2dip,Colors.Green)
Bt_2.Background = cd
cd.Initialize2 (Colors.DarkGray,10,2dip,Colors.Green)
Bt_3.Background = cd
cd.Initialize2 (Colors.DarkGray,10,2dip,Colors.Green)
Bt_4.Background = cd
cd.Initialize2 (Colors.DarkGray,10,2dip,Colors.Green)
Bt_5.Background = cd
The re-init separates between the dr's of the buttons.
 
Top