导航菜单

页面标题

页面副标题

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

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

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


package com.showself.ui.activity;

import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.mifeng.ui.R;
import com.showself.domain.ActivityMessageInfo;
import com.showself.service.g;
import com.showself.utils.Utils;
import com.showself.utils.r0;
import com.tencent.smtt.sdk.WebView;
import java.util.HashMap;

public class LeaveMessageActivity extends com.showself.ui.c {
    private Button a;
    private TextView b;
    private Button c;
    private EditText d;

    private TextView f2978e;

    private ImageView f2979f;

    private String f2981h;

    private int f2982i;

    private int f2983j;

    private int f2984k;
    private String l;
    private ActivityMessageInfo m;

    private int f2980g = 50;
    private boolean n = false;
    private View.OnClickListener o = new a();
    private TextWatcher p = new b();

    class a implements View.OnClickListener {
        a() {
        }

        @Override
        public void onClick(View view) {
            int id = view.getId();
            if (id == 2131296486) {
                LeaveMessageActivity.this.finish();
                return;
            }
            if (id == 2131296490 && !Utils.o0()) {
                if (LeaveMessageActivity.this.m != null) {
                    LeaveMessageActivity.this.G();
                } else {
                    LeaveMessageActivity.this.F();
                }
            }
        }
    }

    class b implements TextWatcher {
        b() {
        }

        @Override
        public void afterTextChanged(Editable editable) {
        }

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

        @Override
        public void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
            int i5;
            int length = LeaveMessageActivity.this.d.getText().toString().length();
            if (length <= LeaveMessageActivity.this.f2980g) {
                i5 = LeaveMessageActivity.this.f2980g - length;
                LeaveMessageActivity.this.f2978e.setTextColor(WebView.NIGHT_MODE_COLOR);
            } else {
                i5 = LeaveMessageActivity.this.f2980g - length;
                LeaveMessageActivity.this.f2978e.setTextColor(-65536);
            }
            LeaveMessageActivity.this.f2978e.setText(String.valueOf(i5));
        }
    }

    public void F() {
        String trim = this.d.getText().toString().trim();
        if (trim.length() <= 0) {
            Utils.Y0(this, R.string.content_cannot_benull);
            return;
        }
        if (trim.length() > this.f2980g) {
            Utils.Y0(this, R.string.content_toomuch);
            return;
        }
        if (this.n) {
            return;
        }
        this.n = true;
        HashMap hashMap = new HashMap();
        hashMap.put("aid", Integer.valueOf(this.f2982i));
        hashMap.put("fuid", Integer.valueOf(this.f2983j));
        hashMap.put("buid", Integer.valueOf(this.f2984k));
        hashMap.put("bnickname", this.l);
        hashMap.put("auid", Integer.valueOf(r0.y(this).getUserId()));
        hashMap.put("anickname", r0.y(this).getUserName());
        hashMap.put("note", trim);
        addTask(new com.showself.service.f(10042, hashMap), this);
    }

    public void G() {
        String trim = this.d.getText().toString().trim();
        if (trim.length() <= 0) {
            Utils.Y0(this, R.string.content_cannot_benull);
            return;
        }
        if (trim.length() > this.f2980g) {
            Utils.Y0(this, R.string.content_toomuch);
            return;
        }
        HashMap hashMap = new HashMap();
        hashMap.put("fuid", Integer.valueOf(this.f2983j));
        hashMap.put("aid", Integer.valueOf(this.f2982i));
        hashMap.put("auid", Integer.valueOf(r0.y(this).getUserId()));
        hashMap.put("anickname", r0.y(this).getUserName());
        hashMap.put("buid", Integer.valueOf(this.m.getaUid()));
        hashMap.put("bnickname", this.m.getaNickname());
        hashMap.put("note", trim);
        addTask(new com.showself.service.f(10042, hashMap), this);
    }

    @Override
    public void init() {
        this.a = (Button) findViewById(R.id.btn_nav_left);
        this.b = (TextView) findViewById(R.id.tv_nav_title);
        Button button = (Button) findViewById(R.id.btn_nav_right);
        this.c = button;
        button.setBackgroundDrawable(null);
        this.f2981h = getString(R.string.reply);
        this.a.setBackgroundResource(R.drawable.naviback_imageitem_image_selecter);
        this.b.setText(this.f2981h);
        this.c.setText(R.string.finish);
        this.c.setVisibility(0);
        this.a.setOnClickListener(this.o);
        this.c.setOnClickListener(this.o);
        this.d = (EditText) findViewById(R.id.et_share_photo_content);
        this.f2978e = (TextView) findViewById(R.id.tv_share_photo_textnum);
        this.f2979f = (ImageView) findViewById(R.id.iv_share_photo_clear);
        this.d.addTextChangedListener(this.p);
        this.f2978e.setText(String.valueOf(this.f2980g));
        this.f2979f.setVisibility(8);
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.share_photo_act);
        Bundle extras = getIntent().getExtras();
        if (extras.containsKey("title")) {
            this.f2981h = extras.getString("title");
        }
        if (extras.containsKey("aid")) {
            this.f2982i = extras.getInt("aid");
        }
        if (extras.containsKey("fuid")) {
            this.f2983j = extras.getInt("fuid");
        }
        if (extras.containsKey("buid")) {
            this.f2984k = extras.getInt("buid");
        }
        if (extras.containsKey("bnickname")) {
            this.l = extras.getString("bnickname");
        }
        if (extras.containsKey("messageInfo")) {
            this.m = (ActivityMessageInfo) extras.getSerializable("messageInfo");
            this.f2981h = getString(R.string.reply);
        }
        init();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    public void refresh(Object... objArr) {
        this.n = false;
        int intValue = ((Integer) objArr[0]).intValue();
        HashMap hashMap = (HashMap) objArr[1];
        if (hashMap != null && intValue == 10042) {
            if (((Integer) hashMap.get(com.showself.net.e.n1)).intValue() == 0) {
                Utils.Z0(this, String.format("%s" + getString(R.string.success), this.f2981h));
                setResult(888);
                finish();
            } else {
                Utils.Z0(this, (String) hashMap.get(com.showself.net.e.o1));
            }
        }
        g.i(this);
    }
}