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);
}
}
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;
}
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);
}
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...");
}
}
});
}
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;
}
Aggregations