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

How to use
setTextColor
method
in
android.widget.RadioButton

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

origin: aa112901/remusic

@Override
public void setTextColor(int color) {
  super.setTextColor(color);
  if (mTextHelper != null) {
    mTextHelper.setTextColor();
  }
}
origin: aa112901/remusic

@Override
public void setTextColor(ColorStateList colors) {
  super.setTextColor(colors);
  if (mTextHelper != null) {
    mTextHelper.setTextColor();
  }
}
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: 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

 ColorStateList csl = AppCompatResources.getColorStateList(context, R.color.my_color_state);    
RadioButton r = (RadioButton) findViewById(R.id.radio_button);
r.setTextColor(csl);
origin: stackoverflow.com

 public void onClick(View v) {

//Disable buttons
 for (int i = 0; i < answerGroup.length; i++) {
  for (int j = 0; j < answer.length; j++) {

     answerGroup[i].getChildAt(j).setEnabled(false);

   }
 }
 //put button colors

 for(RadioButton correct: correctAnswerRadios){
 correct.setTextColor(Color.GREEN);
 }

 for(RadioButton wrong: wrongAnswersRadios){
 wrong.setTextColor(Color.RED);
 }
}
origin: student9128/BottomNavigationBarForAndroid

/**
 * set tab home state
 */
private void setHomeState() {
  if (mRadioHome.isChecked()) {
    mRadioHome.setTextColor(ContextCompat.getColor(getActivity(), R.color.colorPrimary));
  } else {
    mRadioHome.setTextColor(ContextCompat.getColor(getActivity(), R.color.black));
  }
}
origin: student9128/BottomNavigationBarForAndroid

private void setLikeState() {
  if (mRadioLike.isChecked()) {
    mRadioLike.setTextColor(ContextCompat.getColor(getActivity(), R.color.colorPrimary));
  } else {
    mRadioLike.setTextColor(ContextCompat.getColor(getActivity(), R.color.black));
  }
}
origin: student9128/BottomNavigationBarForAndroid

private void setLocationState() {
  if (mRadioLocation.isChecked()) {
    mRadioLocation.setTextColor(ContextCompat.getColor(getActivity(), R.color.colorPrimary));
  } else {
    mRadioLocation.setTextColor(ContextCompat.getColor(getActivity(), R.color.black));
  }
}
origin: student9128/BottomNavigationBarForAndroid

private void setMeState() {
  if (mRadioMe.isChecked()) {
    mRadioMe.setTextColor(ContextCompat.getColor(getActivity(), R.color.colorPrimary));
  } else {
    mRadioMe.setTextColor(ContextCompat.getColor(getActivity(), R.color.black));
  }
}
origin: stackoverflow.com

 RadioButton rad;//initialize first!
//You can set the background color
rad.setBackgroundColor(Color.BLUE);
//Text color
rad.setTextColor(Color.WHITE);
//or highlight color
rad.setHighlightColor(Color.GREEN);
origin: stackoverflow.com

public void onClick(View v) {
  if(selected != null) {
    selected.setTextColor(Color.BLACK);
  selected.setTextColor(Color.GREEN);
public void onClick(View v) {
  if(selected != null) {
    selected.setTextColor(Color.BLACK);
  selected.setTextColor(Color.RED);
origin: yhyzgn/TabPager

/**
 * 设置Tab样式
 *
 * @param rb      Tab项
 * @param checked 是否选中
 */
private void setTabStyle(RadioButton rb, boolean checked) {
  if (checked) {
    rb.setTextColor(mNavTextCheckedColor);
    if (null == mNavBgCheckedImg) {
      rb.setBackgroundColor(mNavBgCheckedColor);
    } else {
      rb.setBackgroundDrawable(mNavBgCheckedImg);
    }
  } else {
    rb.setTextColor(mNavTextDefaultColor);
    rb.setBackgroundColor(Color.TRANSPARENT);
    rb.setBackgroundDrawable(null);
  }
}
origin: stackoverflow.com

   R.drawable.selected_right_background));
femaleButton.setTextColor(getResources().getColor(R.color.Purple));
maleButton.setTextColor(getResources().getColor(R.color.Gray));
mGender = MALE;
   R.drawable.unselected_right_background));
femaleButton.setTextColor(getResources().getColor(R.color.Gray));
maleButton.setTextColor(getResources().getColor(R.color.Purple));
mGender = FEMALE;
origin: zhangliangzs/KDemo

  @Override
  public void onCheckedChanged(RadioGroup group, int checkedId) {
    int radioButtonId = group.getCheckedRadioButtonId();
    // 根据ID获取RadioButton的实例
    RadioButton rb = (RadioButton) findViewById(radioButtonId);
    for (int i = 0; i < group.getChildCount(); i++) {
      RadioButton vradio = (RadioButton) group.getChildAt(i);
      vradio.setGravity(Gravity.CENTER);
      vradio.setPadding(20, 20, 20, 20);
      if (rb.getId() == vradio.getId()) {
        vradio.setTextColor(getResources().getColor(R.color.subject_select));
        vradio.setChecked(true);
        vradio.setBackground(getResources().getDrawable(R.drawable.bg_bottom));
      } else {
        vradio.setTextColor(getResources().getColor(R.color.kViewztblack));
        vradio.setChecked(false);
        vradio.setBackground(null);
      }
    }
    //           CustomProgress.show(mContext, true, null);
    kChartTimeInterval = titleList.get(checkedId - 1).get("time") + "";
    indexMarketChart();
  }
});
origin: JustinRoom/JSCKit

private void createTipTextLocationChoices(LinearLayout linearLayout){
  RadioGroup radioGroup = new RadioGroup(this);
  radioGroup.setOrientation(LinearLayout.HORIZONTAL);
  radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
    @Override
    public void onCheckedChanged(RadioGroup group, int checkedId) {
      switch (checkedId){
        case R.id.radio_below:
          cameraMask.setTextLocation(CameraMask.LOCATION_BELOW_CAMERA_LENS);
          break;
        case R.id.radio_above:
          cameraMask.setTextLocation(CameraMask.LOCATION_ABOVE_CAMERA_LENS);
          break;
      }
    }
  });
  linearLayout.addView(radioGroup, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
  RadioButton button1 = new RadioButton(this);
  button1.setId(R.id.radio_below);
  button1.setTextColor(Color.WHITE);
  button1.setChecked(true);
  button1.setText("BelowCameraLens");
  RadioButton button2 = new RadioButton(this);
  button2.setId(R.id.radio_above);
  button2.setTextColor(Color.WHITE);
  button2.setText("AboveCameraLens");
  radioGroup.addView(button1);
  radioGroup.addView(button2);
}
origin: JustinRoom/JSCKit

RadioButton button1 = new RadioButton(this);
button1.setId(R.id.radio_camera_lens_pic);
button1.setTextColor(Color.WHITE);
button1.setChecked(true);
button1.setText("PictureCameraLens");
RadioButton button2 = new RadioButton(this);
button2.setId(R.id.radio_camera_lens_line);
button2.setTextColor(Color.WHITE);
button2.setText("NormalCameraLens");
radioGroup.addView(button1);
origin: mvpleung/SwitchButton

private RadioButton createRadioView() {
  RadioButton mRadioButton = new RadioButton(getContext(), null, mRadioStyle > 0 ? mRadioStyle : android.R.attr.radioButtonStyle);
  if (mRadioStyle == 0) {
    mRadioButton.setGravity(Gravity.CENTER);
    mRadioButton.setEllipsize(TruncateAt.END);
  }
  if (mTextColor != null)
    mRadioButton.setTextColor(mTextColor);
  if (textSize > 0)
    mRadioButton.setTextSize(textSize);
  return mRadioButton;
}
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: Odoo-mobile/framework

private void createRadioGroup() {
  final LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,
      LayoutParams.WRAP_CONTENT);
  if (mRadioGroup == null) {
    mRadioGroup = new RadioGroup(mContext);
    mRadioGroup.setLayoutParams(params);
  } else {
    removeView(mRadioGroup);
  }
  mRadioGroup.removeAllViews();
  mRadioGroup.setOnCheckedChangeListener(this);
  for (ODataRow label : items) {
    RadioButton rdoBtn = new RadioButton(mContext);
    rdoBtn.setLayoutParams(params);
    rdoBtn.setText(label.getString(mModel.getDefaultNameColumn()));
    if (textSize > -1) {
      rdoBtn.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
    }
    if (appearance > -1) {
      rdoBtn.setTextAppearance(mContext, appearance);
    }
    rdoBtn.setTextColor(textColor);
    mRadioGroup.addView(rdoBtn);
  }
  addView(mRadioGroup);
}
android.widgetRadioButtonsetTextColor

Popular methods of RadioButton

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

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Top 17 PhpStorm 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