导航菜单

页面标题

页面副标题

新暖心缘 v8.1.1 - ModifyTwoActivity.java 源代码

正在查看: 新暖心缘 v8.1.1 应用的 ModifyTwoActivity.java JAVA 源代码文件

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


package com.luanxingyuan.app.activity;

import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import butterknife.BindView;
import butterknife.OnClick;
import com.luanxingyuan.app.base.BaseActivity;
import com.luanxingyuan.app.base.BaseResponse;
import com.luanxingyuan.app.util.ParamUtil;
import com.luanxingyuan.app.util.ToastUtil;
import java.util.HashMap;

public class ModifyTwoActivity extends BaseActivity {
    private int mFromType;

    @BindView
    EditText mInputEt;
    private final int NICK = 0;
    private final int WE_CHAT = 1;
    private final int SIGN = 2;
    private final int QQ = 3;

    class a extends r6.a<BaseResponse<Boolean>> {

        final String f6407a;

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

        @Override
        public void onError(x8.e eVar, Exception exc, int i8) {
            super.onError(eVar, exc, i8);
            Intent intent = new Intent();
            intent.putExtra("modify_content", this.f6407a);
            ModifyTwoActivity.this.setResult(-1, intent);
            ModifyTwoActivity.this.finish();
        }

        public void onResponse(BaseResponse<Boolean> baseResponse, int i8) {
            if (baseResponse == null || baseResponse.m_istatus != 1) {
                Intent intent = new Intent();
                intent.putExtra("modify_content", this.f6407a);
                ModifyTwoActivity.this.setResult(-1, intent);
                ModifyTwoActivity.this.finish();
                return;
            }
            if (!baseResponse.m_object.booleanValue()) {
                ToastUtil.showToast(ModifyTwoActivity.this.getApplicationContext(), 2131821069);
                return;
            }
            Intent intent2 = new Intent();
            intent2.putExtra("modify_content", this.f6407a);
            ModifyTwoActivity.this.setResult(-1, intent2);
            ModifyTwoActivity.this.finish();
        }
    }

    private void checkNickName() {
        String trim = this.mInputEt.getText().toString().trim();
        if (TextUtils.isEmpty(trim)) {
            return;
        }
        HashMap hashMap = new HashMap();
        hashMap.put("userId", getUserId());
        hashMap.put("nickName", trim);
        x7.a.h().c(m6.a.Y()).e("param", ParamUtil.getParam(hashMap)).f().c(new a(trim));
    }

    private void finishBack() {
        String trim = this.mInputEt.getText().toString().trim();
        if (!TextUtils.isEmpty(trim)) {
            if (this.mFromType == 0) {
                if (trim.length() > 10) {
                    ToastUtil.showToast(getApplicationContext(), 2131821068);
                    return;
                } else {
                    checkNickName();
                    return;
                }
            }
            Intent intent = new Intent();
            intent.putExtra("modify_content", trim);
            setResult(-1, intent);
            finish();
            return;
        }
        int i8 = this.mFromType;
        if (i8 == 0) {
            ToastUtil.showToast(getApplicationContext(), 2131821185);
            return;
        }
        if (i8 == 1) {
            ToastUtil.showToast(getApplicationContext(), 2131821199);
        } else if (i8 == 2) {
            ToastUtil.showToast(getApplicationContext(), 2131821194);
        } else if (i8 == 3) {
            ToastUtil.showToast(getApplicationContext(), 2131821190);
        }
    }

    private void initText() {
        int i8 = this.mFromType;
        if (i8 == 0) {
            setTitle(2131821067);
            this.mInputEt.setHint(2131821185);
        } else if (i8 == 1) {
            setTitle(2131821439);
            this.mInputEt.setHint(2131821199);
        } else if (i8 == 2) {
            setTitle(2131821326);
            this.mInputEt.setHint(2131821194);
        } else if (i8 == 3) {
            setTitle(2131821237);
            this.mInputEt.setHint(2131821190);
            this.mInputEt.setInputType(2);
        }
        String stringExtra = getIntent().getStringExtra("modify_content");
        if (TextUtils.isEmpty(stringExtra)) {
            return;
        }
        this.mInputEt.setText(stringExtra);
    }

    @Override
    protected View getContentView() {
        return inflate(2131492932);
    }

    @OnClick
    public void onClick(View view) {
        if (view.getId() != 2131296683) {
            return;
        }
        finishBack();
    }

    @Override
    protected void onContentAdded() {
        this.mFromType = getIntent().getIntExtra("modify_two", 0);
        initText();
    }
}