导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.mifeng.ui.R;
import com.showself.domain.CountryAreaInfo;
import com.showself.domain.LoginResultInfo;
import com.showself.service.g;
import com.showself.utils.Utils;
import com.showself.utils.r0;
import com.showself.utils.u0;
import com.showself.view.ImmersiveStatusBar;
import com.tencent.smtt.sdk.TbsListener;
import com.tencent.smtt.sdk.WebView;
import com.xiaomi.mipush.sdk.Constants;
import java.io.Serializable;
import java.util.HashMap;

public class BindPhoneActivity extends c implements View.OnClickListener {
    private RelativeLayout a;
    private TextView b;
    private View c;
    private CountryAreaInfo d;

    private ImmersiveStatusBar f2595e;

    private EditText f2596f;

    private EditText f2597g;

    private Button f2598h;

    private TextView f2599i;

    private Button f2600j;

    private TextView f2601k;
    private boolean l;
    private boolean m;
    protected int n;
    protected int o;
    private TextView p;
    private LoginResultInfo q;
    private int r;
    private String s;
    private int t;
    private String u = null;
    private Handler v = new a();
    private TextWatcher w = new b();

    class a extends Handler {
        a() {
        }

        @Override
        public void handleMessage(Message message) {
            if (BindPhoneActivity.this.v == null) {
                return;
            }
            try {
                int i2 = message.what;
                BindPhoneActivity bindPhoneActivity = BindPhoneActivity.this;
                if (i2 == bindPhoneActivity.n) {
                    bindPhoneActivity.o--;
                    bindPhoneActivity.z();
                    BindPhoneActivity bindPhoneActivity2 = BindPhoneActivity.this;
                    if (bindPhoneActivity2.o > 0) {
                        sendEmptyMessageDelayed(bindPhoneActivity2.n, 1000L);
                    }
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }

    class b implements TextWatcher {
        b() {
        }

        @Override
        public void afterTextChanged(Editable editable) {
            if (TextUtils.isEmpty(BindPhoneActivity.this.f2596f.getText()) || TextUtils.isEmpty(BindPhoneActivity.this.f2597g.getText())) {
                BindPhoneActivity.this.f2599i.getBackground().setAlpha(TbsListener.ErrorCode.NEEDDOWNLOAD_6);
            } else {
                BindPhoneActivity.this.f2599i.getBackground().setAlpha(WebView.NORMAL_MODE_ALPHA);
            }
        }

        @Override
        public void beforeTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
        }
    }

    private void E() {
        if (this.r == 1) {
            this.s = this.q.getMobile();
            this.t = 4;
        } else {
            this.s = this.f2596f.getText().toString().trim();
            this.t = 1;
        }
        this.u = this.f2597g.getText().toString().trim();
        if (TextUtils.isEmpty(this.s)) {
            Utils.Y0(this, R.string.register_get_pin_num_note);
            return;
        }
        if (TextUtils.isEmpty(this.u)) {
            if (this.t == 1) {
                Utils.Y0(this, R.string.input_code);
                return;
            }
            return;
        }
        if (this.m) {
            return;
        }
        this.m = true;
        Utils.U0(this);
        HashMap hashMap = new HashMap();
        hashMap.put("yz", this.u);
        hashMap.put("type", Integer.valueOf(this.t));
        CountryAreaInfo countryAreaInfo = this.d;
        if (countryAreaInfo == null || countryAreaInfo.getArea() == 86) {
            hashMap.put("mobile", this.s);
        } else {
            hashMap.put("mobile", this.d.getArea() + Constants.ACCEPT_TIME_SEPARATOR_SERVER + this.s);
        }
        addTask(new com.showself.service.f(10035, hashMap), this);
    }

    private void F() {
        if (this.r == 1) {
            this.s = this.q.getMobile();
            this.t = 4;
        } else {
            this.s = this.f2596f.getText().toString().trim();
            this.t = 1;
        }
        if (TextUtils.isEmpty(this.s)) {
            Utils.Y0(this, R.string.register_get_pin_num_note);
            return;
        }
        if (this.m) {
            return;
        }
        this.m = true;
        Utils.V0(this, getString(R.string.getpining), false, false);
        HashMap hashMap = new HashMap();
        hashMap.put("type", Integer.valueOf(this.t));
        if (this.q.getMobilestatus() == 1) {
            hashMap.put("mobile", this.s);
        } else {
            CountryAreaInfo countryAreaInfo = this.d;
            if (countryAreaInfo == null || countryAreaInfo.getArea() == 86) {
                hashMap.put("mobile", this.s);
            } else {
                hashMap.put("mobile", this.d.getArea() + Constants.ACCEPT_TIME_SEPARATOR_SERVER + this.s);
            }
        }
        addTask(new com.showself.service.f(10034, hashMap), this);
    }

    @Override
    public void init() {
        this.q = r0.y(this);
        this.f2601k = (TextView) findViewById(R.id.tv_nav_title);
        this.f2600j = (Button) findViewById(R.id.btn_nav_left);
        this.f2596f = (EditText) findViewById(R.id.et_findpass_account);
        EditText editText = (EditText) findViewById(R.id.et_findpass_pin);
        this.f2597g = editText;
        editText.setInputType(3);
        this.f2598h = (Button) findViewById(R.id.btn_get_pin);
        this.f2599i = (TextView) findViewById(R.id.tv_findpass_getidentify_submit);
        this.b = (TextView) findViewById(R.id.tv_reg_phone_tag);
        this.a = (RelativeLayout) findViewById(R.id.rl_reg_phone_tag);
        this.c = findViewById(R.id.view_area_line);
        this.f2595e = (ImmersiveStatusBar) findViewById(2131298726);
        this.a.setOnClickListener(this);
        if (this.r == 1) {
            this.a.setVisibility(8);
            this.c.setVisibility(8);
            this.f2601k.setText(R.string.remove_bind_phone);
            this.f2596f.setText(this.q.getMobile());
            this.f2596f.setVisibility(8);
            findViewById(R.id.tv_binded_phone).setVisibility(0);
            TextView textView = (TextView) findViewById(R.id.tv_binded_phone_num);
            this.p = textView;
            textView.setText(this.q.getMobile());
            this.p.setVisibility(0);
            this.f2599i.setText(R.string.remove_bind);
        } else {
            this.f2601k.setText(R.string.bind_phone);
            this.f2596f.setHint(R.string.register_get_pin_num_note);
            this.f2596f.setInputType(3);
            this.f2596f.addTextChangedListener(this.w);
            this.f2599i.setText(R.string.ensure);
            findViewById(R.id.rl_warm_prompt).setVisibility(0);
            this.a.setVisibility(0);
            this.c.setVisibility(0);
        }
        this.f2599i.getBackground().setAlpha(TbsListener.ErrorCode.NEEDDOWNLOAD_6);
        this.f2597g.addTextChangedListener(this.w);
        this.f2600j.setOnClickListener(this);
        this.f2598h.setOnClickListener(this);
        this.f2599i.setOnClickListener(this);
        this.l = false;
        this.m = false;
    }

    @Override
    public void onActivityResult(int i2, int i3, Intent intent) {
        super.onActivityResult(i2, i3, intent);
        if (i2 == com.showself.net.e.Q1 && i3 == com.showself.net.e.R1) {
            Serializable serializableExtra = intent.getSerializableExtra("chooseAreaInfo");
            if (serializableExtra instanceof CountryAreaInfo) {
                this.d = (CountryAreaInfo) serializableExtra;
                this.b.setText("+" + this.d.getArea() + "   " + this.d.getAreaName());
                if (TextUtils.isEmpty(this.f2596f.getText().toString())) {
                    this.f2596f.requestFocus();
                }
            }
        }
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_get_pin:
                if (!this.l) {
                    F();
                    break;
                }
                break;
            case R.id.btn_nav_left:
                finish();
                break;
            case R.id.rl_reg_phone_tag:
                startActivityForResult(new Intent((Context) this, (Class<?>) ChooseAreaActivity.class), com.showself.net.e.Q1);
                break;
            case R.id.tv_findpass_getidentify_submit:
                E();
                break;
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.findpass_get_act);
        u0.q(this, null);
        Bundle extras = getIntent().getExtras();
        if (extras != null && extras.containsKey("bindPhoneStatus")) {
            this.r = ((Integer) extras.get("bindPhoneStatus")).intValue();
        }
        init();
        u0.i(this, this.f2595e, R.color.navigationbar_bg, true);
    }

    @Override
    public void refresh(Object... objArr) {
        this.m = false;
        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 (com.showself.net.e.m1 != intValue2) {
                Utils.Z0(this, str);
            } else if (intValue == 10034) {
                this.v.sendEmptyMessage(this.n);
                this.o = 60;
                Utils.Z0(this, str);
            } else if (intValue == 10035) {
                if (this.r == 1) {
                    this.q.setMobilestatus(0);
                } else {
                    this.q.setMobilestatus(1);
                    CountryAreaInfo countryAreaInfo = this.d;
                    if (countryAreaInfo != null && countryAreaInfo.getArea() != 86) {
                        this.s = this.d.getArea() + Constants.ACCEPT_TIME_SEPARATOR_SERVER + this.s;
                    }
                    this.q.setMobile(this.s);
                }
                r0.b(this, this.q);
                finish();
                Utils.Z0(this, str);
            }
        }
        g.i(this);
    }

    protected void z() {
        if (this.o <= 0) {
            this.f2598h.setBackgroundResource(R.drawable.register_pin_button_bg);
            this.f2598h.setTextSize(1, 15.0f);
            this.f2598h.setText(getString(R.string.register_pin_button));
            this.l = false;
            return;
        }
        this.f2598h.setBackgroundResource(R.drawable.register_pin_button_wait_bg);
        this.f2598h.setTextSize(1, 13.0f);
        this.f2598h.setText(this.o + getString(R.string.register_pin_button_wait));
        this.l = true;
    }
}