I need something not so special. I've got a view with many buttons, and I want the user to click them.
After been clicked they have to show the user their click state.
ToggleButtons are wrong because I cannot change the text.
CheckBoxes are wrong because they take too much space.
The first idea I had was to change the textcolor.
Using java Syntax Highlighting
- protected class ButtonListener implements OnClickListener {
- public void onClick(View v) {
- Button b = (Button)v;
- int def = b.getTextColors().getDefaultColor();
- int col = Color.rgb(0xe3, 0x55, 0x01);
- if( def == col ) {
- b.setTextColor( Color.rgb(0x00, 0x00, 0x00) );
- }
- else {
- b.setTextColor( Color.rgb(0xe3, 0x55,0x01) );
- }
- }
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Is there a chance to change the background like the typical orange way?
Something like button.setHighlight( true ) or button.pleaseBecomeOrange( now() )
Greetings,
Marco



