congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RadioButton.setButtonDrawable
Code IndexAdd Tabnine to your IDE (free)

How to use
setButtonDrawable
method
in
android.widget.RadioButton

Best Java code snippets using android.widget.RadioButton.setButtonDrawable (Showing top 13 results out of 315)

origin: aa112901/remusic

@Override
public void setButtonDrawable(@DrawableRes int resId) {
  if (mCompoundButtonHelper != null) {
    mCompoundButtonHelper.setButtonDrawable(resId);
  } else {
    super.setButtonDrawable(resId);
  }
}
origin: aa112901/remusic

@Nullable
@Override
public void setButtonDrawable(Drawable drawable) {
  super.setButtonDrawable(drawable);
  if (mCompoundButtonHelper != null) {
    mCompoundButtonHelper.setButtonDrawable();
  }
}
origin: robolectric/robolectric

 @Test
 public void getButtonDrawable() {
  ColorDrawable drawable = new ColorDrawable();
  radioButton.setButtonDrawable(drawable);
  assertThat(shadowOf(radioButton).getButtonDrawable()).isEqualTo(drawable);
 }
}
origin: robolectric/robolectric

@Test
public void getButtonDrawableId() {
 radioButton.setButtonDrawable(R.drawable.an_image);
 assertThat(shadowOf(radioButton).getButtonDrawableId()).isEqualTo(R.drawable.an_image);
}
origin: garretyoder/app-theme-engine

public static void setTint(@NonNull RadioButton radioButton, @ColorInt int color, boolean useDarker) {
  ColorStateList sl = new ColorStateList(new int[][]{
      new int[]{-android.R.attr.state_enabled},
      new int[]{android.R.attr.state_enabled, -android.R.attr.state_checked},
      new int[]{android.R.attr.state_enabled, android.R.attr.state_checked}
  }, new int[]{
      // Rdio button includes own alpha for disabled state
      ATEUtil.stripAlpha(ContextCompat.getColor(radioButton.getContext(), useDarker ? R.color.ate_control_disabled_dark : R.color.ate_control_disabled_light)),
      ContextCompat.getColor(radioButton.getContext(), useDarker ? R.color.ate_control_normal_dark : R.color.ate_control_normal_light),
      color
  });
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    radioButton.setButtonTintList(sl);
  } else {
    Drawable d = createTintedDrawable(ContextCompat.getDrawable(radioButton.getContext(), R.drawable.abc_btn_radio_material), sl);
    radioButton.setButtonDrawable(d);
  }
}
origin: zhangliangzs/KDemo

Map<String, Object> map1 = titleList.get(i);
RadioButton radio = new RadioButton(mContext);
radio.setButtonDrawable(R.color.kViewztblack);
LinearLayout.LayoutParams l = new LinearLayout.LayoutParams(
    ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT,
origin: xuancao/DynamicSkin

public static void setTint(@NonNull RadioButton radioButton, @ColorInt int color, boolean useDarker) {
  ColorStateList sl = new ColorStateList(new int[][]{
      new int[]{-android.R.attr.state_enabled},
      new int[]{android.R.attr.state_enabled, -android.R.attr.state_checked},
      new int[]{android.R.attr.state_enabled, android.R.attr.state_checked}
  }, new int[]{
      ContextCompat.getColor(radioButton.getContext(), useDarker ? R.color.ate_disabled_radiobutton_dark : R.color.ate_disabled_radiobutton_light),
      Util.resolveColor(radioButton.getContext(), R.attr.colorControlNormal),
      color
  });
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    radioButton.setButtonTintList(sl);
  } else {
    Drawable d = DrawableCompat.wrap(ContextCompat.getDrawable(radioButton.getContext(), R.drawable.abc_btn_radio_material));
    DrawableCompat.setTintList(d, sl);
    radioButton.setButtonDrawable(d);
  }
}
origin: tianzhijiexian/SelectorInjection

((RadioButton) view).setButtonDrawable(selector);
return;
origin: casific/murmur

private void initPaging() {
  for(Integer integer : images){
    RadioButton button = new RadioButton(this);
    button.setButtonDrawable(R.drawable.pager_indicator);
    pagerMarkers.addView(button);
origin: mvpleung/SwitchButton

mParams.leftMargin = i > 0 ? -strokeWidth : 0;
mRadioButton.setLayoutParams(i == 0 ? mFirstParams : mParams);
mRadioButton.setButtonDrawable(mButtonDrawables != null ? mButtonDrawables.get(i, colorDrawable) : colorDrawable);
if (Build.VERSION.SDK_INT >= 16) {
  mRadioButton.setBackground(getStateDrawable(i));
origin: vir56k/demo

  /**
   * 创建子 tab
   *
   * @param context
   * @param id
   */
  public static RadioButton creatTabItem(Context context, int id, String text) {
    final int width = DensityUtil.dip2px(context, 80);
    final int height = DensityUtil.dip2px(context, 46);
    final int padding = DensityUtil.dip2px(context, 3);

    RadioButton button;
    button = new RadioButton(context);
    button.setId(id);
//        button.setWidth(width);
//        button.setHeight(height);
    button.setText(text);
    button.setLayoutParams(new LinearLayout.LayoutParams(width, height));
    button.setHeight(height);
    button.setBackgroundResource(R.drawable.tab_item_bg_selector);
    button.setButtonDrawable(context.getResources().getDrawable(android.R.color.transparent));
    button.setGravity(Gravity.CENTER);
    button.setTextColor(context.getResources().getColorStateList(R.color.tab_item_font_color_selector));
    button.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
    button.setPadding(0, 0, 0, padding);
    return button;
  }
}
origin: boredream/DesignResCollection

rb.setButtonDrawable(new ColorDrawable());
rb.setBackgroundResource(R.drawable.shape_oval_primary2white_sel);
rb.setOnTouchListener(new View.OnTouchListener() {
origin: h4h13/RetroMusicPlayer

public static void setTint(@NonNull RadioButton radioButton, @ColorInt int color, boolean useDarker) {
  ColorStateList sl = new ColorStateList(new int[][]{
      new int[]{-android.R.attr.state_enabled},
      new int[]{android.R.attr.state_enabled, -android.R.attr.state_checked},
      new int[]{android.R.attr.state_enabled, android.R.attr.state_checked}
  }, new int[]{
      // Rdio button includes own alpha for disabled state
      ColorUtil.INSTANCE.stripAlpha(ContextCompat.getColor(radioButton.getContext(), useDarker ? R.color.ate_control_disabled_dark : R.color.ate_control_disabled_light)),
      ContextCompat.getColor(radioButton.getContext(), useDarker ? R.color.ate_control_normal_dark : R.color.ate_control_normal_light),
      color
  });
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    radioButton.setButtonTintList(sl);
  } else {
    Drawable d = createTintedDrawable(ContextCompat.getDrawable(radioButton.getContext(), R.drawable.abc_btn_radio_material), sl);
    radioButton.setButtonDrawable(d);
  }
}
android.widgetRadioButtonsetButtonDrawable

Popular methods of RadioButton

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

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • putExtra (Intent)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Runner (org.openjdk.jmh.runner)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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