正在查看: 95爱播免登录版 v3.1.9 应用的 AddPhotoCommentActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 95爱播免登录版 v3.1.9 应用的 AddPhotoCommentActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.showself.ui.photo;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.mifeng.ui.R;
import com.showself.net.e;
import com.showself.service.f;
import com.showself.service.g;
import com.showself.ui.ShowSelfApp;
import com.showself.utils.Utils;
import com.showself.utils.r0;
import com.showself.utils.u0;
import com.showself.view.ImmersiveStatusBar;
import java.util.HashMap;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public class AddPhotoCommentActivity extends com.showself.ui.c {
private Button a;
private TextView b;
private Button c;
private ImmersiveStatusBar d;
private EditText f3222e;
private TextView f3223f;
private ImageView f3224g;
private int f3228k;
private int l;
private int m;
private String n;
private int f3225h = 50;
private int f3226i = 0;
private String f3227j = ShowSelfApp.h().getString(R.string.notification_discuss);
private boolean o = false;
private View.OnClickListener p = new a();
private TextWatcher q = new b();
class a implements View.OnClickListener {
a() {
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == 2131296486) {
AddPhotoCommentActivity.this.finish();
} else if (id == 2131296490 && !Utils.o0()) {
AddPhotoCommentActivity.this.D();
}
}
}
class b implements TextWatcher {
private CharSequence a;
private int b;
private int c;
b() {
}
@Override
public void afterTextChanged(Editable editable) {
int length = AddPhotoCommentActivity.this.f3225h - editable.length();
AddPhotoCommentActivity.this.f3223f.setText("" + length);
this.b = AddPhotoCommentActivity.this.f3222e.getSelectionStart();
this.c = AddPhotoCommentActivity.this.f3222e.getSelectionEnd();
if (this.a.length() > AddPhotoCommentActivity.this.f3225h) {
editable.delete(this.b - 1, this.c);
int i2 = this.c;
AddPhotoCommentActivity.this.f3222e.setText(editable);
AddPhotoCommentActivity.this.f3222e.setSelection(i2);
}
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i2, int i3, int i4) {
this.a = charSequence;
}
}
class c implements Runnable {
c() {
}
@Override
public void run() {
((InputMethodManager) AddPhotoCommentActivity.this.getSystemService("input_method")).toggleSoftInput(0, 2);
}
}
public void D() {
String trim = this.f3222e.getText().toString().trim();
if (trim.length() <= 0) {
Utils.Y0(this, R.string.content_cannot_benull);
return;
}
if (trim.length() > this.f3225h) {
Utils.Y0(this, R.string.content_toomuch);
return;
}
if (this.o) {
return;
}
this.o = true;
HashMap hashMap = new HashMap();
hashMap.put("pid", Integer.valueOf(this.f3228k));
hashMap.put("type", Integer.valueOf(this.f3226i));
hashMap.put("fuid", Integer.valueOf(this.l));
hashMap.put("buid", Integer.valueOf(this.m));
hashMap.put("bnickname", this.n);
hashMap.put("auid", Integer.valueOf(r0.y(this).getUserId()));
hashMap.put("anickname", r0.y(this).getUserName());
hashMap.put("note", trim);
addTask(new f(10051, hashMap), this);
}
@Override
public void init() {
this.a = (Button) findViewById(R.id.btn_nav_left);
this.b = (TextView) findViewById(R.id.tv_nav_title);
this.c = (Button) findViewById(R.id.btn_nav_right);
this.d = (ImmersiveStatusBar) findViewById(2131298726);
this.b.setText(this.f3227j);
this.c.setText(R.string.publish_talent);
this.c.setVisibility(0);
this.a.setOnClickListener(this.p);
this.c.setOnClickListener(this.p);
this.f3222e = (EditText) findViewById(R.id.et_share_photo_content);
this.f3223f = (TextView) findViewById(R.id.tv_share_photo_textnum);
this.f3224g = (ImageView) findViewById(R.id.iv_share_photo_clear);
this.f3222e.addTextChangedListener(this.q);
this.f3223f.setText(String.valueOf(this.f3225h));
this.f3224g.setVisibility(8);
this.f3222e.setFocusable(true);
Executors.newSingleThreadScheduledExecutor().schedule(new c(), 200L, TimeUnit.MILLISECONDS);
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.share_photo_act);
u0.q(this, null);
Bundle extras = getIntent().getExtras();
if (extras.containsKey("pid")) {
this.f3228k = extras.getInt("pid");
}
if (extras.containsKey("fuid")) {
this.l = extras.getInt("fuid");
}
if (extras.containsKey("type")) {
this.f3226i = extras.getInt("type");
}
if (extras.containsKey("buid")) {
this.m = extras.getInt("buid");
}
if (extras.containsKey("bnickname")) {
this.n = extras.getString("bnickname");
}
init();
u0.i(this, this.d, R.color.navigationbar_bg, true);
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onStop() {
super.onStop();
}
@Override
public void refresh(Object... objArr) {
this.o = false;
int intValue = ((Integer) objArr[0]).intValue();
HashMap hashMap = (HashMap) objArr[1];
if (hashMap != null && intValue == 10051) {
if (((Integer) hashMap.get(e.n1)).intValue() == 0) {
Utils.Z0(this, String.format("%s" + (this.l == r0.y(this).getUserId() ? getString(R.string.success) : getString(R.string.success)), this.f3227j));
setResult(888);
finish();
} else {
Utils.Z0(this, (String) hashMap.get(e.o1));
}
}
g.i(this);
}
}