导航菜单

页面标题

页面副标题

95爱播免登录版 v3.1.9 - ArmyContributionActivity.java 源代码

正在查看: 95爱播免登录版 v3.1.9 应用的 ArmyContributionActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.showself.ui;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.mifeng.ui.R;
import com.r.b.i;
import com.showself.show.bean.ArmyContributionBean;
import com.showself.utils.Utils;
import com.showself.view.PullToRefreshView;
import com.showself.view.n;
import java.util.ArrayList;
import java.util.HashMap;

public class ArmyContributionActivity extends c implements PullToRefreshView.b, View.OnClickListener, AbsListView.OnScrollListener {
    private static int n = 20;
    private static int o;
    private static int p;
    private int a;
    private String b;
    private PullToRefreshView c;
    private ListView d;

    private n f2557e;

    private Button f2558f;

    private TextView f2559g;

    private View f2560h;

    private i f2563k;

    private boolean f2561i = true;

    private boolean f2562j = false;
    private ArrayList<ArmyContributionBean> l = new ArrayList<>();

    @SuppressLint({"HandlerLeak"})
    private Handler m = new a();

    class a extends Handler {
        a() {
        }

        @Override
        public void handleMessage(Message message) {
            if (ArmyContributionActivity.this.m == null) {
                return;
            }
            try {
                ArmyContributionActivity.this.refresh(Integer.valueOf(message.what), message.obj, Integer.valueOf(message.arg1));
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }

    public class b implements AdapterView.OnItemClickListener {
        public b() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i2, long j2) {
            if (ArmyContributionActivity.this.l != null) {
                Intent intent = new Intent((Context) ArmyContributionActivity.this, (Class<?>) CardActivity.class);
                if (ArmyContributionActivity.this.l.size() <= 3 || i2 >= ArmyContributionActivity.this.l.size() - 2) {
                    return;
                }
                intent.putExtra("id", ((ArmyContributionBean) ArmyContributionActivity.this.l.get(i2 + 2)).getUid());
                ArmyContributionActivity.this.startActivity(intent);
            }
        }
    }

    private void B(int i2, int i3, int i4) {
        if (this.f2562j) {
            return;
        }
        this.f2562j = true;
        if (i3 == 0) {
            this.f2557e.d(0);
        } else {
            this.f2557e.d(1);
        }
        HashMap hashMap = new HashMap();
        hashMap.put("armyGroupId", Integer.valueOf(i2));
        addTask(new com.showself.service.f(20023, hashMap), this, this.m);
    }

    @Override
    public void init() {
        p = getIntent().getIntExtra("jid", 0);
        this.b = getIntent().getStringExtra("jname");
        Button button = (Button) findViewById(R.id.btn_nav_left_contribution);
        this.f2558f = button;
        button.setOnClickListener(this);
        TextView textView = (TextView) findViewById(R.id.tv_nav_title_contribution);
        this.f2559g = textView;
        textView.setText(this.b + getResources().getString(R.string.title_army_contribution));
        this.c = (PullToRefreshView) findViewById(R.id.refresh_activity_armycontribution);
        this.d = (ListView) findViewById(R.id.lv_activity_contribution);
        i iVar = new i(this);
        this.f2563k = iVar;
        this.d.setAdapter((ListAdapter) iVar);
        n nVar = new n(this);
        this.f2557e = nVar;
        View a2 = nVar.a();
        this.f2560h = a2;
        this.d.addFooterView(a2);
        this.d.setOnItemClickListener(new b());
        this.d.setOnScrollListener(this);
        this.c.setOnHeaderRefreshListener(this);
        this.c.f();
    }

    @Override
    public void onClick(View view) {
        if (view.getId() != 2131296487) {
            return;
        }
        finish();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_army_contribution);
        init();
    }

    @Override
    protected void onDestroy() {
        this.m = null;
        super.onDestroy();
    }

    @Override
    public void onScroll(AbsListView absListView, int i2, int i3, int i4) {
        int i5 = (i2 + i3) - 1;
        if (this.a != 0 && i5 == i4 - 1 && this.f2561i) {
            B(p, o, n);
        }
    }

    @Override
    public void onScrollStateChanged(AbsListView absListView, int i2) {
        this.a = i2;
    }

    @Override
    public void p(PullToRefreshView pullToRefreshView) {
        o = 0;
        B(p, 0, n);
    }

    @Override
    public void refresh(Object... objArr) {
        this.c.k();
        this.f2562j = false;
        int intValue = ((Integer) objArr[0]).intValue();
        HashMap hashMap = (HashMap) objArr[1];
        if (hashMap != null) {
            int intValue2 = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
            String str = (String) hashMap.get(com.showself.net.e.o1);
            if (intValue != 20023) {
                return;
            }
            if (intValue2 != 0) {
                Utils.Z0(this, str);
                return;
            }
            ArrayList arrayList = (ArrayList) hashMap.get("armyContribution");
            if (o == 0) {
                this.l.clear();
            }
            if (arrayList == null) {
                this.f2557e.d(2);
                return;
            }
            this.f2561i = false;
            this.f2557e.d(2);
            o += arrayList.size();
            this.l.addAll(arrayList);
            this.f2563k.c(this.l);
        }
    }
}