导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.AbsListView;
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.h;
import com.showself.domain.ArmyApproveAddParser;
import com.showself.domain.LoginResultInfo;
import com.showself.domain.SetArmyApproveParser;
import com.showself.show.bean.ArmyApproveAddBean;
import com.showself.utils.Utils;
import com.showself.utils.r0;
import com.showself.view.PullToRefreshView;
import com.showself.view.n;
import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import java.util.ArrayList;
import java.util.HashMap;

public class ArmyApproveAdd extends c implements View.OnClickListener, PullToRefreshView.b, AbsListView.OnScrollListener {
    private static int o = 20;
    private static int p;
    private ListView a;
    private h b;
    private Context c;
    private TextView d;

    private Button f2550e;

    private int f2551f;

    private LoginResultInfo f2554i;

    private PullToRefreshView f2556k;
    private n l;
    private View m;
    private int n;

    private boolean f2552g = true;

    private boolean f2553h = false;

    private ArrayList<ArmyApproveAddBean> f2555j = new ArrayList<>();

    class a implements com.r.c.d {
        a() {
        }

        @Override
        public void onRequestFinish(com.r.c.c cVar, Object obj) {
            ArmyApproveAdd.this.C((HashMap) obj);
        }
    }

    class b implements com.r.c.d {
        b() {
        }

        @Override
        public void onRequestFinish(com.r.c.c cVar, Object obj) {
            ArmyApproveAdd.this.D((HashMap) obj);
        }
    }

    private void B(int i2, int i3) {
        if (this.f2553h) {
            return;
        }
        this.f2553h = true;
        if (i2 == 0) {
            this.l.d(0);
        } else {
            this.l.d(1);
        }
        com.r.c.a aVar = new com.r.c.a();
        aVar.b(Oauth2AccessToken.KEY_UID, this.f2554i.getUserId());
        aVar.b("armyGroupId", i3);
        aVar.b("startindex", i2);
        aVar.b("recordnum", o);
        new com.r.c.c(com.showself.net.f.D0().Y0("armyservice11/custarmygroupmemberapply/armyGroupMemberApply.do"), aVar, new ArmyApproveAddParser(), this).y(new a());
    }

    public void C(HashMap<Object, Object> hashMap) {
        this.f2556k.k();
        this.f2553h = false;
        if (hashMap != null) {
            int intValue = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
            String str = (String) hashMap.get(com.showself.net.e.o1);
            if (intValue != com.showself.net.e.m1) {
                Utils.Z0(this, str);
                return;
            }
            ArrayList arrayList = (ArrayList) hashMap.get("armyapproveadd");
            if (p == 0) {
                this.f2555j.clear();
            }
            if (arrayList == null) {
                this.l.d(2);
                return;
            }
            if (arrayList.size() < o) {
                this.f2552g = false;
                this.l.d(2);
            } else {
                this.l.d(0);
                this.f2552g = true;
            }
            p += arrayList.size();
            this.f2555j.addAll(arrayList);
            this.b.a(this.f2555j);
        }
    }

    public void D(HashMap<Object, Object> hashMap) {
        if (hashMap != null) {
            int intValue = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
            String str = (String) hashMap.get(com.showself.net.e.o1);
            if (intValue != com.showself.net.e.m1) {
                Utils.Z0(this.c, str);
            } else {
                this.f2556k.f();
                Utils.Z0(this.c, getResources().getString(R.string.army_team_update_success_tip));
            }
        }
    }

    private void E(int i2, int i3) {
        com.r.c.a aVar = new com.r.c.a();
        aVar.b("armyGroupId", this.f2551f);
        aVar.b("uids", i2);
        aVar.b("status", i3);
        aVar.b("disposeUid", this.f2554i.getUserId());
        new com.r.c.c(com.showself.net.f.D0().Y0("armyservice11/custarmygroupmemberapply/updatearmygroupmemberapplystatus.do"), aVar, new SetArmyApproveParser(), this.c).y(new b());
    }

    @Override
    public void init() {
        this.f2556k = (PullToRefreshView) findViewById(R.id.refresh_activity_army_approveadd);
        this.a = (ListView) findViewById(R.id.listView_army_approveadd);
        TextView textView = (TextView) findViewById(R.id.tv_nav_title);
        this.d = textView;
        textView.setText(getResources().getString(R.string.army_approved_title));
        Button button = (Button) findViewById(R.id.btn_nav_left);
        this.f2550e = button;
        button.setOnClickListener(this);
        this.a.setAdapter((ListAdapter) this.b);
        n nVar = new n(this);
        this.l = nVar;
        View a2 = nVar.a();
        this.m = a2;
        this.a.addFooterView(a2);
        this.f2556k.setOnHeaderRefreshListener(this);
        this.a.setOnScrollListener(this);
        this.f2556k.f();
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_nav_left:
                finish();
                break;
            case R.id.button_item_army_approveadd_no:
                E(((ArmyApproveAddBean) view.getTag()).getUserUid(), 2);
                break;
            case R.id.button_item_army_approveadd_yes:
                E(((ArmyApproveAddBean) view.getTag()).getUserUid(), 1);
                break;
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_army_approveadd);
        this.f2554i = r0.y(this);
        this.c = this;
        this.f2551f = getIntent().getIntExtra("jid", 0);
        this.b = new h(this.c, this.f2555j, this);
        init();
    }

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

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

    @Override
    public void p(PullToRefreshView pullToRefreshView) {
        p = 0;
        B(0, this.f2551f);
    }

    @Override
    public void refresh(Object... objArr) {
    }
}