@Override public void onClick(View v) { // TODO Auto-generated method stub if (mListener == null) { return; } switch (v.getId()) { case R.id.btn_search_category: mData.setIntent(new Intent(Intent.ACTION_TANK_LIST)); mListener.onSelectionChanged(mData, true); break; default: mData.setIntent(new Intent(Intent.ACTION_DIALOG_DISMISS)); mListener.onSelectionChanged(mData, true); break; } }
private void setData(TechData data) { mAdapter.clear(); if (data.getStatisticDatas() != null && data.getStatisticDatas().size() > 0) { for (TankStatisticData statisticData : data.getStatisticDatas()) { statisticData.setViewName(ItemTankAstatistic.class.getName()); mAdapter.add(statisticData); } } tv_name.setText(data.getTechName()); if (data.getSpecialDatas() != null && data.getSpecialDatas().size() > 0) { StringBuffer sb = new StringBuffer(); for (TechSpecialData specialData : data.getSpecialDatas()) { sb.append( String.format( getContext().getString(R.string.cap_tech_sp_name), specialData.getName())); sb.append(" "); sb.append(TechManager.getAbilityDescription(specialData.getName())); sb.append(specialData.getDescription() + "\n"); } tv_special.setText(sb.toString()); } if (TextUtils.isEmpty(data.getTechIcon())) { iv_tech.setImageResource( getContext() .getResources() .getIdentifier(data.getIcon(), "drawable", getContext().getPackageName())); } else { Utils.setAssetsImage(getContext(), data.getTechIcon(), iv_tech); } switch (data.getRank()) { case 1: iv_rank_lv.setImageResource(R.drawable.icon_rank_lv_01); break; case 2: iv_rank_lv.setImageResource(R.drawable.icon_rank_lv_02); break; case 3: iv_rank_lv.setImageResource(R.drawable.icon_rank_lv_03); break; default: iv_rank_lv.setImageDrawable(null); break; } }