|
@@ -5,7 +5,9 @@ import android.app.Activity;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.os.Parcelable;
|
|
import android.os.Parcelable;
|
|
|
|
+import android.text.Editable;
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
|
+import android.text.TextWatcher;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
import android.widget.Button;
|
|
import android.widget.Button;
|
|
import android.widget.EditText;
|
|
import android.widget.EditText;
|
|
@@ -39,6 +41,7 @@ import com.tbruyelle.rxpermissions3.RxPermissions;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Locale;
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.Nullable;
|
|
@@ -67,6 +70,28 @@ public class ImAppealActivity extends BaseMVPActivity<TcActivityImAppealBinding,
|
|
private String type;
|
|
private String type;
|
|
private String memo;
|
|
private String memo;
|
|
|
|
|
|
|
|
+ private TextWatcher mTextWatcher = new TextWatcher() {
|
|
|
|
+ @Override
|
|
|
|
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
|
+ updateWordNumText();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void afterTextChanged(Editable s) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ private void updateWordNumText() {
|
|
|
|
+ int length = et_content.getText().toString().length();
|
|
|
|
+ viewBinding.tvEditNum.setText(String.format(Locale.getDefault(), "%d/200", length));
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
StyleConfig.setTheme(this);
|
|
StyleConfig.setTheme(this);
|
|
@@ -113,8 +138,8 @@ public class ImAppealActivity extends BaseMVPActivity<TcActivityImAppealBinding,
|
|
addPhotoListAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
|
|
addPhotoListAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
|
|
@Override
|
|
@Override
|
|
public void onItemChildClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
|
|
public void onItemChildClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
|
|
- if(position<addPhotoListAdapter.getData().size()){
|
|
|
|
- if(view.getId() == R.id.iv_del){
|
|
|
|
|
|
+ if (position < addPhotoListAdapter.getData().size()) {
|
|
|
|
+ if (view.getId() == R.id.iv_del) {
|
|
addPhotoListAdapter.removeAt(position);
|
|
addPhotoListAdapter.removeAt(position);
|
|
addNewEmpty();
|
|
addNewEmpty();
|
|
return;
|
|
return;
|
|
@@ -141,6 +166,7 @@ public class ImAppealActivity extends BaseMVPActivity<TcActivityImAppealBinding,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ et_content.addTextChangedListener(mTextWatcher);
|
|
}
|
|
}
|
|
|
|
|
|
private void toSelectPic() {
|
|
private void toSelectPic() {
|
|
@@ -281,4 +307,12 @@ public class ImAppealActivity extends BaseMVPActivity<TcActivityImAppealBinding,
|
|
ToastUtil.getInstance().showShort("已收到您的投诉,我们会认真审核并处理");
|
|
ToastUtil.getInstance().showShort("已收到您的投诉,我们会认真审核并处理");
|
|
finish();
|
|
finish();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onDestroy() {
|
|
|
|
+ super.onDestroy();
|
|
|
|
+ if (et_content != null) {
|
|
|
|
+ et_content.removeTextChangedListener(mTextWatcher);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|