导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui;

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.s0;
import com.showself.domain.LoginResultInfo;
import com.showself.domain.MessageManageInfo;
import com.showself.utils.Utils;
import com.showself.utils.r0;
import com.showself.view.PullToRefreshView;
import com.showself.view.SlipButton;
import com.showself.view.n;
import java.util.ArrayList;
import java.util.HashMap;

public class MessageManageActivity extends c implements PullToRefreshView.b, View.OnClickListener {
    private PullToRefreshView a;
    private ListView b;

    private n f2729e;

    private View f2730f;

    private int f2731g;

    private SlipButton f2732h;

    private s0 f2735k;
    private LoginResultInfo l;
    private ArrayList<MessageManageInfo> m;
    private boolean c = true;
    private boolean d = false;

    private int f2733i = 0;

    private int f2734j = 10;

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

        @Override
        public void onScroll(AbsListView absListView, int i2, int i3, int i4) {
            int i5 = (i2 + i3) - 1;
            if (MessageManageActivity.this.f2731g != 0 && i5 == i4 - 1 && MessageManageActivity.this.c) {
                MessageManageActivity.this.F();
                MessageManageActivity.this.f2729e.d(1);
            }
        }

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

    class b implements SlipButton.a {
        b() {
        }

        @Override
        public void a(boolean z) {
            MessageManageActivity.this.H(z);
        }
    }

    public void F() {
        if (!this.c || this.d) {
            return;
        }
        this.d = true;
        HashMap hashMap = new HashMap();
        hashMap.put("startIndex", Integer.valueOf(this.f2733i));
        hashMap.put("recordNum", Integer.valueOf(this.f2734j));
        hashMap.put("type", 4);
        hashMap.put("fuid", Integer.valueOf(this.l.getUserId()));
        addTask(new com.showself.service.f(200037, hashMap), this);
    }

    private void G() {
        this.a.k();
        if (this.m.size() == 0) {
            this.f2729e.b(R.drawable.fish_nothing, "暂时木有推送,快去关注主播吧~", 120);
        } else if (this.c) {
            this.f2729e.d(0);
        } else {
            this.f2729e.d(2);
        }
        s0 s0Var = this.f2735k;
        if (s0Var != null) {
            s0Var.b(this.m);
            return;
        }
        s0 s0Var2 = new s0(this, this.m);
        this.f2735k = s0Var2;
        this.b.setAdapter((ListAdapter) s0Var2);
    }

    public void H(boolean z) {
        int i2 = !z ? 1 : 0;
        if (this.d) {
            return;
        }
        this.d = true;
        HashMap hashMap = new HashMap();
        hashMap.put("push_switch", Integer.valueOf(i2));
        addTask(new com.showself.service.f(200039, hashMap), this);
    }

    public void I(int i2, int i3, int i4) {
        if (this.d) {
            return;
        }
        this.d = true;
        HashMap hashMap = new HashMap();
        hashMap.put("fuid", Integer.valueOf(i2));
        hashMap.put("push", Integer.valueOf(i3));
        hashMap.put("type", Integer.valueOf(i4));
        addTask(new com.showself.service.f(200038, hashMap), this);
    }

    @Override
    public void init() {
        this.l = r0.y(this);
        TextView textView = (TextView) findViewById(R.id.tv_nav_title);
        Button button = (Button) findViewById(R.id.btn_nav_left);
        this.b = (ListView) findViewById(R.id.lv_message_manage);
        textView.setText("推送管理");
        button.setOnClickListener(this);
        this.a = (PullToRefreshView) findViewById(R.id.refresh_activity);
        this.f2732h = (SlipButton) findViewById(R.id.slipbutton_manage_all);
        n nVar = new n(this);
        this.f2729e = nVar;
        View a2 = nVar.a();
        this.f2730f = a2;
        this.b.addFooterView(a2);
        this.f2732h.setOnClickListener(this);
        this.a.setOnHeaderRefreshListener(this);
        this.m = new ArrayList<>();
        s0 s0Var = new s0(this, this.m);
        this.f2735k = s0Var;
        this.b.setAdapter((ListAdapter) s0Var);
        this.b.setOnScrollListener(new a());
        this.f2732h.setOnChangedListener(new b());
    }

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

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_message_manage);
        init();
        this.a.f();
    }

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

    @Override
    public void refresh(Object... objArr) {
        this.d = false;
        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);
            switch (intValue) {
                case 200037:
                    if (intValue2 != 0) {
                        Utils.Z0(this, str);
                        break;
                    } else {
                        int intValue3 = ((Integer) hashMap.get("push_switch")).intValue();
                        ArrayList arrayList = (ArrayList) hashMap.get("members");
                        if (intValue3 == 0) {
                            this.f2732h.setState(false);
                        } else {
                            this.f2732h.setState(true);
                        }
                        if (!this.f2732h.getState()) {
                            arrayList = null;
                            ArrayList<MessageManageInfo> arrayList2 = this.m;
                            if (arrayList2 != null) {
                                arrayList2.clear();
                            }
                        }
                        if (arrayList != null) {
                            if (this.m == null) {
                                this.m = new ArrayList<>();
                            }
                            if (this.f2733i == 0) {
                                this.m.clear();
                            }
                            this.m.addAll(arrayList);
                            if (arrayList.size() < this.f2734j) {
                                this.c = false;
                            } else {
                                this.c = true;
                            }
                            this.f2733i += arrayList.size();
                        } else {
                            this.c = false;
                        }
                        G();
                        break;
                    }
                case 200038:
                    this.f2733i = 0;
                    this.c = true;
                    F();
                    break;
                case 200039:
                    if (intValue2 != 0) {
                        Utils.Z0(this, str);
                        break;
                    } else {
                        this.a.f();
                        break;
                    }
            }
        }
    }
}