导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AbsListView;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.mifeng.ui.R;
import com.r.b.b2;
import com.showself.domain.GetBaseParser;
import com.showself.domain.GetTeamGroupParser;
import com.showself.domain.LoginResultInfo;
import com.showself.show.bean.TeamGroupBean;
import com.showself.utils.Utils;
import com.showself.utils.r0;
import com.showself.utils.u0;
import com.showself.view.ImmersiveStatusBar;
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 JoinTeamGroupActivity extends com.showself.ui.c implements PullToRefreshView.b, AbsListView.OnScrollListener, View.OnClickListener {
    private PullToRefreshView a;
    private ListView b;
    private ImmersiveStatusBar c;
    private n d;

    private View f2688e;

    private b2 f2689f;

    private int f2691h;

    private LoginResultInfo f2694k;
    private Dialog l;
    private Button m;
    private com.showself.view.e n;
    private RelativeLayout o;
    private RelativeLayout p;

    private int f2690g = 0;

    private boolean f2692i = false;

    private boolean f2693j = false;
    private ArrayList<TeamGroupBean> q = new ArrayList<>();

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

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

    class b implements View.OnClickListener {
        b() {
        }

        @Override
        public void onClick(View view) {
            JoinTeamGroupActivity.this.startActivity(new Intent((Context) JoinTeamGroupActivity.this, (Class<?>) ArmyCreateActivity.class));
            JoinTeamGroupActivity.this.n.dismiss();
        }
    }

    class c implements View.OnClickListener {
        c() {
        }

        @Override
        public void onClick(View view) {
            JoinTeamGroupActivity.this.startActivity(new Intent((Context) JoinTeamGroupActivity.this, (Class<?>) SearchArmyActivity.class));
            JoinTeamGroupActivity.this.n.dismiss();
        }
    }

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

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

    private void D() {
        if (this.f2693j) {
            return;
        }
        this.f2693j = true;
        if (this.f2690g == 0) {
            this.d.d(0);
        } else {
            this.d.d(1);
        }
        com.r.c.a aVar = new com.r.c.a();
        aVar.b(Oauth2AccessToken.KEY_UID, this.f2694k.getUserId());
        aVar.b("startindex", this.f2690g);
        aVar.b("recordnum", 20);
        new com.r.c.c(com.r.c.c.k("armyservice11/armygroupinfo/getarmygrouplist.do", 1), aVar, new GetTeamGroupParser(), this).y(new a());
    }

    public void E(HashMap<Object, Object> hashMap) {
        this.a.k();
        this.f2693j = 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("armyGroupList");
            if (this.f2690g == 0) {
                this.q.clear();
            }
            if (arrayList == null || arrayList.isEmpty()) {
                this.f2692i = false;
            } else {
                this.q.addAll(arrayList);
                if (arrayList.size() < 20) {
                    this.f2692i = false;
                } else {
                    this.f2692i = true;
                }
                this.f2690g += arrayList.size();
            }
            if (this.f2692i) {
                this.d.d(0);
            } else {
                this.d.d(2);
            }
            this.f2689f.b(this.q);
        }
    }

    public void F(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 == 0) {
                Utils.Z0(this, getResources().getString(R.string.army_team_apply_success_tip));
            } else {
                Utils.Z0(this, str);
            }
        }
    }

    private void H(int i2) {
        com.r.c.a aVar = new com.r.c.a();
        aVar.b(Oauth2AccessToken.KEY_UID, this.f2694k.getUserId());
        aVar.b("armyGroupId", i2);
        new com.r.c.c(com.r.c.c.k("armyservice11/custarmygroupmemberapply/savearmygroupmemberapply.do", 1), aVar, new GetBaseParser(), this).y(new d());
    }

    private void J() {
        com.showself.view.e eVar = new com.showself.view.e((Context) this, this, R.style.armydialog);
        this.n = eVar;
        eVar.setCanceledOnTouchOutside(true);
        this.n.setContentView(R.layout.layout_join_team);
        this.o = (RelativeLayout) this.n.findViewById(R.id.layout_dialog_army_function_mine);
        this.p = (RelativeLayout) this.n.findViewById(R.id.layout_dialog_army_function_search);
        this.o.setOnClickListener(new b());
        this.p.setOnClickListener(new c());
        int height = getWindowManager().getDefaultDisplay().getHeight();
        Rect rect = new Rect();
        getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
        int i2 = rect.top;
        this.n.getWindow().setWindowAnimations(R.style.dialogWindowAnim);
        Window window = this.n.getWindow();
        WindowManager.LayoutParams attributes = window.getAttributes();
        window.setGravity(48);
        attributes.x = 0;
        int dimension = (int) getResources().getDimension(R.dimen.titlebar_high);
        attributes.y = dimension + i2;
        attributes.width = -1;
        attributes.height = (height - dimension) - i2;
        window.setAttributes(attributes);
        this.n.show();
    }

    public void C() {
        Button button = this.m;
        if (button != null) {
            button.setBackgroundResource(R.drawable.icon_army_title_open);
        }
    }

    public void G() {
        Dialog dialog = this.l;
        if (dialog != null) {
            dialog.dismiss();
        }
    }

    public void I() {
        int height = getWindowManager().getDefaultDisplay().getHeight();
        Rect rect = new Rect();
        getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
        int i2 = rect.top;
        this.l.getWindow().setWindowAnimations(R.style.dialogWindowAnimCover);
        Window window = this.l.getWindow();
        WindowManager.LayoutParams attributes = window.getAttributes();
        window.setGravity(48);
        attributes.x = 0;
        int dimension = (int) getResources().getDimension(R.dimen.titlebar_high);
        attributes.y = i2 + dimension;
        attributes.width = -1;
        attributes.height = height - dimension;
        window.setAttributes(attributes);
        this.l.show();
    }

    @Override
    public void init() {
        findViewById(R.id.btn_nav_left).setOnClickListener(this);
        ((TextView) findViewById(R.id.tv_nav_title)).setText(getResources().getString(R.string.join_team));
        ((TextView) findViewById(R.id.tv_nav_right)).setVisibility(8);
        Button button = (Button) findViewById(R.id.btn_right);
        this.m = button;
        button.setBackgroundResource(R.drawable.icon_army_title_open);
        this.m.setVisibility(0);
        this.m.setOnClickListener(this);
        Dialog dialog = new Dialog(this, R.style.armydialog);
        this.l = dialog;
        dialog.setContentView(R.layout.dialog_army_cover);
        this.c = (ImmersiveStatusBar) findViewById(2131298726);
        this.a = (PullToRefreshView) findViewById(R.id.refresh_activity);
        this.b = (ListView) findViewById(R.id.lv_store_content);
        n nVar = new n(this);
        this.d = nVar;
        View a2 = nVar.a();
        this.f2688e = a2;
        this.b.addFooterView(a2);
        b2 b2Var = new b2(this, this, this);
        this.f2689f = b2Var;
        this.b.setAdapter((ListAdapter) b2Var);
        this.b.setOnScrollListener(this);
        this.a.setOnHeaderRefreshListener(this);
        this.a.f();
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == 2131296486) {
            finish();
            return;
        }
        if (id == 2131296514) {
            this.m.setBackgroundResource(R.drawable.icon_army_title_close);
            J();
        } else {
            if (id != 2131299573) {
                return;
            }
            H(((TeamGroupBean) view.getTag()).getId());
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.team_manager_layout);
        u0.q(this, null);
        this.f2694k = r0.y(this);
        init();
        u0.i(this, this.c, R.color.navigationbar_bg, true);
    }

    @Override
    public void onScroll(AbsListView absListView, int i2, int i3, int i4) {
        int i5 = (i2 + i3) - 1;
        if (this.f2691h == 0 || i5 != i4 - 1 || !this.f2692i || this.f2693j) {
            return;
        }
        D();
    }

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

    @Override
    public void p(PullToRefreshView pullToRefreshView) {
        this.f2690g = 0;
        D();
    }

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