Example #1
0
  @Override
  protected void onInitItem(int position, final QLayoutOauth.Token data, Object viewHolder) {
    Holder h = (Holder) viewHolder;
    //
    h.ivPic.setTag(data.getId());
    //
    /*switch(data.getType()){
    case QLayoutOauth.TYPE_SINA_WEIBO: h.ivLogo.setBackgroundResource(R.drawable.logo_sinaweibo); break;
    case QLayoutOauth.TYPE_QQ_WEIBO: h.ivLogo.setBackgroundResource(R.drawable.logo_qqweibo); break;
    case QLayoutOauth.TYPE_QZONE: h.ivLogo.setBackgroundResource(R.drawable.logo_qqzone); break;
    case QLayoutOauth.TYPE_RENREN: h.ivLogo.setBackgroundResource(R.drawable.logo_renren); break;
    }*/
    //
    h.tvName.setText(data.getName());
    //
    h.layout.setTag(data);
    h.layout.setOnClickListener(this);
    //
    h.btnDelete.setTag(data);
    h.btnDelete.setOnClickListener(this);

    Bitmap bm = cache.get(data.getId());
    if (bm != null) {
      h.ivPic.setImageBitmap(bm);
    } else {
      h.ivPic.setImageBitmap(null);
      qHttp.get(data.getPhoto(), data.getId());
    }
  }
Example #2
0
  private void onClickDelete(QLayoutOauth.Token data) {
    final QDialog.Simple dialogDelete = new QDialog.Simple(ctx, "确定要删除<" + data.getName() + ">吗?");
    dialogDelete.addBtn(
        "确定",
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            dialogDelete.cancel();
          }
        });
    dialogDelete.show();
  }