コード例 #1
0
 private void configureButtonContent(View button, ExpandableItem expandableItem) {
   if (expandableItem.hasBackgroundId()) {
     int backgroundId = expandableItem.getBackgroundId();
     button.setBackgroundResource(backgroundId);
   }
   if (expandableItem.hasTitle()) {
     String text = expandableItem.getTitle();
     ((Button) button).setText(text);
   }
   if (expandableItem.hasResourceId()) {
     ImageButton imageButton = (ImageButton) button;
     int resourceId = expandableItem.getResourceId();
     imageButton.setImageResource(resourceId);
   }
 }