导航菜单

页面标题

页面副标题

大众借. v4.1.2 - MTM10ACT.java 源代码

正在查看: 大众借. v4.1.2 应用的 MTM10ACT.java JAVA 源代码文件

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


package com.shiliuj.ui.activitys;

import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.OnTextChanged;
import com.base.commonlibrary.base.BaseResult;
import com.base.commonlibrary.base.baserx.RxHelper;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.utils.RegexUtil;
import com.base.commonlibrary.utils.SPUtils;
import com.base.commonlibrary.views.TitleLayout;
import com.google.gson.Gson;
import com.shiliuj.mjyp.app.api.Api;
import com.shiliuj.mjyp.app.base.BaseBindActivity;
import com.shiliuj.mjyp.app.base.RxSubscriber;
import com.shiliuj.ui.bean.ConfigBean;
import java.util.HashMap;
import okhttp3.MediaType;
import okhttp3.RequestBody;

public class MTM10ACT extends BaseBindActivity {

    @BindView(2131296385)
    Button btnGet;

    @BindView(2131296444)
    EditText content;
    private boolean islMaxCount;

    @BindView(2131296603)
    TextView kef;

    @BindView(2131296604)
    TextView kef_qq;

    @BindView(2131296607)
    TextView kef_wx;

    @BindView(2131296746)
    TextView num;

    @BindView(2131296963)
    TextView time;

    @BindView(2131296998)
    TitleLayout title;

    protected boolean canLoadMore() {
        return false;
    }

    public int getLayoutId() {
        return 2131492901;
    }

    protected void loadMore() {
    }

    protected void refresh() {
    }

    public void initPresenter() {
        config();
    }

    public void initView(Bundle bundle) {
        this.btnGet.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MTM10ACT.this.lambda$initView$0$MTM10ACT(view);
            }
        });
        this.btnGet.setEnabled(false);
    }

    public void lambda$initView$0$MTM10ACT(View view) {
        String obj = this.content.getText().toString();
        if (!RegexUtil.isEmpty(obj)) {
            feedBack(obj);
        } else {
            showShortToast(2131689938);
        }
    }

    @OnTextChanged(callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED, value = {2131296444})
    public void editTextDetailChange(Editable editable) {
        int length = editable.length();
        if (editable != null && length >= 10) {
            this.btnGet.setEnabled(true);
        } else {
            this.btnGet.setEnabled(false);
        }
        this.num.setText(length + "/200");
        if (length == 199) {
            this.islMaxCount = true;
        }
        if (length == 200 && this.islMaxCount) {
            this.islMaxCount = false;
        }
    }

    protected void feedBack(String str) {
        HashMap hashMap = new HashMap();
        hashMap.put("content", str);
        this.mRxManager.add(Api.getDefault().feedBack(RequestBody.create(MediaType.parse("application/json;charset=UTF-8"), new Gson().toJson(hashMap))).compose(RxSchedulers.io_main()).subscribe(new RxSubscriber<BaseResult>(this.mContext, true) {
            public void _onNext(BaseResult baseResult) {
                if (baseResult.getCode() == 200) {
                    MTM10ACT.this.showShortToast(2131690104);
                    MTM10ACT.this.finish();
                } else {
                    String message = baseResult.getMessage();
                    if (RegexUtil.isEmpty(message)) {
                        return;
                    }
                    MTM10ACT.this.showShortToast(message);
                }
            }

            protected void _onError(String str2) {
                MTM10ACT.this.showShortToast(str2);
            }
        }));
    }

    protected void config() {
        this.mRxManager.add(Api.getDefault().getServiceConfig().compose(RxHelper.handleResult()).subscribe(new RxSubscriber<ConfigBean>(this.mContext, false) {
            protected void _onError(String str) {
            }

            public void _onNext(ConfigBean configBean) {
                String tel = configBean.getTel();
                String time = configBean.getTime();
                String qq = configBean.getQq();
                String wx = configBean.getWx();
                SPUtils.putData("TEL", tel);
                if (!RegexUtil.isEmpty(tel)) {
                    MTM10ACT.this.kef.setText(MTM10ACT.this.getResources().getString(2131689629) + tel);
                }
                if (!RegexUtil.isEmpty(wx)) {
                    MTM10ACT.this.kef_wx.setText(MTM10ACT.this.getResources().getString(2131689630) + wx);
                }
                if (!RegexUtil.isEmpty(qq)) {
                    MTM10ACT.this.kef_qq.setText(MTM10ACT.this.getResources().getString(2131689632) + qq);
                }
                if (RegexUtil.isEmpty(time)) {
                    return;
                }
                MTM10ACT.this.time.setText(MTM10ACT.this.getResources().getString(2131690108) + time);
            }
        }));
    }
}