use of android.widget.CheckBox in project AndroidCleaner by ReguloSarmiento.
the class ApplicationAdapter method getView.
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
View view = convertView;
if (null == view) {
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = layoutInflater.inflate(R.layout.list_app_item, null);
}
final InfoApp data = appsList.get(position);
if (null != data) {
TextView appName = (TextView) view.findViewById(R.id.app_name);
TextView fecha = (TextView) view.findViewById(R.id.fechaInstalled);
TextView espacio = (TextView) view.findViewById(R.id.espaciOcupado);
ImageView iconview = (ImageView) view.findViewById(R.id.app_icon);
final CheckBox check = (CheckBox) view.findViewById(R.id.check);
check.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
data.setSelected(buttonView.isChecked());
}
});
appName.setText(data.getAppname());
fecha.setText(data.getFechaInstalled());
espacio.setText(data.getEspacioOcupadoCacheCodigo());
iconview.setImageDrawable(data.getIcon());
check.setChecked(data.isSelected());
}
return view;
}
use of android.widget.CheckBox in project AndroidCleaner by ReguloSarmiento.
the class AdapterHistory method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
final Item i = items.get(position);
if (i != null) {
if (i.isSection()) {
SectionItem si = (SectionItem) i;
v = vi.inflate(R.layout.divisor, null);
v.setBackgroundColor(Color.parseColor("#142241"));
v.setOnClickListener(null);
v.setOnLongClickListener(null);
v.setLongClickable(false);
final TextView sectionView = (TextView) v.findViewById(R.id.list_item_section_text);
sectionView.setTextColor(Color.parseColor("#FFFFFF"));
sectionView.setText(si.getTitle());
} else {
final EntryItem ei = (EntryItem) i;
v = vi.inflate(R.layout.list_items_history, null);
final ImageView icono = (ImageView) v.findViewById(R.id.list_item_entry_drawable);
final TextView title = (TextView) v.findViewById(R.id.list_item_entry_title);
final TextView cantidad = (TextView) v.findViewById(R.id.list_item_entry_summary);
final CheckBox check = (CheckBox) v.findViewById(R.id.checkBox1);
check.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
Log.d("Metodo ApplicationAdapter------>", ei.title);
ei.setSelected(buttonView.isChecked());
}
});
title.setText(ei.title);
cantidad.setText(ei.cantidad);
icono.setImageResource(ei.icono);
check.setChecked(ei.isSelected());
}
}
return v;
}
use of android.widget.CheckBox in project android_frameworks_base by ResurrectionRemix.
the class VectorDrawable01 method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GridLayout container = new GridLayout(this);
container.setColumnCount(5);
container.setBackgroundColor(0xFF888888);
final Button[] bArray = new Button[icon.length];
CheckBox toggle = new CheckBox(this);
toggle.setText("Toggle");
toggle.setChecked(true);
toggle.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
ViewGroup vg = (ViewGroup) buttonView.getParent();
for (int i = 0, count = vg.getChildCount(); i < count; i++) {
View child = vg.getChildAt(i);
if (child != buttonView) {
child.setEnabled(isChecked);
}
}
}
});
container.addView(toggle);
for (int i = 0; i < icon.length; i++) {
Button button = new Button(this);
bArray[i] = button;
button.setWidth(200);
button.setBackgroundResource(icon[i]);
container.addView(button);
VectorDrawable vd = (VectorDrawable) button.getBackground();
vd.setAlpha((i + 1) * (0xFF / (icon.length + 1)));
}
setContentView(container);
}
use of android.widget.CheckBox in project android_frameworks_base by ResurrectionRemix.
the class AnimatedStateVectorDrawableTest method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ScrollView scrollView = new ScrollView(this);
GridLayout container = new GridLayout(this);
scrollView.addView(container);
container.setColumnCount(2);
for (int i = 0; i < icon.length; i++) {
CheckBox button = new CheckBox(this);
button.setWidth(400);
button.setHeight(400);
button.setBackgroundResource(icon[i]);
container.addView(button);
}
setContentView(scrollView);
}
use of android.widget.CheckBox in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BluetoothPairingDialog method createView.
private View createView() {
View view = getLayoutInflater().inflate(R.layout.bluetooth_pin_confirm, null);
TextView pairingViewCaption = (TextView) view.findViewById(R.id.pairing_caption);
TextView pairingViewContent = (TextView) view.findViewById(R.id.pairing_subhead);
TextView messagePairing = (TextView) view.findViewById(R.id.pairing_code_message);
CheckBox contactSharing = (CheckBox) view.findViewById(R.id.phonebook_sharing_message_confirm_pin);
contactSharing.setText(getString(R.string.bluetooth_pairing_shares_phonebook, mCachedDeviceManager.getName(mDevice)));
if (mPbapClientProfile != null && mPbapClientProfile.isProfileReady()) {
contactSharing.setVisibility(View.GONE);
}
if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_ALLOWED) {
contactSharing.setChecked(true);
} else if (mDevice.getPhonebookAccessPermission() == BluetoothDevice.ACCESS_REJECTED) {
contactSharing.setChecked(false);
} else {
if (mDevice.getBluetoothClass().getDeviceClass() == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) {
contactSharing.setChecked(true);
mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED);
} else {
contactSharing.setChecked(false);
mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
}
}
contactSharing.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
if (isChecked) {
mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED);
} else {
mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
}
}
});
String messageCaption = null;
String pairingContent = null;
switch(mType) {
case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PASSKEY:
case BluetoothDevice.PAIRING_VARIANT_DISPLAY_PIN:
messagePairing.setVisibility(View.VISIBLE);
case BluetoothDevice.PAIRING_VARIANT_PASSKEY_CONFIRMATION:
pairingContent = mPairingKey;
break;
case BluetoothDevice.PAIRING_VARIANT_CONSENT:
case BluetoothDevice.PAIRING_VARIANT_OOB_CONSENT:
messagePairing.setVisibility(View.VISIBLE);
break;
default:
Log.e(TAG, "Incorrect pairing type received, not creating view");
return null;
}
if (pairingContent != null) {
pairingViewCaption.setVisibility(View.VISIBLE);
pairingViewContent.setVisibility(View.VISIBLE);
pairingViewContent.setText(pairingContent);
}
return view;
}
Aggregations