Search in sources :

Example 91 with RadioButton

use of android.widget.RadioButton in project xabber-android by redsolution.

the class ResourceAdapter method getView.

@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    View view = lInflater.inflate(R.layout.item_user_resource, parent, false);
    TextView tvClient = (TextView) view.findViewById(R.id.tvClient);
    TextView tvResource = (TextView) view.findViewById(R.id.tvResource);
    final RadioButton radioButton = (RadioButton) view.findViewById(R.id.radioButton);
    if (position == checkedItem)
        radioButton.setChecked(true);
    tvClient.setText(items.get(position).get(KEY_CLIENT));
    tvResource.setText(items.get(position).get(KEY_RESOURCE));
    view.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            radioButton.setChecked(true);
            checkedItem = position;
            notifyDataSetChanged();
        }
    });
    return view;
}
Also used : TextView(android.widget.TextView) RadioButton(android.widget.RadioButton) TextView(android.widget.TextView) View(android.view.View)

Example 92 with RadioButton

use of android.widget.RadioButton in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ZenCustomRadioButtonPreferenceTest method setChecked_shouldUpdateButtonCheckedState.

@Test
public void setChecked_shouldUpdateButtonCheckedState() {
    final ZenCustomRadioButtonPreference preference = new ZenCustomRadioButtonPreference(mContext);
    final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(LayoutInflater.from(mContext).inflate(R.layout.preference_two_target_radio, null));
    final RadioButton toggle = (RadioButton) holder.findViewById(android.R.id.checkbox);
    preference.onBindViewHolder(holder);
    preference.setChecked(true);
    assertThat(toggle.isChecked()).isTrue();
    preference.setChecked(false);
    assertThat(toggle.isChecked()).isFalse();
}
Also used : RadioButton(android.widget.RadioButton) PreferenceViewHolder(androidx.preference.PreferenceViewHolder) Test(org.junit.Test)

Example 93 with RadioButton

use of android.widget.RadioButton in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class TtsEnginePreference method onBindViewHolder.

@Override
public void onBindViewHolder(PreferenceViewHolder view) {
    super.onBindViewHolder(view);
    if (mSharedState == null) {
        throw new IllegalStateException("Call to getView() before a call to" + "setSharedState()");
    }
    final RadioButton rb = view.itemView.findViewById(android.R.id.checkbox);
    rb.setOnCheckedChangeListener(mRadioChangeListener);
    boolean isChecked = getKey().equals(mSharedState.getCurrentKey());
    if (isChecked) {
        mSharedState.setCurrentChecked(rb);
    }
    mPreventRadioButtonCallbacks = true;
    rb.setChecked(isChecked);
    mPreventRadioButtonCallbacks = false;
    mRadioButton = rb;
}
Also used : RadioButton(android.widget.RadioButton)

Example 94 with RadioButton

use of android.widget.RadioButton in project superCleanMaster by joyoyao.

the class ChangeLanguage method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_change_language);
    RadioButton rbtnRussian = (RadioButton) findViewById(R.id.rbtnRussian);
    rbtnRussian.setOnClickListener(radioButtonClickListener);
    RadioButton rbtnEnglish = (RadioButton) findViewById(R.id.rbtnEnglish);
    rbtnEnglish.setOnClickListener(radioButtonClickListener);
    RadioButton rbtnSpanish = (RadioButton) findViewById(R.id.rbtnSpanish);
    rbtnSpanish.setOnClickListener(radioButtonClickListener);
}
Also used : RadioButton(android.widget.RadioButton)

Example 95 with RadioButton

use of android.widget.RadioButton in project zype-android by zype.

the class TracksListAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    Holder holder;
    if (convertView == null) {
        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
        convertView = inflater.inflate(R.layout.tracks_row_layout, parent, false);
        holder = new Holder((TextView) convertView.findViewById(R.id.text), (RadioButton) convertView.findViewById(R.id.radio));
        convertView.setTag(holder);
    } else {
        holder = (Holder) convertView.getTag();
    }
    holder.radio.setTag(position);
    holder.radio.setChecked(mSelectedPosition == position);
    convertView.setOnClickListener(this);
    holder.label.setText(mTracks.get(position).getName());
    return convertView;
}
Also used : LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) RadioButton(android.widget.RadioButton)

Aggregations

RadioButton (android.widget.RadioButton)198 View (android.view.View)100 TextView (android.widget.TextView)69 RadioGroup (android.widget.RadioGroup)43 Button (android.widget.Button)38 Intent (android.content.Intent)36 CheckBox (android.widget.CheckBox)28 EditText (android.widget.EditText)26 ImageView (android.widget.ImageView)21 CompoundButton (android.widget.CompoundButton)19 LayoutInflater (android.view.LayoutInflater)18 ViewGroup (android.view.ViewGroup)18 LinearLayout (android.widget.LinearLayout)17 Bundle (android.os.Bundle)16 AdapterView (android.widget.AdapterView)15 DialogInterface (android.content.DialogInterface)14 Context (android.content.Context)10 ScrollView (android.widget.ScrollView)10 ArrayList (java.util.ArrayList)10 SharedPreferences (android.content.SharedPreferences)9