Search in sources :

Example 26 with RadioButton

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

the class ApnPreference method onBindViewHolder.

@Override
public void onBindViewHolder(PreferenceViewHolder view) {
    super.onBindViewHolder(view);
    View widget = view.findViewById(R.id.apn_radiobutton);
    if ((widget != null) && widget instanceof RadioButton) {
        RadioButton rb = (RadioButton) widget;
        if (mSelectable) {
            rb.setOnCheckedChangeListener(this);
            boolean isChecked = getKey().equals(mSelectedKey);
            if (isChecked) {
                mCurrentChecked = rb;
                mSelectedKey = getKey();
            }
            mProtectFromCheckedChange = true;
            rb.setChecked(isChecked);
            mProtectFromCheckedChange = false;
            rb.setVisibility(View.VISIBLE);
        } else {
            rb.setVisibility(View.GONE);
        }
    }
    View textLayout = view.findViewById(R.id.text_layout);
    if ((textLayout != null) && textLayout instanceof RelativeLayout) {
        textLayout.setOnClickListener(this);
    }
}
Also used : RelativeLayout(android.widget.RelativeLayout) RadioButton(android.widget.RadioButton) View(android.view.View)

Example 27 with RadioButton

use of android.widget.RadioButton in project AndroidChromium by JackyAndroid.

the class DistilledPagePrefsView method initializeAndGetButton.

/**
     * Initiatializes a Button and selects it if it corresponds to the current
     * theme.
     */
private RadioButton initializeAndGetButton(int id, final Theme theme) {
    final RadioButton button = (RadioButton) findViewById(id);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mDistilledPagePrefs.setTheme(theme);
        }
    });
    return button;
}
Also used : RadioButton(android.widget.RadioButton) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView)

Example 28 with RadioButton

use of android.widget.RadioButton in project android_frameworks_base by DirtyUnicorns.

the class ElementLayoutActivity method createRadioButton.

private void createRadioButton() {
    RadioButton button = new RadioButton(this);
    button.setText("RadioButton:" + mRandom.nextInt());
    mLayout.addView(button);
}
Also used : RadioButton(android.widget.RadioButton)

Example 29 with RadioButton

use of android.widget.RadioButton in project android_frameworks_base by AOSPA.

the class ClientTest method onCreate.

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Button addpbtn = (Button) findViewById(R.id.addpkg);
    Button procbtn = (Button) findViewById(R.id.procmsg);
    Button delbtn = (Button) findViewById(R.id.delpkg);
    Log.v(LOG_TAG, "activity created!!");
    addpbtn.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            EditText app_id = (EditText) findViewById(R.id.app_id);
            EditText cont = (EditText) findViewById(R.id.cont);
            EditText pkg = (EditText) findViewById(R.id.pkg);
            EditText cls = (EditText) findViewById(R.id.cls);
            RadioButton act = (RadioButton) findViewById(R.id.act);
            CheckBox sig = (CheckBox) findViewById(R.id.sig);
            CheckBox ftr = (CheckBox) findViewById(R.id.ftr);
            try {
                if (!mWapPushMan.addPackage(app_id.getText().toString(), cont.getText().toString(), pkg.getText().toString(), cls.getText().toString(), act.isChecked() ? WapPushManagerParams.APP_TYPE_ACTIVITY : WapPushManagerParams.APP_TYPE_SERVICE, sig.isChecked(), ftr.isChecked())) {
                    Log.w(LOG_TAG, "remote add pkg failed...");
                    mWapPushMan.updatePackage(app_id.getText().toString(), cont.getText().toString(), pkg.getText().toString(), cls.getText().toString(), act.isChecked() ? WapPushManagerParams.APP_TYPE_ACTIVITY : WapPushManagerParams.APP_TYPE_SERVICE, sig.isChecked(), ftr.isChecked());
                }
            } catch (RemoteException e) {
                Log.w(LOG_TAG, "remote func failed...");
            }
        }
    });
    delbtn.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            EditText app_id = (EditText) findViewById(R.id.app_id);
            EditText cont = (EditText) findViewById(R.id.cont);
            EditText pkg = (EditText) findViewById(R.id.pkg);
            EditText cls = (EditText) findViewById(R.id.cls);
            try {
                mWapPushMan.deletePackage(app_id.getText().toString(), cont.getText().toString(), pkg.getText().toString(), cls.getText().toString());
            // delall.isChecked());
            } catch (RemoteException e) {
                Log.w(LOG_TAG, "remote func failed...");
            }
        }
    });
    procbtn.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            EditText pdu = (EditText) findViewById(R.id.pdu);
            EditText app_id = (EditText) findViewById(R.id.app_id);
            EditText cont = (EditText) findViewById(R.id.cont);
            // wap.dispatchWapPdu(strToHex(pdu.getText().toString()));
            try {
                Intent intent = new Intent();
                intent.putExtra("transactionId", 0);
                intent.putExtra("pduType", 6);
                intent.putExtra("header", HexDump.hexStringToByteArray(pdu.getText().toString()));
                intent.putExtra("data", HexDump.hexStringToByteArray(pdu.getText().toString()));
                mWapPushMan.processMessage(app_id.getText().toString(), cont.getText().toString(), intent);
            //HexDump.hexStringToByteArray(pdu.getText().toString()), 0, 6, 5, 5);
            } catch (RemoteException e) {
                Log.w(LOG_TAG, "remote func failed...");
            }
        }
    });
}
Also used : EditText(android.widget.EditText) RadioButton(android.widget.RadioButton) Button(android.widget.Button) CheckBox(android.widget.CheckBox) Intent(android.content.Intent) RadioButton(android.widget.RadioButton) RemoteException(android.os.RemoteException) View(android.view.View)

Example 30 with RadioButton

use of android.widget.RadioButton in project NewXmPluginSDK by MiEcosystem.

the class XmRadioGroup method findRadioButton.

public RadioButton findRadioButton(ViewGroup group) {
    RadioButton resBtn = null;
    int len = group.getChildCount();
    for (int i = 0; i < len; i++) {
        if (group.getChildAt(i) instanceof RadioButton) {
            resBtn = (RadioButton) group.getChildAt(i);
        } else if (group.getChildAt(i) instanceof ViewGroup) {
            findRadioButton((ViewGroup) group.getChildAt(i));
        }
    }
    return resBtn;
}
Also used : ViewGroup(android.view.ViewGroup) RadioButton(android.widget.RadioButton)

Aggregations

RadioButton (android.widget.RadioButton)90 View (android.view.View)48 TextView (android.widget.TextView)35 Button (android.widget.Button)19 CheckBox (android.widget.CheckBox)18 RadioGroup (android.widget.RadioGroup)18 EditText (android.widget.EditText)13 Intent (android.content.Intent)12 Bundle (android.os.Bundle)10 CompoundButton (android.widget.CompoundButton)10 ImageView (android.widget.ImageView)10 ViewGroup (android.view.ViewGroup)8 LayoutInflater (android.view.LayoutInflater)7 AdapterView (android.widget.AdapterView)7 ScrollView (android.widget.ScrollView)7 RemoteException (android.os.RemoteException)6 SeekBar (android.widget.SeekBar)6 Test (org.junit.Test)6 AlertDialog (android.support.v7.app.AlertDialog)5 Context (android.content.Context)4