congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
RadioButton.setButtonTintList
Code IndexAdd Tabnine to your IDE (free)

How to use
setButtonTintList
method
in
android.widget.RadioButton

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

origin: enricocid/LaunchEnr

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
      final ViewGroup nullParent = null;
      convertView = mLayoutInflater.inflate(R.layout.theme_dialog, nullParent);
    }
    String theme = themeOptions[position];
    TextView txtView = convertView.findViewById(R.id.title);
    txtView.setText(theme);
    RadioButton radioButton = convertView.findViewById(R.id.radio);
    int itemColor = ContextCompat.getColor(context, resolveColor(position));
    ColorStateList colorStateList = new ColorStateList(
        new int[][]{
            new int[]{android.R.attr.state_enabled}, //enabled
            new int[]{android.R.attr.state_enabled} //disabled
        },
        new int[]{itemColor, itemColor}
    );
    txtView.setShadowLayer(1.5f, -1, 1, itemColor);
    radioButton.setButtonTintList(colorStateList);
    radioButton.setChecked(themeValues[position].equals(selectedTheme));
    return convertView;
  }
}
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: 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: 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.widgetRadioButtonsetButtonTintList

Popular methods of RadioButton

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 17 Free Sublime Text 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