@Override
 public void onCheckedChanged(RadioGroup group, int checkedId) {
   View v = group.findViewById(checkedId);
   if (!(v instanceof RadioButton)) {
     return;
   }
   RadioButton b = (RadioButton) v;
   String message = (String) b.getTag();
   app.settings().setDefaultMessage(message);
 }
Beispiel #2
0
 private void refreshScheme() {
   String newScheme =
       prefs.getString("color_scheme", getResources().getString(R.string.default_color_scheme));
   int childCount = schemesLL.getChildCount();
   for (int i = 0; i < childCount; i++) {
     RadioButton rb = (RadioButton) schemesLL.getChildAt(i).findViewById(R.id.color_scheme_name);
     String sc = (String) rb.getTag();
     rb.setChecked(sc.equals(newScheme));
     if (sc.equals(newScheme)) {
       colors[0] =
           getResources()
               .getColor(
                   getResources().getIdentifier("color_scheme_" + sc, "color", getPackageName()));
       colors[1] =
           getResources()
               .getColor(
                   getResources()
                       .getIdentifier("color_scheme_" + sc + "_dim", "color", getPackageName()));
     }
   }
 }
 /**
  * @param methodRadioGroup
  * @return
  */
 private RestMethod getMethod(int methodRadioGroup) {
   RadioGroup radioGroup = (RadioGroup) findViewById(methodRadioGroup);
   RadioButton radioButton = (RadioButton) findViewById(radioGroup.getCheckedRadioButtonId());
   RestMethod method = RestMethod.valueOf((String) radioButton.getTag());
   return method;
 }