导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.alipay.sdk.app.PayTask;
import com.android.volley.toolbox.ImageLoader;
import com.mifeng.ui.R;
import com.r.b.g2;
import com.showself.domain.LoginResultInfo;
import com.showself.domain.MineVIP;
import com.showself.domain.VIPDetial;
import com.showself.utils.Utils;
import com.showself.utils.k0;
import com.showself.utils.l;
import com.showself.utils.r0;
import com.showself.view.PullToRefreshView;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class VIPActivity extends com.showself.ui.c implements PullToRefreshView.b {
    private Button a;
    private PullToRefreshView b;
    private boolean c;
    private LoginResultInfo d;

    private ListView f2908e;

    private LinearLayout f2909f;

    private g2 f2911h;

    private TextView f2912i;

    private TextView f2913j;

    private LinearLayout f2914k;
    ImageLoader l;
    com.showself.provider.f m;

    private List<VIPDetial> f2910g = new ArrayList();
    private Handler n = new f();
    private ProgressDialog o = null;

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

        @Override
        public void onClick(View view) {
            VIPActivity.this.finish();
        }
    }

    class b implements Runnable {
        final String a;

        b(String str) {
            this.a = str;
        }

        @Override
        public void run() {
            String pay = new PayTask(VIPActivity.this).pay(URLDecoder.decode(this.a), true);
            Message message = new Message();
            message.what = 1;
            message.obj = pay;
            VIPActivity.this.n.sendMessage(message);
        }
    }

    class c implements View.OnClickListener {
        final String a;
        final int b;

        c(String str, int i2) {
            this.a = str;
            this.b = i2;
        }

        @Override
        public void onClick(View view) {
            VIPActivity.this.D(this.a, this.b);
        }
    }

    class d implements l {
        d() {
        }

        @Override
        public void a(boolean z) {
            if (z) {
                com.showself.utils.c1.e.a(VIPActivity.this);
            }
        }
    }

    class e implements l {
        final int a;

        e(int i2) {
            this.a = i2;
        }

        @Override
        public void a(boolean z) {
            if (z) {
                HashMap hashMap = new HashMap();
                hashMap.put("vid", Integer.valueOf(this.a));
                ?? r0 = VIPActivity.this;
                r0.addTask(new com.showself.service.f(10079, hashMap), r0);
            }
        }
    }

    class f extends Handler {
        f() {
        }

        @Override
        public void handleMessage(Message message) {
            try {
                String str = (String) message.obj;
                if (message.what == 1) {
                    VIPActivity.this.B();
                    String trim = str.substring(str.indexOf("resultStatus={") + 14, str.indexOf("};memo=")).trim();
                    boolean contains = str.contains("success=\"true\"");
                    if ("9000".equals(trim) && contains) {
                        androidx.fragment.app.b bVar = VIPActivity.this;
                        Utils.Z0(bVar, bVar.getString(R.string.recharge_success));
                    } else {
                        androidx.fragment.app.b bVar2 = VIPActivity.this;
                        Utils.Z0(bVar2, bVar2.getString(R.string.recharge_fail));
                    }
                }
                super.handleMessage(message);
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }

    private void C(String str) {
        Utils.Q0(this, getString(R.string.prompt), str, getString(R.string.negative), getResources().getColor(2131099757), getString(R.string.positive), getResources().getColor(2131099758), new d(), true);
    }

    public void D(String str, int i2) {
        Utils.Q0(this, getString(R.string.prompt), str, getString(R.string.negative), getResources().getColor(2131099757), getString(R.string.positive), getResources().getColor(2131099758), new e(i2), true);
    }

    private void E(HashMap<Object, Object> hashMap) {
        this.f2912i.setText((String) hashMap.get("curr_desc"));
        this.f2913j.setText((String) hashMap.get("info"));
        List list = (List) hashMap.get("owns");
        int intValue = ((Integer) hashMap.get("btn_show")).intValue();
        if (list == null || list.size() <= 0) {
            return;
        }
        this.f2914k.removeAllViews();
        int size = list.size();
        for (int i2 = 0; i2 < size; i2++) {
            View inflate = View.inflate(this, R.layout.vip_mine_item, null);
            ImageView imageView = (ImageView) inflate.findViewById(R.id.iv_vip_content_vip_icon);
            TextView textView = (TextView) inflate.findViewById(R.id.tv_vip_content_desc);
            TextView textView2 = (TextView) inflate.findViewById(R.id.tv_vip_btn);
            int vip = ((MineVIP) list.get(i2)).getVip();
            this.l.displayImage(this.m.k(vip, 0), imageView);
            textView.setText(((MineVIP) list.get(i2)).getVdes());
            String alert_des = ((MineVIP) list.get(i2)).getAlert_des();
            if (intValue == 1) {
                textView2.setVisibility(0);
                textView2.setText(((MineVIP) list.get(i2)).getBtn_des());
                textView2.setOnClickListener(new c(alert_des, vip));
            } else if (intValue == 2) {
                textView2.setVisibility(8);
            }
            this.f2914k.addView(inflate);
        }
    }

    private void F(String str) {
        Utils.Q0(this, getString(R.string.recharge_alert), str, null, 0, getString(R.string.positive), getResources().getColor(2131099758), null, true);
    }

    void B() {
        try {
            ProgressDialog progressDialog = this.o;
            if (progressDialog != null) {
                progressDialog.dismiss();
                this.o = null;
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public ProgressDialog G(Context context, CharSequence charSequence, CharSequence charSequence2, boolean z, boolean z2) {
        ProgressDialog progressDialog = new ProgressDialog(context);
        progressDialog.setTitle(charSequence);
        progressDialog.setMessage(charSequence2);
        progressDialog.setIndeterminate(z);
        progressDialog.setCancelable(true);
        progressDialog.show();
        return progressDialog;
    }

    @Override
    public void init() {
        this.l = ImageLoader.getInstance(getApplicationContext());
        this.m = com.showself.provider.f.h();
        ((TextView) findViewById(R.id.tv_nav_title)).setText(getString(R.string.vip_service));
        Button button = (Button) findViewById(R.id.btn_nav_left);
        this.a = button;
        button.setOnClickListener(new a());
        PullToRefreshView pullToRefreshView = (PullToRefreshView) findViewById(R.id.refresh_activity);
        this.b = pullToRefreshView;
        pullToRefreshView.setOnHeaderRefreshListener(this);
        this.f2908e = (ListView) findViewById(R.id.lv_vip_content);
        LinearLayout linearLayout = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.vip_content_header, (ViewGroup) null);
        this.f2909f = linearLayout;
        linearLayout.setVisibility(8);
        this.f2908e.addHeaderView(this.f2909f);
        g2 g2Var = new g2(this, this.f2910g, null);
        this.f2911h = g2Var;
        this.f2908e.setAdapter((ListAdapter) g2Var);
        this.f2912i = (TextView) this.f2909f.findViewById(R.id.tv_vip_desc);
        this.f2913j = (TextView) this.f2909f.findViewById(R.id.tv_vip_info);
        this.f2914k = (LinearLayout) this.f2909f.findViewById(R.id.ll_vip_content_myvip);
        this.d = r0.y(this);
        this.b.f();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.vip_content);
        init();
    }

    @Override
    protected void onDestroy() {
        List<VIPDetial> list = this.f2910g;
        if (list != null) {
            list.clear();
            this.f2910g = null;
        }
        g2 g2Var = this.f2911h;
        if (g2Var != null) {
            g2Var.f();
        }
        super.onDestroy();
    }

    protected void onRestart() {
        super/*android.app.Activity*/.onRestart();
        this.b.f();
    }

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

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

    @Override
    public void p(PullToRefreshView pullToRefreshView) {
        if (this.c) {
            return;
        }
        this.c = true;
        HashMap hashMap = new HashMap();
        hashMap.put("gender", Integer.valueOf(this.d.getGender()));
        addTask(new com.showself.service.f(10078, hashMap), this);
    }

    @Override
    public void refresh(Object... objArr) {
        this.c = false;
        this.b.k();
        Utils.n(this);
        int intValue = ((Integer) objArr[0]).intValue();
        HashMap hashMap = (HashMap) objArr[1];
        if (hashMap != null) {
            Integer num = (Integer) hashMap.get(com.showself.net.e.n1);
            String str = (String) hashMap.get(com.showself.net.e.o1);
            switch (intValue) {
                case 10076:
                    if (num.intValue() != 0) {
                        Utils.Z0(this, str);
                        break;
                    } else {
                        Integer num2 = (Integer) hashMap.get("ret");
                        String str2 = (String) hashMap.get("retmsg");
                        if (num2 != null && num2.intValue() == 0) {
                            new Thread(new b(str2)).start();
                            B();
                            this.o = G(this, null, getString(R.string.paying), false, true);
                            break;
                        } else {
                            F(str2);
                            break;
                        }
                    }
                case 10078:
                    if (num.intValue() != 0) {
                        Utils.Z0(this, str);
                        break;
                    } else {
                        E(hashMap);
                        List list = (List) hashMap.get("vips");
                        if (list != null) {
                            this.f2910g.clear();
                            this.f2911h.d.clear();
                            this.f2910g.addAll(list);
                        }
                        this.f2909f.setVisibility(0);
                        this.f2911h.notifyDataSetChanged();
                        break;
                    }
                case 10079:
                    Utils.Z0(this, str);
                    if (num.intValue() == 0) {
                        this.b.f();
                        break;
                    }
                    break;
                case 10080:
                    if (num.intValue() == 0) {
                        int intValue2 = ((Integer) hashMap.get("type")).intValue();
                        String str3 = (String) hashMap.get("retmsg");
                        int intValue3 = ((Integer) hashMap.get("vip")).intValue();
                        if (intValue2 != 1) {
                            C(str3);
                            break;
                        } else {
                            this.b.f();
                            k0.k().c0(intValue3);
                            Utils.Z0(this, getString(R.string.buy_success));
                            break;
                        }
                    }
                    break;
            }
        }
    }
}