1

I have created a voting application and noticed that my RadioButtons are extremely light, I am barely able to see the circle associated with the RadioButton. I would like to darken, or bold, the RadioButtons (programmatically) if possible.

I programmatically add my RadioButtons:

public void addRadioButtonsWithFirebaseAnswers(DataSnapshot dataSnapshot, int numberOfAnswers) {
    mPollAnswerArrayList = new ArrayList<RadioButton>();
    for (int i = 0; i < numberOfAnswers; i++) {
        Log.e("Number of Answers", "The number of answers is " + numberOfAnswers);
        mPollAnswerArrayList.add(i, new RadioButton(getActivity().getApplicationContext()));
        mPollAnswerArrayList.get(i).setId(i);
        String firebaseChild = String.valueOf(i + 1);
        mPollAnswerArrayList.get(i).setText(dataSnapshot.child(POLL_ANSWERS_LABEL).child(firebaseChild).child("Answer").getValue().toString());
        mPollAnswerArrayList.get(i).setTextColor(getResources().getColor(R.color.black));
        mPollAnswerArrayList.get(i).setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.radio_button_answer_text_size));
        mParams.setMargins((int) getResources().getDimension(R.dimen.radio_question_margin_left), 0, 0, (int) getResources().getDimension(R.dimen.radio_question_margin_bottom));

        mPollQuestionRadioGroup.addView(mPollAnswerArrayList.get(i), mParams);
    }
}

enter image description here

tccpg288
  • 3,242
  • 5
  • 35
  • 80

1 Answers1

0

You will have to use custom radio buttons or consider changing the background of the activity.

Check this two topics:

Is it possible to change the radio button icon in an android radio button group

Adding custom radio buttons in android

Community
  • 1
  • 1
Nenco
  • 241
  • 4
  • 13
  • Do you know why it is appearing light? I simply want to darken / bold it and am unsure why it is appearing light in the first place... – tccpg288 May 20 '16 at 18:07