导航菜单

页面标题

页面副标题

⁡⁡⁡⁡⁡⁡⁡鲸⁡⁡⁡⁡⁡⁡⁡⁡鱼⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡借⁡条⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡ v4.1.2 - MTM10ACT.java 源代码

正在查看: ⁡⁡⁡⁡⁡⁡⁡鲸⁡⁡⁡⁡⁡⁡⁡⁡鱼⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡借⁡条⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡ v4.1.2 应用的 MTM10ACT.java JAVA 源代码文件

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


package com.yuxianghua.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.alibaba.fastjson.support.spring.FastJsonJsonView;
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.yuxianghua.mjyp.app.api.Api;
import com.yuxianghua.mjyp.app.api.AppConfig;
import com.yuxianghua.mjyp.app.base.BaseBindActivity;
import com.yuxianghua.mjyp.app.base.RxSubscriber;
import com.yuxianghua.ui.bean.ConfigBean;
import faceverify.j;
import java.util.HashMap;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import rx.Subscriber;
import yhgjgdf.ijnhjfyd.ikbujfjfnjkif.R;

public class MTM10ACT extends BaseBindActivity {

    @BindView(R.id.btn_get)
    Button btnGet;

    @BindView(R.id.content)
    EditText content;
    private boolean islMaxCount;

    @BindView(R.id.kef)
    TextView kef;

    @BindView(R.id.kef_qq)
    TextView kef_qq;

    @BindView(R.id.kef_wx)
    TextView kef_wx;

    @BindView(R.id.num)
    TextView num;

    @BindView(R.id.time)
    TextView time;

    @BindView(R.id.title)
    TitleLayout title;

    @Override
    protected boolean canLoadMore() {
        return false;
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_feedback;
    }

    @Override
    protected void loadMore() {
    }

    @Override
    protected void refresh() {
    }

    @Override
    public void initPresenter() {
        config();
    }

    @Override
    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(R.string.pls_input_content);
        }
    }

    @OnTextChanged(callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED, value = {R.id.content})
    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(j.KEY_RES_9_CONTENT, str);
        this.mRxManager.add(Api.getDefault().feedBack(RequestBody.create(MediaType.parse(FastJsonJsonView.DEFAULT_CONTENT_TYPE), new Gson().toJson(hashMap))).compose(RxSchedulers.io_main()).subscribe((Subscriber<? super R>) new RxSubscriber<BaseResult>(this.mContext, true) {
            @Override
            public void _onNext(BaseResult baseResult) {
                if (baseResult.getCode() == 200) {
                    MTM10ACT.this.showShortToast(R.string.send_success);
                    MTM10ACT.this.finish();
                } else {
                    String message = baseResult.getMessage();
                    if (RegexUtil.isEmpty(message)) {
                        return;
                    }
                    MTM10ACT.this.showShortToast(message);
                }
            }

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

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

            @Override
            public void _onNext(ConfigBean configBean) {
                String tel = configBean.getTel();
                String time = configBean.getTime();
                String qq = configBean.getQq();
                String wx = configBean.getWx();
                SPUtils.putData(AppConfig.CACHE.TEL, tel);
                if (!RegexUtil.isEmpty(tel)) {
                    MTM10ACT.this.kef.setText(MTM10ACT.this.getResources().getString(R.string.custom_service_tel) + tel);
                }
                if (!RegexUtil.isEmpty(wx)) {
                    MTM10ACT.this.kef_wx.setText(MTM10ACT.this.getResources().getString(R.string.custom_wx) + wx);
                }
                if (!RegexUtil.isEmpty(qq)) {
                    MTM10ACT.this.kef_qq.setText(MTM10ACT.this.getResources().getString(R.string.customm_service_qq) + qq);
                }
                if (RegexUtil.isEmpty(time)) {
                    return;
                }
                MTM10ACT.this.time.setText(MTM10ACT.this.getResources().getString(R.string.service_time) + time);
            }
        }));
    }
}