Advertisement
Star1111

Untitled

Mar 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. private void onClick(Button button) {
  2.        
  3.         int id = button.getId();
  4.         for (int i = 0, y = mButtons.length; i < y; i++) {
  5.            
  6.             if (mRadioButtons[i].getId() == id) {
  7.                 refresButtons(i);
  8.                
  9.             }
  10.         }
  11.     }
  12.    
  13.    
  14.    
  15.     private void refreshButtons(int checked) {
  16.        
  17.        
  18.         for (int i = 0, y = mButtons.length; i < y; i++) {
  19.             if (i != checked && mButtons[i].(тут проверить что галочка стоит)) {
  20.                  buttons[i].setCompoundDrawablesWithIntrinsicBounds(drawableCheckboxOff, null, null, null);
  21.                
  22.             }
  23.         }
  24.         buttons[checked].setCompoundDrawablesWithIntrinsicBounds(drawableCheckboxOn, null, null, null);
  25.        
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement