导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui.relation;

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.o1;
import com.showself.domain.FriendInfo;
import com.showself.net.e;
import com.showself.service.f;
import com.showself.service.g;
import com.showself.ui.CardActivity;
import com.showself.utils.Utils;
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 RelationPraseActivity extends com.showself.ui.c implements PullToRefreshView.b {
    private Button a;
    private TextView b;
    private PullToRefreshView c;
    private ListView d;

    private int f3262e;

    private n f3263f;

    private View f3264g;

    private o1 f3266i;

    private Bundle f3267j;

    private int f3268k;

    private List<FriendInfo> f3265h = new ArrayList();
    private int l = 0;
    private int m = 20;
    private boolean n = true;
    private boolean o = false;
    public Handler p = new a();

    class a extends Handler {
        a() {
        }

        @Override
        public void handleMessage(Message message) {
            super.handleMessage(message);
            if (message.what != 1) {
                return;
            }
            RelationPraseActivity.this.f3266i.notifyDataSetChanged();
        }
    }

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

        @Override
        public void onScroll(AbsListView absListView, int i2, int i3, int i4) {
            int i5 = (i2 + i3) - 1;
            if (RelationPraseActivity.this.f3262e == 0 || i5 != i4 - 1) {
                return;
            }
            RelationPraseActivity relationPraseActivity = RelationPraseActivity.this;
            relationPraseActivity.H(relationPraseActivity.f3268k, RelationPraseActivity.this.l, RelationPraseActivity.this.m);
        }

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

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

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

        c(RelationPraseActivity relationPraseActivity, a aVar) {
            this();
        }
    }

    private class d implements AdapterView.OnItemClickListener {
        private d() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i2, long j2) {
            if (RelationPraseActivity.this.f3265h == null || RelationPraseActivity.this.f3265h.size() <= 0 || i2 >= RelationPraseActivity.this.f3265h.size()) {
                return;
            }
            FriendInfo friendInfo = (FriendInfo) RelationPraseActivity.this.f3265h.get(i2);
            Intent intent = new Intent((Context) RelationPraseActivity.this, (Class<?>) CardActivity.class);
            intent.putExtra("id", friendInfo.getUid());
            RelationPraseActivity.this.startActivity(intent);
        }

        d(RelationPraseActivity relationPraseActivity, a aVar) {
            this();
        }
    }

    public void H(int i2, int i3, int i4) {
        if (!this.n || this.o) {
            return;
        }
        this.o = true;
        if (i3 == 0) {
            this.f3263f.d(0);
        } else {
            this.f3263f.d(1);
        }
        HashMap hashMap = new HashMap();
        hashMap.put("fuid", Integer.valueOf(i2));
        hashMap.put("type", "profilepraisephoto");
        hashMap.put("startindex", Integer.valueOf(i3));
        hashMap.put("recordnum", Integer.valueOf(i4));
        addTask(new f(10018, hashMap), this);
    }

    @Override
    public void init() {
        Button button = (Button) findViewById(R.id.btn_nav_left);
        this.a = button;
        a aVar = null;
        button.setOnClickListener(new c(this, aVar));
        this.b = (TextView) findViewById(R.id.tv_nav_title);
        if (r0.y(this).getUserId() == this.f3268k) {
            this.b.setText(R.string.prase_me);
        } else {
            this.b.setText(R.string.prase_ta);
        }
        n nVar = new n(this);
        this.f3263f = nVar;
        this.f3264g = nVar.a();
        this.c = (PullToRefreshView) findViewById(R.id.refresh_relation_prase);
        ListView listView = (ListView) findViewById(R.id.lv_relation_prase_rank);
        this.d = listView;
        listView.addFooterView(this.f3264g);
        this.c.setOnHeaderRefreshListener(this);
        o1 o1Var = new o1(this, this.f3265h);
        this.f3266i = o1Var;
        this.d.setAdapter((ListAdapter) o1Var);
        this.d.setOnItemClickListener(new d(this, aVar));
        this.f3266i.notifyDataSetChanged();
        this.d.setOnScrollListener(new b());
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.relation_prase_tab);
        Bundle extras = getIntent().getExtras();
        this.f3267j = extras;
        this.f3268k = extras.getInt("id");
        if (this.f3267j.containsKey("userId")) {
            this.f3267j.getInt("userId");
        }
        init();
        this.c.f();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    public void p(PullToRefreshView pullToRefreshView) {
        this.l = 0;
        this.n = true;
        H(this.f3268k, 0, this.m);
    }

    @Override
    public void refresh(Object... objArr) {
        this.o = false;
        int intValue = ((Integer) objArr[0]).intValue();
        HashMap hashMap = (HashMap) objArr[1];
        if (hashMap != null) {
            int intValue2 = ((Integer) hashMap.get(e.n1)).intValue();
            String str = (String) hashMap.get(e.o1);
            if (intValue == 10018) {
                if (intValue2 == e.m1) {
                    if (this.l == 0) {
                        this.f3265h.clear();
                    }
                    List list = (List) hashMap.get("friends");
                    if (list != null) {
                        this.f3265h.addAll(list);
                        if (list.size() < this.m) {
                            this.f3263f.d(2);
                            this.n = false;
                        } else {
                            this.f3263f.d(0);
                            this.n = true;
                        }
                        this.l += list.size();
                        Message message = new Message();
                        message.what = 1;
                        this.p.sendMessage(message);
                    } else {
                        this.f3263f.d(2);
                        this.n = false;
                    }
                } else {
                    Utils.Z0(this, str);
                }
            }
        }
        this.c.l(System.currentTimeMillis());
        g.i(this);
    }
}