MD5 校验值:a69a8bb2781bb077ad0ba51d66c4fc0c
MapAdapter.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package com.moonstudio.mapcoc; import android.app.Activity; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import com.squareup.picasso.Picasso; import java.util.ArrayList; public class MapAdapter extends ArrayAdapter<BaseMap> { private final Activity context; private ArrayList<BaseMap> values; static class ViewHolder { public TextView details; public Button download; public ImageView image; public TextView info; ViewHolder() { } } public MapAdapter(Activity activity, ArrayList<BaseMap> arrayList) { super(activity, R.layout.map_list_item, arrayList); this.context = activity; this.values = arrayList; } @Override public View getView(final int i, View view, ViewGroup viewGroup) { if (view == null) { view = this.context.getLayoutInflater().inflate(R.layout.map_list_item, (ViewGroup) null); ViewHolder viewHolder = new ViewHolder(); viewHolder.image = (ImageView) view.findViewById(R.id.image); viewHolder.info = (TextView) view.findViewById(R.id.info); viewHolder.details = (TextView) view.findViewById(R.id.details); viewHolder.download = (Button) view.findViewById(R.id.download); view.setTag(viewHolder); } ViewHolder viewHolder2 = (ViewHolder) view.getTag(); Picasso.get().load("http://coc.vnhow.vn/img/uploads/layouts/thumbs/" + ("hall" + this.values.get(i).getHall()) + "/" + this.values.get(i).getType() + "/" + this.values.get(i).getImage()).placeholder(R.drawable.ic_placeholder).error(R.drawable.ic_placeholder).into(viewHolder2.image); StringBuilder sb = new StringBuilder(); sb.append("Map #"); sb.append(this.values.get(i).getId()); viewHolder2.info.setText(sb.toString()); viewHolder2.details.setText("Views: " + this.values.get(i).getView() + ", Downloads: " + this.values.get(i).getDownload()); final BaseMap baseMap = this.values.get(i); viewHolder2.download.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view2) { ((MainActivity) MapAdapter.this.context).viewData(baseMap, i); } }); return view; } @Override public int getCount() { return this.values.size(); } @Override public BaseMap getItem(int i) { return this.values.get(i); } @Override public long getItemId(int i) { return Integer.parseInt(this.values.get(i).getId()); } }