APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:CoC Maps
版本号:1.0
包名称:com.moonstudio.mapcoc

MD5 校验值:a69a8bb2781bb077ad0ba51d66c4fc0c

反编译源代码说明

FunnyLayoutAdapter.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 FunnyLayoutAdapter extends ArrayAdapter<FunnyLayout> {
    private final Activity context;
    private ArrayList<FunnyLayout> values;

    static class ViewHolder {
        public TextView details;
        public Button download;
        public ImageView image;
        public TextView info;

        ViewHolder() {
        }
    }

    public FunnyLayoutAdapter(Activity activity, ArrayList<FunnyLayout> 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/funny_layouts/thumbs/" + this.values.get(i).getImage()).placeholder(R.drawable.ic_placeholder).error(R.drawable.ic_placeholder).into(viewHolder2.image);
        String str = "Map #" + this.values.get(i).getId();
        viewHolder2.details.setText("Views: " + this.values.get(i).getView() + ", Downloads: " + this.values.get(i).getDownload());
        viewHolder2.info.setText(this.values.get(i).getTitle());
        final FunnyLayout funnyLayout = this.values.get(i);
        viewHolder2.download.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view2) {
                ((FunnyLayoutActivity) FunnyLayoutAdapter.this.context).viewData(funnyLayout, i);
            }
        });
        return view;
    }

    @Override
    public int getCount() {
        return this.values.size();
    }

    @Override
    public FunnyLayout getItem(int i) {
        return this.values.get(i);
    }

    @Override
    public long getItemId(int i) {
        return Integer.parseInt(this.values.get(i).getId());
    }
}