导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui;

import android.os.Bundle;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.mifeng.ui.R;
import com.r.b.r1;
import com.showself.domain.GetSearchArmyParser;
import com.showself.domain.LoginResultInfo;
import com.showself.show.bean.SearchArmyBean;
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 SearchArmyActivity extends c implements PullToRefreshView.b, AbsListView.OnScrollListener, View.OnClickListener {
    private PullToRefreshView a;
    private ListView b;
    private n c;
    private View d;

    private r1 f2838e;

    private ImmersiveStatusBar f2839f;

    private int f2841h;

    private LoginResultInfo f2844k;
    private EditText m;
    private TextView n;
    private TextView o;
    private TextView p;

    private int f2840g = 0;

    private boolean f2842i = false;

    private boolean f2843j = false;
    private ArrayList<SearchArmyBean> l = new ArrayList<>();
    private boolean q = false;

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

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

    private void A() {
        if (this.q && (this.m.getText().toString() == null || "".equals(this.m.getText().toString()))) {
            Utils.Z0(this, getResources().getString(R.string.input_keyword_text_search_tip));
            return;
        }
        if (this.f2843j) {
            return;
        }
        this.f2843j = true;
        if (this.f2840g == 0) {
            this.c.d(0);
        } else {
            this.c.d(1);
        }
        com.r.c.a aVar = new com.r.c.a();
        aVar.b(Oauth2AccessToken.KEY_UID, this.f2844k.getUserId());
        aVar.b("startindex", this.f2840g);
        aVar.e("searchtext", this.m.getText().toString());
        if (this.q) {
            aVar.b("recordnum", 20);
            aVar.b("searchtype", 1);
        } else {
            aVar.b("recordnum", 10);
            aVar.b("searchtype", 0);
        }
        new com.r.c.c(com.r.c.c.k("armyservice11/armygroupinfo/searcharmygroup.do", 1), aVar, new GetSearchArmyParser(), this).y(new a());
    }

    public void B(HashMap<Object, Object> hashMap) {
        this.a.k();
        this.f2843j = false;
        if (this.q) {
            this.o.setText(getResources().getString(R.string.search_result));
        } else {
            this.o.setText(getResources().getString(R.string.hot_army));
        }
        this.p.setVisibility(8);
        this.o.setVisibility(0);
        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) {
                if (intValue != -4100) {
                    Utils.Z0(this, str);
                    return;
                }
                this.p.setText(str);
                this.p.setVisibility(0);
                this.o.setVisibility(8);
                this.l.clear();
                this.f2838e.b(this.l);
                return;
            }
            ArrayList arrayList = (ArrayList) hashMap.get("searchArmy");
            if (this.f2840g == 0) {
                this.l.clear();
            }
            if (arrayList == null || arrayList.isEmpty()) {
                this.f2842i = false;
            } else {
                this.l.addAll(arrayList);
                if (arrayList.size() < 20) {
                    this.f2842i = false;
                } else {
                    this.f2842i = true;
                }
                this.f2840g += arrayList.size();
            }
            if (this.f2842i) {
                this.c.d(0);
            } else {
                this.c.d(2);
            }
            this.f2838e.b(this.l);
        }
    }

    @Override
    public void init() {
        findViewById(R.id.btn_nav_left).setOnClickListener(this);
        findViewById(R.id.btn_nav_right).setOnClickListener(this);
        this.m = (EditText) findViewById(R.id.et_search_army);
        TextView textView = (TextView) findViewById(R.id.search_army_close);
        this.n = textView;
        textView.setOnClickListener(this);
        this.o = (TextView) findViewById(R.id.tv_search_army_tip);
        TextView textView2 = (TextView) findViewById(R.id.tv_search_no_army_tip);
        this.p = textView2;
        textView2.setVisibility(8);
        this.a = (PullToRefreshView) findViewById(R.id.refresh_activity);
        this.b = (ListView) findViewById(R.id.lv_store_content);
        this.f2839f = (ImmersiveStatusBar) findViewById(2131298726);
        n nVar = new n(this);
        this.c = nVar;
        View a2 = nVar.a();
        this.d = a2;
        this.b.addFooterView(a2);
        r1 r1Var = new r1(this, this);
        this.f2838e = r1Var;
        this.b.setAdapter((ListAdapter) r1Var);
        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 != 2131296490) {
            if (id != 2131298618) {
                return;
            }
            this.m.setText("");
        } else {
            ((InputMethodManager) getSystemService("input_method")).hideSoftInputFromWindow(view.getWindowToken(), 2);
            this.q = true;
            this.f2840g = 0;
            A();
        }
    }

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

    @Override
    public void onScroll(AbsListView absListView, int i2, int i3, int i4) {
        int i5 = (i2 + i3) - 1;
        if (this.f2841h == 0 || i5 != i4 - 1 || !this.f2842i || this.f2843j) {
            return;
        }
        A();
    }

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

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

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