Tabnine Logo
RadioButton.setOnCheckedChangeListener
Code IndexAdd Tabnine to your IDE (free)

How to use
setOnCheckedChangeListener
method
in
android.widget.RadioButton

Best Java code snippets using android.widget.RadioButton.setOnCheckedChangeListener (Showing top 20 results out of 360)

origin: seven332/EhViewer

  /**
   * {@inheritDoc}
   */
  @Override
  public void onChildViewRemoved(View parent, View child) {
    if (parent == RadioGridGroup.this && child instanceof RadioButton) {
      ((RadioButton) child).setOnCheckedChangeListener(null);
    }
    if (mOnHierarchyChangeListener != null) {
      mOnHierarchyChangeListener.onChildViewRemoved(parent, child);
    }
  }
}
origin: niorgai/StatusBarCompat

private void changeButtonStatus(int index, boolean check){
  RadioButton button;
  switch (index){
    case PAGE_COMMON:
      button = mCommon;
      break;
    case PAGE_TRANSLUCENT:
      button = mTranslucent;
      break;
    case PAGE_COORDINATOR:
      button = mCoordinator;
      break;
    case PAGE_COLLAPSING_TOOLBAR:
      button = mCollapsingToolbar;
      break;
    default:
      button = mCommon;
  }
  button.setOnCheckedChangeListener(null);
  button.setChecked(check);
  button.setOnCheckedChangeListener(this);
  if (check) {
    button.setTextColor(ContextCompat.getColor(this, R.color.colorAccent));
  } else {
    button.setTextColor(ContextCompat.getColor(this, R.color.colorBlack));
  }
}
origin: seven332/EhViewer

/**
 * {@inheritDoc}
 */
@Override
public void onChildViewAdded(View parent, View child) {
  if (parent == RadioGridGroup.this && child instanceof RadioButton) {
    int id = child.getId();
    // generates an id if it's missing
    if (id == View.NO_ID) {
      id = ViewUtils.generateViewId();
      child.setId(id);
    }
    ((RadioButton) child).setOnCheckedChangeListener(
        mChildOnCheckedChangeListener);
  }
  if (mOnHierarchyChangeListener != null) {
    mOnHierarchyChangeListener.onChildViewAdded(parent, child);
  }
}
origin: niorgai/StatusBarCompat

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(null);
  setContentView(R.layout.activity_main);
  fragments.put(PAGE_COMMON, new CommonFragment());
  fragments.put(PAGE_TRANSLUCENT, new TranslucentFragment());
  fragments.put(PAGE_COORDINATOR, new DrawerFragment());
  fragments.put(PAGE_COLLAPSING_TOOLBAR, new CollapsingToolbarFragment());
  mCommon = (RadioButton) findViewById(R.id.common);
  mCommon.setOnCheckedChangeListener(this);
  mTranslucent = (RadioButton) findViewById(R.id.translucent);
  mTranslucent.setOnCheckedChangeListener(this);
  mCoordinator = (RadioButton) findViewById(R.id.coordinator);
  mCoordinator.setOnCheckedChangeListener(this);
  mCollapsingToolbar = (RadioButton) findViewById(R.id.collapsing_toolbar);
  mCollapsingToolbar.setOnCheckedChangeListener(this);
  FragmentTransaction ft = MainActivity.this.getSupportFragmentManager().beginTransaction();
  ft.add(fragmentContentId, fragments.get(PAGE_COMMON));
  currentTab = PAGE_COMMON;
  mCommon.setTextColor(getResources().getColor(R.color.colorAccent));
  ft.commit();
}
origin: stackoverflow.com

radioButton1.setOnCheckedChangeListener(radioCheckChangeListener);
radioButton2.setOnCheckedChangeListener(radioCheckChangeListener);
radioButton3.setOnCheckedChangeListener(radioCheckChangeListener);
origin: chrisk44/Hijacker

wepRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
  @Override
  public void onCheckedChanged(CompoundButton compoundButton, boolean b){
origin: baiyuliang/QRobot

private void initView() {
  rb_tab1 = (RadioButton) this.findViewById(R.id.rb_tab1);
  rb_tab2 = (RadioButton) this.findViewById(R.id.rb_tab2);
  rb_tab3 = (RadioButton) this.findViewById(R.id.rb_tab3);
  rb_tab1.setOnCheckedChangeListener(this);
  rb_tab2.setOnCheckedChangeListener(this);
  rb_tab3.setOnCheckedChangeListener(this);
}
origin: saki4510t/libcommon

  /**
   * {@inheritDoc}
   */
  public void onChildViewRemoved(View parent, View child) {
    if (parent == RelativeRadioGroup.this && child instanceof RadioButton) {
      ((RadioButton) child).setOnCheckedChangeListener(null); // setOnCheckedChangeWidgetListener(null);
    }
    if (mOnHierarchyChangeListener != null) {
      mOnHierarchyChangeListener.onChildViewRemoved(parent, child);
    }
  }
}
origin: Key-CN/RadioGroup

  public void onChildViewRemoved(View parent, View child) {
    if (parent == KeyRadioGroupV1.this) {
      List<RadioButton> allRadioButton = getAllRadioButton(child);
      if(allRadioButton != null && allRadioButton.size() > 0){
        for(RadioButton button : allRadioButton){
          button.setOnCheckedChangeListener(null);
        }
      }
    }
    if (mOnHierarchyChangeListener != null) {
      mOnHierarchyChangeListener.onChildViewRemoved(parent, child);
    }
  }
}
origin: tianzhijiexian/SelectorInjection

private void setViews(View root) {
  RadioGroup imageRg = root.findViewById(R.id.image_rg);
  imageRg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
    @Override
    public void onCheckedChanged(RadioGroup group, int checkedId) {
      Toast.makeText(getActivity(), "checked", Toast.LENGTH_SHORT).show();
    }
  });
  // FIXME: 2018/4/25 這裏有個bug是必須在代碼中設置默認的選中狀態 
  ((RadioButton) imageRg.getChildAt(0)).setChecked(true);
  ((RadioButton) imageRg.getChildAt(0)).setOnCheckedChangeListener(this);
  ((RadioButton) imageRg.getChildAt(1)).setOnCheckedChangeListener(this);
  ((RadioButton) imageRg.getChildAt(2)).setOnCheckedChangeListener(this);
}
origin: Key-CN/RadioGroup

  /**
   * 移除同上
   */
  public void onChildViewRemoved(View parent, View child) {
    if (parent == KeyRadioGroupV2.this && child instanceof ViewGroup) {
      int childCount = ((ViewGroup) child).getChildCount();
      for (int i = 0; i < childCount; i++) {
        ((RadioButton)  ((ViewGroup) child).getChildAt(i)).setOnCheckedChangeListener(null);
      }
    }
    if (mOnHierarchyChangeListener != null) {
      mOnHierarchyChangeListener.onChildViewRemoved(parent, child);
    }
  }
}
origin: JackWHLiu/jackknife

  /**
   * {@inheritDoc}
   */
  public void onChildViewRemoved(View parent, View child) {
    if (parent == MultiRadioGroup.this) {
      List<RadioButton> buttons = getAllRadioButton(child);
      if(buttons != null && buttons.size() > 0){
        for(RadioButton button : buttons){
          button.setOnCheckedChangeListener(null);
        }
      }
    }
    if (mOnHierarchyChangeListener != null) {
      mOnHierarchyChangeListener.onChildViewRemoved(parent, child);
    }
  }
}
origin: MiEcosystem/mijiaSDK

  /**
   * {@inheritDoc}
   */
  public void onChildViewRemoved(View parent, View child) {
    if (parent == XmRadioGroup.this && child instanceof RadioButton) {
      ((RadioButton) child).setOnCheckedChangeListener(null);
    } else if (parent == XmRadioGroup.this
        && child instanceof ViewGroup) {
      RadioButton btn = findRadioButton((ViewGroup) child);
      if (btn != null)
        btn.setOnCheckedChangeListener(null);
    }
    if (mOnHierarchyChangeListener != null) {
      mOnHierarchyChangeListener.onChildViewRemoved(parent, child);
    }
  }
}
origin: stackoverflow.com

private OnCheckedChangeListener checkListener = new OnCheckedChangeListener() {
   @Override
   public void onCheckedChanged(CompoundButton buttonView,
       boolean isChecked) {
     for (int i = 0; i < count; i++) {
       if (buttonView.getId() == 5000 + i) {
         Log.e("XXX", "Position " + i);
       } else {                                       
         RadioButton rb = (RadioButton) findViewById((5000 + i));
         rb.setOnCheckedChangeListener(null);
         rb.setChecked(false);
         rb.setOnCheckedChangeListener(checkListener);
       }
     }
   }
 };
origin: ABTSoftware/SciChart.Android.Examples

public static void setUpRadioButton(Dialog dialog, @IdRes int checkBoxId, final IChartModifier modifier) {
  final RadioButton radioButton = (RadioButton) dialog.findViewById(checkBoxId);
  radioButton.setChecked(modifier.getIsEnabled());
  radioButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
    @Override
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
      modifier.setIsEnabled(isChecked);
    }
  });
}
origin: ABTSoftware/SciChart.Android.Examples

private void initializeRadioButtons() {
  ((RadioButton) getActivity().findViewById(R.id.rollover)).setOnCheckedChangeListener(new RadioButtonCheckedChangeListener(rolloverModifier));
  ((RadioButton) getActivity().findViewById(R.id.cursor)).setOnCheckedChangeListener(new RadioButtonCheckedChangeListener(cursorModifier));
  ((RadioButton) getActivity().findViewById(R.id.tooltip)).setOnCheckedChangeListener(new RadioButtonCheckedChangeListener(tooltipModifier));
}
origin: saki4510t/libcommon

/**
 * {@inheritDoc}
 */
public void onChildViewAdded(View parent, View child) {
  if (parent == RelativeRadioGroup.this && child instanceof RadioButton) {
    int id = child.getId();
    // generates an id if it's missing
    if (id == View.NO_ID) {
      id = child.hashCode();
      child.setId(id);
    }
    ((RadioButton) child).setOnCheckedChangeListener( // setOnCheckedChangeWidgetListener(
        mChildOnCheckedChangeListener);
  }
  if (mOnHierarchyChangeListener != null) {
    mOnHierarchyChangeListener.onChildViewAdded(parent, child);
  }
}
origin: Appolica/Flubber

@BindingAdapter({"checked", "model"})
public static <T> void setChecked(RadioButton radioButton, final ObservableField<T> checked, final T model) {
  if (checked == null) {
    return;
  }
  radioButton.setOnCheckedChangeListener(
      (buttonView, isChecked) -> {
        if ((checked.get() == null || !checked.get().equals(model))
            && isChecked) {
          checked.set(model);
        }
      });
  final T checkedModel = checked.get();
  final boolean shouldBeChecked = checkedModel != null && checkedModel.equals(model);
  if (shouldBeChecked != radioButton.isChecked()) {
    radioButton.setChecked(shouldBeChecked);
  }
}
origin: quaap/LaunchTime

private RadioButton makeRadioButton(RadioGroup baks, final String bk, final boolean item) {
  RadioButton bkb = new RadioButton(this);
  bkb.setText(bk);
  bkb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
    @Override
    public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
      if (b) {
        selectedBackup = bk;
        selected = item;
        Log.d("backuppage", "selected = " + selectedBackup);
        backupSelected(selected);
      }
    }
  });
  baks.addView(bkb);
  return bkb;
}
origin: NielsMasdorp/Speculum-Android

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_setup);
  ((SpeculumApplication) getApplication()).createSetupComponent(this).inject(this);
  ButterKnife.bind(this);
  Assent.setActivity(this, this);
  if (!Assent.isPermissionGranted(Assent.READ_CALENDAR)) {
    Assent.requestPermissions(result -> {
      // Permission granted or denied
      if (!result.allPermissionsGranted()) {
        Toast.makeText(SetupActivity.this, noPermissionForCalendar, Toast.LENGTH_SHORT).show();
      }
    }, 1, Assent.READ_CALENDAR);
  }
  cbVoiceCommands.setOnCheckedChangeListener(this);
  rbSimpleLayout.setOnCheckedChangeListener(this);
}
android.widgetRadioButtonsetOnCheckedChangeListener

Popular methods of RadioButton

  • setChecked
  • isChecked
  • setText
  • setOnClickListener
  • <init>
  • getId
  • setId
  • getText
  • setEnabled
  • setVisibility
  • setButtonDrawable
  • setTag
  • setButtonDrawable,
  • setTag,
  • setTextColor,
  • setLayoutParams,
  • setBackgroundDrawable,
  • getTag,
  • setBackgroundColor,
  • setTextSize,
  • onDraw

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • getSystemService (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Path (java.nio.file)
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now