Search in sources :

Example 66 with CheckBox

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;
}
Also used : CheckBox(android.widget.CheckBox) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) CompoundButton(android.widget.CompoundButton) InfoApp(com.clear.helpers.InfoApp)

Example 67 with CheckBox

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;
}
Also used : SectionItem(com.clear.helpers.SectionItem) SectionItem(com.clear.helpers.SectionItem) EntryItem(com.clear.helpers.EntryItem) Item(com.clear.helpers.Item) CheckBox(android.widget.CheckBox) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) CompoundButton(android.widget.CompoundButton) EntryItem(com.clear.helpers.EntryItem)

Example 68 with CheckBox

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);
}
Also used : GridLayout(android.widget.GridLayout) OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener) CompoundButton(android.widget.CompoundButton) Button(android.widget.Button) CheckBox(android.widget.CheckBox) ViewGroup(android.view.ViewGroup) View(android.view.View) CompoundButton(android.widget.CompoundButton) VectorDrawable(android.graphics.drawable.VectorDrawable)

Example 69 with CheckBox

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);
}
Also used : GridLayout(android.widget.GridLayout) ScrollView(android.widget.ScrollView) CheckBox(android.widget.CheckBox)

Example 70 with CheckBox

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;
}
Also used : CheckBox(android.widget.CheckBox) TextView(android.widget.TextView) View(android.view.View) TextView(android.widget.TextView) CompoundButton(android.widget.CompoundButton)

Aggregations

CheckBox (android.widget.CheckBox)197 View (android.view.View)102 TextView (android.widget.TextView)78 CompoundButton (android.widget.CompoundButton)51 Button (android.widget.Button)48 ImageView (android.widget.ImageView)32 Intent (android.content.Intent)30 EditText (android.widget.EditText)30 LayoutInflater (android.view.LayoutInflater)25 AdapterView (android.widget.AdapterView)25 DialogInterface (android.content.DialogInterface)21 ListView (android.widget.ListView)20 SuppressLint (android.annotation.SuppressLint)19 RadioButton (android.widget.RadioButton)19 AlertDialog (android.app.AlertDialog)17 Paint (android.graphics.Paint)14 Bundle (android.os.Bundle)12 ViewGroup (android.view.ViewGroup)12 GridLayout (android.widget.GridLayout)12 LinearLayout (android.widget.LinearLayout)12