[Java] 纯文本查看 复制代码
//
// Decompiled by Jadx (from NP Manager)
//
package com.mobile.shannon.pax.dictionary.sentence;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.camera.camera2.interop.e;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.carlos.voiceline.mylibrary.VoiceLineView;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mobile.shannon.pax.PaxApplication;
import com.mobile.shannon.pax.PaxApplication.a;
import com.mobile.shannon.pax.PaxBaseActivity;
import com.mobile.shannon.pax.R;
import com.mobile.shannon.pax.aigc.r;
import com.mobile.shannon.pax.controllers.ib;
import com.mobile.shannon.pax.controllers.lb;
import com.mobile.shannon.pax.entity.read.ReadMark;
import com.mobile.shannon.pax.entity.user.UserInfo;
import com.mobile.shannon.pax.read.appearance.c;
import com.mobile.shannon.pax.read.readmark.OpenThoughtReplyAdapter;
import com.mobile.shannon.pax.widget.f;
import com.mobile.shannon.pax.widget.getwordtextview.GetWordTextView;
import java.io.File;
import java.util.ArrayList;
import kotlin.jvm.internal.i;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.x;
import kotlinx.coroutines.a0;
import s6.f1;
import w4.d;
import x0.b;
public final class SentenceMultiFunctionAdapter {
/* JADX WARNING: Removed duplicated region for block: B:111:0x03ce */
/* JADX WARNING: Removed duplicated region for block: B:110:0x03cd */
/* JADX WARNING: Removed duplicated region for block: B:144:? A:{SYNTHETIC, RETURN} */
/* JADX WARNING: Removed duplicated region for block: B:122:0x0408 */
/* Code decompiled incorrectly, please refer to instructions dump. */
public final void convert(BaseViewHolder baseViewHolder, Object obj) {
BaseViewHolder baseViewHolder2 = baseViewHolder;
w wVar = (w) obj;
i.f(baseViewHolder2, "helper");
i.f(wVar, "item");
int itemViewType = baseViewHolder.getItemViewType();
int i = 1;
Object obj2;
Context context;
if (itemViewType != 1) {
CharSequence charSequence = "";
d dVar;
TextView textView;
ViewGroup viewGroup;
int intValue;
ImageView imageView;
if (itemViewType == 2) {
obj2 = wVar.b;
dVar = obj2 instanceof d ? (d) obj2 : null;
if (dVar != null) {
TextView textView2;
f fVar;
t tVar;
String str = (String) dVar.c();
CharSequence charSequence2 = str == null ? charSequence : str;
String str2 = (String) dVar.d();
View view = baseViewHolder2.getView(R.id.mCheckBtn);
textView = (TextView) baseViewHolder2.getView(R.id.mCheckBtnTv);
ViewGroup viewGroup2 = (ViewGroup) baseViewHolder2.getView(R.id.mTranslationLayout);
viewGroup = (ViewGroup) baseViewHolder2.getView(R.id.mTranslationLoadingLayout);
TextView textView3 = (TextView) baseViewHolder2.getView(R.id.mTranslationTv);
ViewGroup viewGroup3 = (ViewGroup) baseViewHolder2.getView(R.id.mAnalysisLayout);
TextView textView4 = (TextView) baseViewHolder2.getView(R.id.mAnalysisTv);
context = this.mContext;
ib.a.getClass();
Drawable drawable = ContextCompat.getDrawable(context, ib.i() ? R.drawable.ic_vip_plus_dark : R.drawable.ic_vip_plus_light);
i.c(drawable);
drawable.setBounds(0, 0, 90, 45);
f fVar2 = new f(drawable);
lb.a.getClass();
if (lb.a0()) {
i.e(viewGroup2, "mTranslationLayout");
w3.f.s(viewGroup2, true);
}
if (lb.a0()) {
i.e(view, "setupTranslation$lambda$23");
w3.f.c(view, true);
}
view.setOnClickListener(new b(7, this));
t tVar2 = new t();
t tVar3 = new t();
t tVar4 = new t();
tVar4.element = true;
t tVar5 = tVar4;
TextView textView5 = textView4;
f fVar3 = fVar2;
u uVar = new u(tVar4, textView, this, view, tVar2, tVar3);
v vVar = new v(viewGroup2, viewGroup, textView3, fVar3);
if ((kotlin.text.i.h1(charSequence2) ^ 1) != 0) {
if (lb.a0()) {
if (str2 != null) {
if (!kotlin.text.i.h1(str2)) {
obj2 = null;
if (obj2 != null) {
vVar.invoke(str2);
}
}
}
obj2 = 1;
if (obj2 != null) {
}
}
context = this.mContext;
a0 a0Var = context instanceof PaxBaseActivity ? (PaxBaseActivity) context : null;
if (a0Var != null) {
textView2 = textView5;
fVar = fVar3;
f1.m0(a0Var, null, new r(this, charSequence2, vVar, uVar, viewGroup, tVar2, null), 3);
tVar = new t(viewGroup3, textView2, fVar);
if ((kotlin.text.i.h1(charSequence2) ^ 1) == 0) {
context = this.mContext;
a0 a0Var2 = context instanceof PaxBaseActivity ? (PaxBaseActivity) context : null;
if (a0Var2 != null) {
f1.m0(a0Var2, null, new s(charSequence2, tVar5, tVar, uVar, viewGroup3, tVar3, null), 3);
return;
}
return;
}
return;
}
}
textView2 = textView5;
fVar = fVar3;
tVar = new t(viewGroup3, textView2, fVar);
if ((kotlin.text.i.h1(charSequence2) ^ 1) == 0) {
}
} else {
return;
}
} else if (itemViewType == 3) {
obj2 = wVar.b;
dVar = obj2 instanceof d ? (d) obj2 : null;
if (dVar != null) {
itemViewType = ((Number) dVar.c()).intValue();
intValue = ((Number) dVar.d()).intValue();
textView = (TextView) baseViewHolder2.getView(R.id.mThoughtCountTv);
TextView textView6 = (TextView) baseViewHolder2.getView(R.id.mQuestionCountTv);
i.e(textView, "setupThoughtDivider$lambda$18");
w3.f.c(textView, itemViewType <= 0);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(itemViewType);
stringBuilder.append(com.mobile.shannon.pax.util.d.a() ? " thoughts" : "想法");
textView.setText(stringBuilder.toString());
textView.setOnClickListener(new c(textView, this, textView6, 0));
i.e(textView6, "setupThoughtDivider$lambda$20");
w3.f.c(textView6, intValue <= 0);
StringBuilder stringBuilder2 = new StringBuilder();
stringBuilder2.append(intValue);
stringBuilder2.append(com.mobile.shannon.pax.util.d.a() ? " questions" : "问题");
textView6.setText(stringBuilder2.toString());
textView6.setOnClickListener(new c(textView, this, textView6, 1));
return;
}
return;
} else if (itemViewType == 4) {
obj2 = wVar.b;
ReadMark readMark = obj2 instanceof ReadMark ? (ReadMark) obj2 : null;
if (readMark != null) {
CharSequence valueOf;
int i2;
x xVar = new x();
t tVar6 = new t();
imageView = (ImageView) baseViewHolder2.getView(R.id.mUserIconIv);
i.e(imageView, "setupThought$lambda$3");
w3.f.h(imageView, Integer.valueOf(R.drawable.ic_default_head_icon), readMark.getFigureUrl());
imageView.setOnClickListener(new d(this, readMark, 0));
TextView textView7 = (TextView) baseViewHolder2.getView(R.id.mUserNameTv);
textView7.setText(readMark.getUsername());
textView7.setOnClickListener(new d(this, readMark, 1));
baseViewHolder2.setText(R.id.mCommentTv, readMark.getMarkContent());
intValue = R.id.mLikeCountTv;
if (readMark.getLikeCount() > 0) {
valueOf = String.valueOf(readMark.getLikeCount());
} else {
PaxApplication paxApplication = PaxApplication.a;
valueOf = a.a().getString(R.string.like);
i.e(valueOf, "PaxApplication.sApplicat…string.like\n )");
}
baseViewHolder2.setText(intValue, valueOf);
imageView = (ImageView) baseViewHolder2.getView(R.id.mLikeIv);
imageView.setImageResource(readMark.isLike() ? R.drawable.ic_like_pink : R.drawable.ic_like_gray);
imageView.setOnClickListener(new d(readMark, this));
intValue = R.id.mTimeTv;
Long valueOf2 = Long.valueOf(readMark.getCreateTime());
if (valueOf2 != null) {
charSequence = androidx.activity.result.a.c(valueOf2.longValue(), (long) 1000, "yyyy-MM-dd HH:mm", "millis2String(timestamp * 1000, pattern)");
}
baseViewHolder2.setText(intValue, charSequence);
textView7 = (TextView) baseViewHolder2.getView(R.id.mReplyTv);
PaxApplication paxApplication2 = PaxApplication.a;
textView7.setText(a.a().getString(R.string.reply));
textView7.setOnClickListener(new r(this, readMark, xVar, 5));
textView7 = (TextView) baseViewHolder2.getView(R.id.mDeleteBtn);
lb.a.getClass();
UserInfo userInfo = lb.e;
Object obj3 = (userInfo == null || readMark.getUid() != userInfo.getId()) ? null : 1;
String str3 = "setupThought$lambda$11";
if (obj3 != null) {
i.e(textView7, str3);
w3.f.s(textView7, true);
textView7.setOnClickListener(new r(this, readMark, baseViewHolder2, 6));
} else {
i.e(textView7, str3);
w3.f.c(textView7, true);
}
TextView textView8 = (TextView) baseViewHolder2.getView(R.id.mExpandTv);
String str4 = "setupThought$lambda$13";
if (readMark.getReplyList().size() > 2) {
i.e(textView8, str4);
w3.f.s(textView8, true);
if (tVar6.element) {
context = this.mContext;
i2 = R.string.collapse_replies;
} else {
context = this.mContext;
i2 = R.string.expand_more_replies;
}
textView8.setText(context.getString(i2));
textView8.setOnClickListener(new e(tVar6, textView8, this, xVar, readMark, 0));
} else {
i.e(textView8, str4);
w3.f.c(textView8, true);
}
RecyclerView recyclerView = (RecyclerView) baseViewHolder2.getView(R.id.mReplyList);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this.mContext));
i2 = readMark.getReplyList().size();
if (i2 < 0 || i2 >= 3) {
i = 0;
}
OpenThoughtReplyAdapter openThoughtReplyAdapter = new OpenThoughtReplyAdapter(i != 0 ? readMark.getReplyList() : readMark.getReplyList().subList(0, 2));
xVar.element = openThoughtReplyAdapter;
openThoughtReplyAdapter.a = readMark.getCommentId();
openThoughtReplyAdapter.setOnItemLongClickListener(new e(this, openThoughtReplyAdapter, 9));
openThoughtReplyAdapter.b = new q(readMark);
recyclerView.setAdapter(openThoughtReplyAdapter);
return;
}
return;
} else if (itemViewType == 5) {
ViewGroup viewGroup4 = (ViewGroup) baseViewHolder2.getView(R.id.mRecordBtn);
ViewGroup viewGroup5 = (ViewGroup) baseViewHolder2.getView(R.id.mPressRecordBtn);
VoiceLineView voiceLineView = (VoiceLineView) baseViewHolder2.getView(R.id.mVoiceLineView);
viewGroup = (ViewGroup) baseViewHolder2.getView(R.id.mFollowPlayBtn);
imageView = (ImageView) baseViewHolder2.getView(R.id.mFollowPlayIv1);
File file = new File(this.mContext.getCacheDir(), "temp_follow_read_audio.amr");
j jVar = new j(file, imageView);
t tVar7 = new t();
x xVar2 = new x();
xVar2.element = new g(voiceLineView, tVar7, xVar2);
viewGroup4.setOnTouchListener(new a(this, viewGroup4, viewGroup5, voiceLineView, xVar2, file, tVar7, viewGroup, jVar));
viewGroup.setOnClickListener(new b(jVar, 0));
return;
} else {
return;
}
}
PaxBaseActivity paxBaseActivity = null;
obj2 = wVar.b;
GetWordTextView getWordTextView = (GetWordTextView) baseViewHolder2.getView(R.id.mSentenceTv);
getWordTextView.setText(obj2 instanceof String ? (String) obj2 : null);
ArrayList arrayList = com.mobile.shannon.pax.dictionary.f.a;
context = this.mContext;
if (context instanceof PaxBaseActivity) {
paxBaseActivity = (PaxBaseActivity) context;
}
com.mobile.shannon.pax.dictionary.f.b(getWordTextView, paxBaseActivity, null, null, null, null, null, null, null, null, 1020);
c.b(getWordTextView);
}
}