导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AbsListView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.android.volley.toolbox.ImageLoader;
import com.mifeng.ui.R;
import com.showself.domain.DancerPartner;
import com.showself.domain.LoginResultInfo;
import com.showself.service.g;
import com.showself.utils.Utils;
import com.showself.utils.l;
import com.showself.utils.r0;
import com.showself.view.PullToRefreshView;
import com.showself.view.n;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class AllDancerPartnerActivity extends com.showself.ui.c implements PullToRefreshView.b {
    private ImageLoader A;
    private int a;
    private boolean b;
    private PullToRefreshView d;

    private n f2538e;

    private View f2539f;

    private View f2540g;

    private ListView f2541h;

    private com.r.b.e f2542i;

    private int f2544k;
    private int l;
    private String n;
    private int o;
    private int p;
    private int q;
    private String r;
    private String s;
    private Button t;
    private ImageView u;
    private ImageView v;
    private ImageView w;
    private TextView x;
    private TextView y;
    private LoginResultInfo z;
    private boolean c = true;

    private List<DancerPartner> f2543j = new ArrayList();
    private int m = 20;
    private View.OnClickListener B = new b();

    class a implements AbsListView.OnScrollListener {
        a() {
        }

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

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

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

        @Override
        public void onClick(View view) {
            switch (view.getId()) {
                case R.id.btn_nav_left:
                    AllDancerPartnerActivity.this.finish();
                    break;
                case R.id.btn_nav_right:
                    if (AllDancerPartnerActivity.this.q != 0) {
                        if (AllDancerPartnerActivity.this.q == 2) {
                            AllDancerPartnerActivity.this.M();
                            break;
                        }
                    } else if (AllDancerPartnerActivity.this.p != 2 && AllDancerPartnerActivity.this.p != 3) {
                        Utils.Y0(AllDancerPartnerActivity.this.getApplicationContext(), R.string.please_follow_frist);
                        break;
                    } else {
                        AllDancerPartnerActivity.this.I(1);
                        break;
                    }
                    break;
                case R.id.iv_avatar_me:
                    Intent intent = new Intent(AllDancerPartnerActivity.this.getApplicationContext(), (Class<?>) CardActivity.class);
                    intent.putExtra("id", AllDancerPartnerActivity.this.z.getUserId());
                    AllDancerPartnerActivity.this.startActivity(intent);
                    break;
                case R.id.iv_avatar_you:
                    Intent intent2 = new Intent(AllDancerPartnerActivity.this.getApplicationContext(), (Class<?>) CardActivity.class);
                    intent2.putExtra("id", AllDancerPartnerActivity.this.a);
                    AllDancerPartnerActivity.this.startActivity(intent2);
                    break;
            }
        }
    }

    class c implements l {
        c() {
        }

        @Override
        public void a(boolean z) {
            if (z) {
                AllDancerPartnerActivity.this.I(2);
            }
        }
    }

    public void I(int i2) {
        if (this.b) {
            return;
        }
        this.b = true;
        HashMap hashMap = new HashMap();
        hashMap.put("fuid", Integer.valueOf(this.a));
        hashMap.put("type", Integer.valueOf(i2));
        addTask(new com.showself.service.f(10118, hashMap), getApplicationContext());
        Utils.U0(this);
    }

    private void J() {
        if (this.l == 0) {
            if (this.o == 1) {
                this.f2541h.removeHeaderView(this.f2539f);
            } else {
                this.f2539f.setVisibility(0);
                this.A.displayImage(this.z.getAvatar(), this.u);
                this.A.displayImage(this.n, this.v);
                this.u.setOnClickListener(this.B);
                this.v.setOnClickListener(this.B);
                int i2 = this.q;
                if (i2 == 0) {
                    this.w.setBackgroundResource(R.drawable.friend_dp_norelation_status);
                    this.x.setText(this.s);
                    this.y.setText(getString(R.string.intimacy) + this.r);
                    this.t.setText(R.string.invite_dp);
                    this.t.setVisibility(0);
                } else if (i2 == 1) {
                    this.w.setBackgroundResource(R.drawable.friend_dp_waiting_status);
                    this.x.setText(this.s);
                    this.y.setText(getString(R.string.intimacy) + this.r);
                    this.t.setVisibility(8);
                } else if (i2 == 2) {
                    this.w.setBackgroundResource(R.drawable.friend_dp_isdp_status);
                    this.x.setText(this.s);
                    this.y.setText(getString(R.string.intimacy) + this.r);
                    this.t.setText(R.string.dp_cancle);
                    this.t.setVisibility(0);
                }
                this.t.setOnClickListener(this.B);
            }
        }
        this.f2542i.b(this.f2543j);
    }

    public void K() {
        if (this.b || !this.c) {
            return;
        }
        this.b = true;
        if (this.l == 0) {
            this.f2538e.d(0);
        } else {
            this.f2538e.d(1);
        }
        HashMap hashMap = new HashMap();
        hashMap.put("fuid", Integer.valueOf(this.a));
        hashMap.put("type", 2);
        hashMap.put("startindex", Integer.valueOf(this.l));
        hashMap.put("recordnum", Integer.valueOf(this.m));
        addTask(new com.showself.service.f(10120, hashMap), getApplicationContext());
    }

    private void L() {
        if (this.c) {
            this.f2538e.d(0);
        } else {
            this.f2538e.d(2);
        }
        this.f2542i.notifyDataSetChanged();
    }

    public void M() {
        Utils.Q0(this, getString(R.string.prompt), getString(R.string.dp_cancle_alert), getString(R.string.negative), getResources().getColor(2131099757), getString(R.string.positive), getResources().getColor(2131099758), new c(), true);
    }

    @Override
    public void init() {
        ((Button) findViewById(R.id.btn_nav_left)).setOnClickListener(this.B);
        ((TextView) findViewById(R.id.tv_nav_title)).setText(R.string.all_dancing_partner);
        this.t = (Button) findViewById(R.id.btn_nav_right);
        PullToRefreshView pullToRefreshView = (PullToRefreshView) findViewById(R.id.refresh_activity);
        this.d = pullToRefreshView;
        pullToRefreshView.setOnHeaderRefreshListener(this);
        this.f2541h = (ListView) findViewById(R.id.lv_family_member);
        View inflate = View.inflate(getApplicationContext(), R.layout.friend_all_dp_list_header, null);
        this.f2539f = inflate;
        inflate.setVisibility(8);
        this.u = (ImageView) this.f2539f.findViewById(R.id.iv_avatar_me);
        this.v = (ImageView) this.f2539f.findViewById(R.id.iv_avatar_you);
        this.w = (ImageView) this.f2539f.findViewById(R.id.iv_relation);
        this.x = (TextView) this.f2539f.findViewById(R.id.tv_dp_status);
        this.y = (TextView) this.f2539f.findViewById(R.id.tv_dp_intimate);
        this.f2541h.addHeaderView(this.f2539f);
        n nVar = new n(this);
        this.f2538e = nVar;
        View a2 = nVar.a();
        this.f2540g = a2;
        this.f2541h.addFooterView(a2);
        com.r.b.e eVar = new com.r.b.e(this, this.f2543j);
        this.f2542i = eVar;
        this.f2541h.setAdapter((ListAdapter) eVar);
        this.f2541h.setOnScrollListener(new a());
        this.d.f();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.family_member);
        this.a = getIntent().getIntExtra("fuid", 0);
        this.A = ImageLoader.getInstance(getApplicationContext());
        this.z = r0.y(getApplicationContext());
        init();
    }

    @Override
    protected void onDestroy() {
        List<DancerPartner> list = this.f2543j;
        if (list != null) {
            list.clear();
            this.f2543j = null;
        }
        super.onDestroy();
    }

    @Override
    public void p(PullToRefreshView pullToRefreshView) {
        this.l = 0;
        this.c = true;
        K();
    }

    @Override
    public void refresh(Object... objArr) {
        this.b = false;
        g.i(this);
        this.d.k();
        Utils.n(this);
        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 == 10118) {
                Utils.Z0(this, str);
                if (intValue2 == com.showself.net.e.m1) {
                    this.d.f();
                    sendBroadcast(new Intent("com.showself.updata"));
                    return;
                }
                return;
            }
            if (intValue != 10120) {
                return;
            }
            if (intValue2 == 0) {
                this.n = (String) hashMap.get("avatar");
                this.o = ((Integer) hashMap.get("is_myself")).intValue();
                this.p = ((Integer) hashMap.get("follow_relation_status")).intValue();
                this.q = ((Integer) hashMap.get("dp_relation_status")).intValue();
                this.r = (String) hashMap.get("intimate");
                this.s = (String) hashMap.get("category_desc");
                List list = (List) hashMap.get("persons");
                J();
                if (list == null || list.size() <= 0) {
                    this.c = false;
                } else {
                    if (this.l == 0) {
                        this.f2543j.clear();
                    }
                    this.f2543j.addAll(list);
                    this.l += list.size();
                    if (list.size() < this.m) {
                        this.c = false;
                    } else {
                        this.c = true;
                    }
                }
            } else {
                Utils.Z0(getApplicationContext(), str);
            }
            L();
        }
    }
}