Search in sources :

Example 1 with EntryItem

use of com.clear.helpers.EntryItem in project AndroidCleaner by ReguloSarmiento.

the class LlamadasMensajesActivity method informacionParaListview.

public void informacionParaListview() {
    llamadas.obtenerDetallesLlamadas();
    mensajes.obtenerMensajesRecibidos();
    mensajes.obtenerMensajesEnviados();
    items.add(new SectionItem(getResources().getString(R.string.calls)));
    items.add(new EntryItem(getResources().getString(R.string.incomming), String.valueOf(llamadas.getLlamadasRecibidas().size()), R.drawable.call_incoming));
    items.add(new EntryItem(getResources().getString(R.string.outgoing), String.valueOf(llamadas.getLlamadasSalientes().size()), R.drawable.call_outgoing));
    items.add(new EntryItem(getResources().getString(R.string.missed), String.valueOf(llamadas.getLlamadasPerdidas().size()), R.drawable.call_missed));
    items.add(new SectionItem(getResources().getString(R.string.messages)));
    items.add(new EntryItem(getResources().getString(R.string.received), String.valueOf(mensajes.getMensajesRecibidos().size()), R.drawable.msj_inbox));
    items.add(new EntryItem(getResources().getString(R.string.sent), String.valueOf(mensajes.getMensajesEnviados().size()), R.drawable.msj_sent));
    adapter = new AdapterLlamadasMensajes(this, items);
    listview.setAdapter(adapter);
    listview.setOnItemClickListener(this);
}
Also used : SectionItem(com.clear.helpers.SectionItem) AdapterLlamadasMensajes(com.clear.adapters.AdapterLlamadasMensajes) EntryItem(com.clear.helpers.EntryItem)

Example 2 with EntryItem

use of com.clear.helpers.EntryItem 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 3 with EntryItem

use of com.clear.helpers.EntryItem in project AndroidCleaner by ReguloSarmiento.

the class AdapterLlamadasMensajes 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.items_call_msj, 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) {
                    ei.setSelected(buttonView.isChecked());
                    Log.d("Metodo ApplicationAdapter------>", ei.title);
                }
            });
            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 4 with EntryItem

use of com.clear.helpers.EntryItem in project AndroidCleaner by ReguloSarmiento.

the class LlamadasMensajesActivity method onItemClick.

@Override
public void onItemClick(AdapterView<?> arg0, View view, int position, long arg3) {
    EntryItem item = (EntryItem) items.get(position);
    CheckBox box = (CheckBox) view.findViewById(R.id.checkBox1);
    if (!item.isSelected()) {
        item.setSelected(true);
        box.setChecked(item.isSelected());
    } else {
        item.setSelected(false);
        box.setChecked(item.isSelected());
    }
}
Also used : CheckBox(android.widget.CheckBox) EntryItem(com.clear.helpers.EntryItem)

Example 5 with EntryItem

use of com.clear.helpers.EntryItem in project AndroidCleaner by ReguloSarmiento.

the class HistoryActivity method informacionParaListview.

public void informacionParaListview() {
    items.add(new SectionItem(getResources().getString(R.string.browser)));
    items.add(new EntryItem(getResources().getString(R.string.browser), String.valueOf(numeroPaginasVisitadas()) + " Pag", R.drawable.browser));
    items.add(new SectionItem(getResources().getString(R.string.download)));
    items.add(new EntryItem(getResources().getString(R.string.download), espacioDescargas(), R.drawable.downloads));
    items.add(new EntryItem(getResources().getString(R.string.files), espacioArchivos(), R.drawable.list_icon_media_files));
    items.add(new SectionItem(getResources().getString(R.string.aplicacion)));
    items.add(new EntryItem(getResources().getString(R.string.clipboard), tamanoPortapapeles(), R.drawable.clipboard));
    adapter = new AdapterHistory(this, items);
    listview.setAdapter(adapter);
    listview.setOnItemClickListener(this);
}
Also used : SectionItem(com.clear.helpers.SectionItem) AdapterHistory(com.clear.adapters.AdapterHistory) EntryItem(com.clear.helpers.EntryItem)

Aggregations

EntryItem (com.clear.helpers.EntryItem)6 CheckBox (android.widget.CheckBox)4 SectionItem (com.clear.helpers.SectionItem)4 View (android.view.View)2 CompoundButton (android.widget.CompoundButton)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 Item (com.clear.helpers.Item)2 AdapterHistory (com.clear.adapters.AdapterHistory)1 AdapterLlamadasMensajes (com.clear.adapters.AdapterLlamadasMensajes)1