导航菜单

页面标题

页面副标题

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

正在查看: 大众借. v4.1.2 应用的 MT4ACT.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.baseapp.AppActivityManager;
import com.base.commonlibrary.base.baserx.RxSchedulers;
import com.base.commonlibrary.utils.RegexUtil;
import com.base.commonlibrary.views.TitleLayout;
import com.google.gson.Gson;
import com.shiliuj.mjyp.BMAG01ACT;
import com.shiliuj.mjyp.app.api.Api;
import com.shiliuj.mjyp.app.base.BaseBindActivity;
import com.shiliuj.mjyp.app.base.RxSubscriber;
import java.util.HashMap;
import okhttp3.MediaType;
import okhttp3.RequestBody;

public class MT4ACT extends BaseBindActivity {

    @BindView(2131296385)
    Button btnGet;

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

    @BindView(2131296746)
    TextView num;

    @BindView(2131296998)
    TitleLayout title;

    protected boolean canLoadMore() {
        return false;
    }

    public int getLayoutId() {
        return 2131492916;
    }

    public void initPresenter() {
    }

    protected void loadMore() {
    }

    protected void refresh() {
    }

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

    public void lambda$initView$0$MT4ACT(View view) {
        String obj = this.content.getText().toString();
        if (!RegexUtil.isEmpty(obj)) {
            remark(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 >= 3) {
            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 remark(String str) {
        HashMap hashMap = new HashMap();
        hashMap.put("remark", str);
        this.mRxManager.add(Api.getDefault().cancelBorrowOrder(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) {
                    MT4ACT mt4act = MT4ACT.this;
                    mt4act.showShortToast(mt4act.getResources().getString(2131689539));
                    AppActivityManager.getAppManager().getActivity(BMAG01ACT.class).onCheckPosition(0);
                    AppActivityManager.getAppManager().returnToActivity(BMAG01ACT.class);
                    MT4ACT.this.finish();
                    return;
                }
                MT4ACT.this.showShortToast(baseResult.getMessage());
            }

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