整点视频 v3.3.0版本的 MD5 值为:cba0457dc37421eed445b30f92de25d3
以下内容为反编译后的 FeedBackViewModel.java 源代码,内容仅作参考
package com.ys.resemble.ui.mine.feedback;
import android.app.Application;
import android.graphics.Color;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableField;
import androidx.databinding.ObservableList;
import com.baidu.mobads.sdk.internal.bk;
import com.ss.android.socialbase.downloader.setting.DownloadSettingKeys;
import com.wholepoint.wpfilms.R;
import com.ys.resemble.data.AppRepository;
import com.ys.resemble.entity.FeedbackTypeEntry;
import com.ys.resemble.entity.UploadFileEntry;
import com.ys.resemble.ui.toolbar.ToolbarViewModel;
import com.ys.resemble.util.o0000;
import io.reactivex.SingleObserver;
import io.reactivex.disposables.Disposable;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent;
import me.goldze.mvvmhabit.http.BaseResponse;
import me.tatarka.bindingcollectionadapter2.OnItemBind;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
public class FeedBackViewModel extends ToolbarViewModel<AppRepository> {
public ObservableField<String> OooOO0o;
public ObservableField<Boolean> OooOOO;
public ObservableField<String> OooOOO0;
public SingleLiveEvent<Void> OooOOOO;
public ObservableField<Boolean> OooOOOo;
public SingleLiveEvent<String> OooOOo;
public ObservableField<SpannableStringBuilder> OooOOo0;
public boolean OooOOoo;
public me.goldze.mvvmhabit.binding.command.OooO00o OooOo;
public ObservableList<o00Oo0> OooOo0;
public String OooOo00;
public me.tatarka.bindingcollectionadapter2.OooO0OO<o00Oo0> OooOo0O;
public me.goldze.mvvmhabit.binding.command.OooO00o OooOo0o;
public me.goldze.mvvmhabit.binding.command.OooO00o OooOoO;
public me.goldze.mvvmhabit.binding.command.OooO00o OooOoO0;
class OooO00o extends ClickableSpan {
OooO00o() {
}
@Override
public void onClick(@NonNull View view) {
if (me.goldze.mvvmhabit.utils.Oooo000.OooO00o(o0000.o000oOoO())) {
FeedBackViewModel.this.OooOOo.setValue(" http://xl01.com");
} else {
FeedBackViewModel.this.OooOOo.setValue(o0000.o000oOoO());
}
}
@Override
public void updateDrawState(@NonNull TextPaint textPaint) {
textPaint.setColor(Color.parseColor("#365899"));
textPaint.setUnderlineText(false);
}
}
class OooO0O0 implements SingleObserver<BaseResponse<UploadFileEntry>> {
OooO0O0() {
}
@Override
public void onSuccess(BaseResponse<UploadFileEntry> baseResponse) {
if (!baseResponse.isOk() || baseResponse.getResult() == null) {
return;
}
FeedBackViewModel feedBackViewModel = FeedBackViewModel.this;
feedBackViewModel.OooOOoo = false;
feedBackViewModel.OooOo00 = baseResponse.getResult().getFile_name();
me.goldze.mvvmhabit.utils.o000oOoO.OooO0OO("图片上传成功");
}
@Override
public void onError(Throwable th) {
FeedBackViewModel.this.OooOOoo = false;
}
@Override
public void onSubscribe(Disposable disposable) {
FeedBackViewModel.this.OooO0O0(disposable);
}
}
public class OooO0OO implements SingleObserver<BaseResponse<String>> {
OooO0OO() {
}
@Override
public void onSuccess(BaseResponse<String> baseResponse) {
FeedBackViewModel.this.OooO0OO();
me.goldze.mvvmhabit.utils.o000oOoO.OooO0OO(baseResponse.getMessage());
FeedBackViewModel.this.OooO0Oo();
}
@Override
public void onError(Throwable th) {
FeedBackViewModel.this.OooO0OO();
me.goldze.mvvmhabit.utils.o000oOoO.OooO0OO("提交失败");
}
@Override
public void onSubscribe(Disposable disposable) {
FeedBackViewModel.this.OooO0O0(disposable);
}
}
public FeedBackViewModel(@NonNull Application application, AppRepository appRepository) {
super(application, appRepository);
String str;
this.OooOO0o = new ObservableField<>("0/200");
this.OooOOO0 = new ObservableField<>("");
Boolean bool = Boolean.FALSE;
this.OooOOO = new ObservableField<>(bool);
this.OooOOOO = new SingleLiveEvent<>();
this.OooOOOo = new ObservableField<>(bool);
this.OooOOo0 = new ObservableField<>();
this.OooOOo = new SingleLiveEvent<>();
this.OooOOoo = false;
this.OooOo00 = "";
this.OooOo0 = new ObservableArrayList();
this.OooOo0O = me.tatarka.bindingcollectionadapter2.OooO0OO.OooO0Oo(new OnItemBind() {
@Override
public final void onItemBind(me.tatarka.bindingcollectionadapter2.OooO0OO oooO0OO, int i, Object obj) {
o00Oo0 o00oo0 = (o00Oo0) obj;
oooO0OO.OooO0o(12, R.layout.item_feedback_type);
}
});
this.OooOo0o = new me.goldze.mvvmhabit.binding.command.OooO00o(new BindingAction() {
@Override
public final void call() {
FeedBackViewModel.this.OooOOOo();
}
});
this.OooOo = new me.goldze.mvvmhabit.binding.command.OooO00o(new BindingAction() {
@Override
public final void call() {
FeedBackViewModel.this.OooOOo();
}
});
this.OooOoO0 = new me.goldze.mvvmhabit.binding.command.OooO00o(new BindingAction() {
@Override
public final void call() {
FeedBackViewModel.this.OooOo00();
}
});
this.OooOoO = new me.goldze.mvvmhabit.binding.command.OooO00o(new BindingAction() {
@Override
public final void call() {
FeedBackViewModel.OooOo0();
}
});
this.OooO0o0.set("意见反馈");
this.OooO0oO.set(true);
this.OooO0o.set("反馈记录");
if (me.goldze.mvvmhabit.utils.Oooo000.OooO00o(o0000.o000oOoO())) {
str = "如遇无法播放、闪退等问题,请点击: http://xl01.com 下载最新版本。";
} else {
str = "如遇无法播放、闪退等问题,请点击: " + o0000.o000oOoO() + " 下载最新版本。";
}
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(str);
spannableStringBuilder.setSpan(new OooO00o(), 17, str.length() - 8, 33);
this.OooOOo0.set(spannableStringBuilder);
}
public void OooOOo() {
this.OooOOOO.call();
}
public void OooOo00() {
this.OooOOOo.set(Boolean.FALSE);
this.OooOo00 = "";
}
public static void OooOo0() {
}
@Override
public void OooOO0O() {
super.OooOO0O();
startActivity(FeedbackRecordActivity.class);
}
public void OooOo0O(File file) {
this.OooOOoo = true;
((AppRepository) this.OooO00o).getUploadFile(MultipartBody.Part.createFormData("file", file.getName(), RequestBody.create(MediaType.parse("multipart/form-data"), file))).compose(o000oOoO.OooO00o).compose(Oooo0.OooO00o).subscribe(new OooO0O0());
}
public void OooOOOo() {
if (me.goldze.mvvmhabit.utils.Oooo000.OooO00o(this.OooOOO0.get().trim())) {
me.goldze.mvvmhabit.utils.o000oOoO.OooO0OO("请输入内容");
} else if (this.OooOOO0.get().trim().length() < 6) {
me.goldze.mvvmhabit.utils.o000oOoO.OooO0OO("至少输入6个字");
} else if (this.OooOOoo) {
me.goldze.mvvmhabit.utils.o000oOoO.OooO0OO("图片正在上传中...");
} else {
String str = "";
for (int i = 0; i < this.OooOo0.size(); i++) {
if (this.OooOo0.get(i).OooO0Oo.get().booleanValue()) {
str = this.OooOo0.get(i).OooO0OO.getName();
}
}
OooO0oo();
HashMap hashMap = new HashMap();
hashMap.put(DownloadSettingKeys.AhPlans.KEY_AH_PLAN_TYPE, 1);
hashMap.put("content", this.OooOOO0.get());
hashMap.put(bk.l, str);
hashMap.put("imgs", this.OooOo00);
((AppRepository) this.OooO00o).getFeedBackSubmit(hashMap).compose(o000oOoO.OooO00o).compose(Oooo0.OooO00o).subscribe(new OooO0OO());
}
}
public void getType(int i) {
List arrayList = new ArrayList();
if (!me.goldze.mvvmhabit.utils.Oooo000.OooO00o(o0000.OooOo00())) {
arrayList = Arrays.asList(o0000.OooOo00().split(","));
}
if (arrayList.size() > 0) {
ArrayList arrayList2 = new ArrayList();
if (i == 1) {
for (int i2 = 0; i2 < arrayList.size(); i2++) {
if (i2 == 1) {
arrayList2.add(new FeedbackTypeEntry((String) arrayList.get(i2), true));
} else {
arrayList2.add(new FeedbackTypeEntry((String) arrayList.get(i2), false));
}
}
} else if (i == 2) {
for (int i3 = 0; i3 < arrayList.size(); i3++) {
if (i3 == 2) {
arrayList2.add(new FeedbackTypeEntry((String) arrayList.get(i3), true));
} else {
arrayList2.add(new FeedbackTypeEntry((String) arrayList.get(i3), false));
}
}
} else if (i == 3) {
for (int i4 = 0; i4 < arrayList.size(); i4++) {
if (i4 == 3) {
arrayList2.add(new FeedbackTypeEntry((String) arrayList.get(i4), true));
} else {
arrayList2.add(new FeedbackTypeEntry((String) arrayList.get(i4), false));
}
}
} else if (i == 0) {
for (int i5 = 0; i5 < arrayList.size(); i5++) {
if (i5 == 0) {
arrayList2.add(new FeedbackTypeEntry((String) arrayList.get(i5), true));
} else {
arrayList2.add(new FeedbackTypeEntry((String) arrayList.get(i5), false));
}
}
}
this.OooOo0.clear();
for (int i6 = 0; i6 < arrayList2.size(); i6++) {
this.OooOo0.add(new o00Oo0(this, (FeedbackTypeEntry) arrayList2.get(i6), this.OooOo0, i6));
}
}
}
}