无痛单词 v1.8.1版本的 MD5 值为:7ae56c6858542fe70230b6be4f1a4b5a
以下内容为反编译后的 DialogExtKt.java 源代码,内容仅作参考
package tech.xiangzi.painless.utils.ext;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.net.wifi.ActivityKt;
import android.net.wifi.ApplicationKt;
import android.net.wifi.ClipboardKt;
import android.net.wifi.IntentsKt;
import android.net.wifi.LogLevel;
import android.net.wifi.LoggerKt;
import android.net.wifi.ResouresKt;
import android.net.wifi.StringKt;
import android.net.wifi.TextViewKt;
import android.net.wifi.ViewKt;
import android.util.TypedValue;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.ColorRes;
import androidx.appcompat.widget.AppCompatEditText;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.core.os.BundleKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleCoroutineScope;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.media3.extractor.text.ttml.TtmlNode;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewbinding.ViewBinding;
import androidx.work.Data;
import androidx.work.WorkManager;
import com.blankj.utilcode.util.h;
import com.drake.brv.BindingAdapter;
import com.drake.brv.DefaultDecoration;
import com.drake.brv.utils.RecyclerUtilsKt;
import com.freddy.silhouette.widget.button.SleTextButton;
import com.freddy.silhouette.widget.layout.SleRelativeLayout;
import com.kongzue.dialogx.dialogs.BottomDialog;
import com.kongzue.dialogx.dialogs.CustomDialog;
import com.kongzue.dialogx.dialogs.MessageDialog;
import com.kongzue.dialogx.dialogs.PopTip;
import com.kongzue.dialogx.interfaces.DialogLifecycleCallback;
import com.kongzue.dialogx.interfaces.OnBindView;
import com.kongzue.dialogx.style.IOSStyle;
import com.kongzue.dialogx.util.TextInfo;
import com.tencent.mm.opensdk.modelmsg.SendAuth;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.weigan.loopview.LoopView;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.ResultKt;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.math.MathKt;
import kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import tech.xiangzi.painless.App;
import tech.xiangzi.painless.R;
import tech.xiangzi.painless.data.ConstantKt;
import tech.xiangzi.painless.data.EventType;
import tech.xiangzi.painless.data.local.table.CustomDictWithWords;
import tech.xiangzi.painless.data.remote.model.DictTagBean;
import tech.xiangzi.painless.data.remote.model.UserBean;
import tech.xiangzi.painless.data.remote.request.Login;
import tech.xiangzi.painless.databinding.DialogAppPrivacyBinding;
import tech.xiangzi.painless.databinding.DialogAppRateBinding;
import tech.xiangzi.painless.databinding.DialogDictTagBinding;
import tech.xiangzi.painless.databinding.DialogImportDictBinding;
import tech.xiangzi.painless.databinding.DialogLogOutBinding;
import tech.xiangzi.painless.databinding.DialogLoginBinding;
import tech.xiangzi.painless.databinding.DialogNewWord100Binding;
import tech.xiangzi.painless.databinding.DialogReportBinding;
import tech.xiangzi.painless.databinding.DialogWheelPickerBinding;
import tech.xiangzi.painless.databinding.ListItemCustomDictBinding;
import tech.xiangzi.painless.databinding.ListItemDictTagBinding;
import tech.xiangzi.painless.databinding.PopTipCustomBinding;
import tech.xiangzi.painless.ui.activity.CustomDictDetailActivity;
import tech.xiangzi.painless.utils.CacheUtil;
import tech.xiangzi.painless.utils.MarketUtilKt;
import tech.xiangzi.painless.utils.bus.FlowBus;
import tech.xiangzi.painless.utils.spannable.IsClickedState;
import tech.xiangzi.painless.utils.spannable.SpanDsl;
import tech.xiangzi.painless.utils.spannable.SpannableXKt;
import tech.xiangzi.painless.vm.CustomDictViewModel;
import tech.xiangzi.painless.vm.UserViewModel;
import tech.xiangzi.painless.work.InitCurrentDictWorker;
@Metadata(d1 = {"\u0000\u0084\u0001\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0002\b\u000e\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\u001a\u001f\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u00012\u0006\u0010\u0003\u001a\u00020\u0004H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010\u0005\u001a,\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u000b2\b\b\u0003\u0010\f\u001a\u00020\u000b2\b\b\u0002\u0010\r\u001a\u00020\u000e\u001a\u0006\u0010\u000f\u001a\u00020\u0010\u001aP\u0010\u0011\u001a\u00020\u00102\u0006\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0003\u001a\u00020\u000428\u0010\u0014\u001a4\u0012\u0013\u0012\u00110\u0016¢\u0006\f\b\u0017\u0012\b\b\u0018\u0012\u0004\b\b(\u0019\u0012\u0013\u0012\u00110\u0016¢\u0006\f\b\u0017\u0012\b\b\u0018\u0012\u0004\b\b(\u0018\u0012\u0004\u0012\u00020\u0010\u0018\u00010\u0015\u001a>\u0010\u001a\u001a\u00020\u001026\u0010\u001b\u001a2\u0012\u0013\u0012\u00110\u0016¢\u0006\f\b\u0017\u0012\b\b\u0018\u0012\u0004\b\b(\u001c\u0012\u0013\u0012\u00110\u0016¢\u0006\f\b\u0017\u0012\b\b\u0018\u0012\u0004\b\b(\u001d\u0012\u0004\u0012\u00020\u00100\u0015\u001a\"\u0010\u001e\u001a\u00020\u00102\u0006\u0010\u001f\u001a\u00020\u00162\b\b\u0002\u0010 \u001a\u00020\u000e2\b\b\u0002\u0010!\u001a\u00020\u000b\u001a?\u0010\"\u001a\u00020\u00102\f\u0010#\u001a\b\u0012\u0004\u0012\u00020\u00160\u00012\u0006\u0010$\u001a\u00020\u000b2!\u0010%\u001a\u001d\u0012\u0013\u0012\u00110\u000b¢\u0006\f\b\u0017\u0012\b\b\u0018\u0012\u0004\b\b('\u0012\u0004\u0012\u00020\u00100&\u001a\n\u0010(\u001a\u00020\u0010*\u00020)\u001a\n\u0010*\u001a\u00020\u0010*\u00020)\u001an\u0010+\u001a\u00020\u0010*\u00020,2\b\b\u0002\u0010-\u001a\u00020\u00162\n\b\u0002\u0010.\u001a\u0004\u0018\u00010\u00162\b\b\u0002\u0010/\u001a\u00020\u00162\u0016\b\u0002\u00100\u001a\u0010\u0012\u0004\u0012\u000201\u0012\u0004\u0012\u00020\u0010\u0018\u00010&2\b\b\u0002\u00102\u001a\u00020\u00162\u0016\b\u0002\u00103\u001a\u0010\u0012\u0004\u0012\u000201\u0012\u0004\u0012\u00020\u0010\u0018\u00010&2\b\b\u0002\u00104\u001a\u00020\u000e\u001ax\u0010+\u001a\u00020\u0010*\u00020)2\b\b\u0002\u0010-\u001a\u00020\u00162\n\b\u0002\u0010.\u001a\u0004\u0018\u00010\u00162\b\b\u0002\u0010/\u001a\u00020\u00162\u0016\b\u0002\u00100\u001a\u0010\u0012\u0004\u0012\u000201\u0012\u0004\u0012\u00020\u0010\u0018\u00010&2\b\b\u0002\u00102\u001a\u00020\u00162\u0016\b\u0002\u00103\u001a\u0010\u0012\u0004\u0012\u000201\u0012\u0004\u0012\u00020\u0010\u0018\u00010&2\b\b\u0002\u00104\u001a\u00020\u000e2\b\b\u0002\u00105\u001a\u00020\u000e\u001a\u001a\u00106\u001a\u00020\u0010*\u00020)2\u0006\u00107\u001a\u0002082\u0006\u0010\u0003\u001a\u00020\u0004\u001a.\u00109\u001a\u00020\u0010*\u00020)2\u0006\u0010:\u001a\u0002082\u0006\u0010;\u001a\u00020<2\b\b\u0002\u0010=\u001a\u00020\u000e2\b\b\u0002\u0010>\u001a\u00020\u000e\u001a\u0012\u0010?\u001a\u00020\u0010*\u00020)2\u0006\u00107\u001a\u000208\u001a4\u0010@\u001a\u00020\u0010*\u00020,2\f\u0010A\u001a\b\u0012\u0004\u0012\u00020\u00100B2\f\u0010C\u001a\b\u0012\u0004\u0012\u00020\u00100B2\f\u0010D\u001a\b\u0012\u0004\u0012\u00020\u00100B\u001a\n\u0010E\u001a\u00020\u0010*\u00020)\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006F"}, d2 = {"getAllDictTagInfo", "", "Ltech/xiangzi/painless/data/remote/model/DictTagBean;", "customDictViewModel", "Ltech/xiangzi/painless/vm/CustomDictViewModel;", "(Ltech/xiangzi/painless/vm/CustomDictViewModel;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getTextInfo", "Lcom/kongzue/dialogx/util/TextInfo;", "context", "Landroid/content/Context;", "size", "", "color", TtmlNode.BOLD, "", "showFeedbackDialog", "", "showImportDictDialog", "viewLifecycleScope", "Landroidx/lifecycle/LifecycleCoroutineScope;", "openImportCallback", "Lkotlin/Function2;", "", "Lkotlin/ParameterName;", "name", "tag", "showReportDialog", "reportCallback", "report", "contact", "showTip", "msg", "isError", "second", "showWheelPickerDialog", "items", "initValue", "callback", "Lkotlin/Function1;", "selectedItem", "beforeRate", "Landroidx/fragment/app/FragmentActivity;", "showAppRateDialog", "showDialog", "Landroidx/fragment/app/Fragment;", com.alipay.sdk.m.x.d.f1475v, "message", "textPositive", "positiveListener", "Lcom/kongzue/dialogx/dialogs/MessageDialog;", "textNegative", "negativeListener", "cancelable", "important", "showDictTagDialog", "userViewModel", "Ltech/xiangzi/painless/vm/UserViewModel;", "showLoginDialog", "viewModel", "api", "Lcom/tencent/mm/opensdk/openapi/IWXAPI;", "isFromBuy", "isUserClickLogin", "showLogoutDialog", "showNewWord100Dialog", "toPay", "Lkotlin/Function0;", "show", "dismiss", "showPrivacyDialog", "app_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
@SourceDebugExtension({"SMAP\nDialogExt.kt\nKotlin\n*S Kotlin\n*F\n+ 1 DialogExt.kt\ntech/xiangzi/painless/utils/ext/DialogExtKt\n+ 2 Activity.kt\ncom/dylanc/longan/ActivityKt\n+ 3 Logger.kt\ncom/dylanc/longan/LoggerKt\n+ 4 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 5 Screen.kt\ncom/dylanc/longan/ScreenKt\n+ 6 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,1147:1\n160#2:1148\n160#2:1149\n160#2:1150\n160#2:1151\n92#3,2:1152\n57#3,2:1154\n92#3,2:1157\n57#3,2:1159\n1#4:1156\n1#4:1161\n29#5:1162\n1549#6:1163\n1620#6,3:1164\n*S KotlinDebug\n*F\n+ 1 DialogExt.kt\ntech/xiangzi/painless/utils/ext/DialogExtKt\n*L\n167#1:1148\n168#1:1149\n171#1:1150\n176#1:1151\n229#1:1152,2\n229#1:1154,2\n385#1:1157,2\n385#1:1159,2\n229#1:1156\n385#1:1161\n1093#1:1162\n1100#1:1163\n1100#1:1164,3\n*E\n"})
public final class DialogExtKt {
public static final void beforeRate(@NotNull FragmentActivity fragmentActivity) {
StackTraceElement it;
String simpleClassName;
Intrinsics.checkNotNullParameter(fragmentActivity, "<this>");
CacheUtil cacheUtil = CacheUtil.INSTANCE;
int i = 0;
if (Math.abs(h.a(86400000, cacheUtil.getLastReviewRequestDate())) > 30) {
cacheUtil.setFeedbacked(false);
cacheUtil.setRequestNum(0);
}
String str = "评分弹框弹窗条件判断 isFeedbacked: " + cacheUtil.isFeedbacked() + " requestNum:" + cacheUtil.getRequestNum();
int m48getINFOKfHOVCA = LogLevel.INSTANCE.m48getINFOKfHOVCA();
StackTraceElement[] D = androidx.recyclerview.widget.a.D("currentThread().stackTrace");
int length = D.length;
while (true) {
if (i < length) {
it = D[i];
Intrinsics.checkNotNullExpressionValue(it, "it");
if (!LoggerKt.isIgnorable(it)) {
break;
} else {
i++;
}
} else {
it = null;
break;
}
}
if (it == null) {
simpleClassName = null;
} else {
simpleClassName = LoggerKt.getSimpleClassName(it);
}
if (simpleClassName == null) {
simpleClassName = "";
}
LoggerKt.m51logIBjOjVg(m48getINFOKfHOVCA, simpleClassName, str, null);
if (!cacheUtil.isFeedbacked() && cacheUtil.getRequestNum() < 3) {
showAppRateDialog(fragmentActivity);
}
}
public static final Object getAllDictTagInfo(CustomDictViewModel customDictViewModel, Continuation<? super List<DictTagBean>> continuation) {
DialogExtKt$getAllDictTagInfo$1 dialogExtKt$getAllDictTagInfo$1;
int i;
int collectionSizeOrDefault;
List<DictTagBean> item;
if (continuation instanceof DialogExtKt$getAllDictTagInfo$1) {
dialogExtKt$getAllDictTagInfo$1 = (DialogExtKt$getAllDictTagInfo$1) continuation;
int i2 = dialogExtKt$getAllDictTagInfo$1.label;
if ((i2 & Integer.MIN_VALUE) != 0) {
dialogExtKt$getAllDictTagInfo$1.label = i2 - Integer.MIN_VALUE;
Object obj = dialogExtKt$getAllDictTagInfo$1.result;
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
i = dialogExtKt$getAllDictTagInfo$1.label;
if (i != 0) {
ResultKt.throwOnFailure(obj);
dialogExtKt$getAllDictTagInfo$1.label = 1;
obj = customDictViewModel.getAllCustomDict(dialogExtKt$getAllDictTagInfo$1);
if (obj == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
Iterable<CustomDictWithWords> iterable = (Iterable) obj;
collectionSizeOrDefault = CollectionsKt__IterablesKt.collectionSizeOrDefault(iterable, 10);
ArrayList arrayList = new ArrayList(collectionSizeOrDefault);
for (CustomDictWithWords customDictWithWords : iterable) {
arrayList.add(new DictTagBean(customDictWithWords.getWordbook().getTag(), customDictWithWords.getWordbook().getName(), Intrinsics.areEqual(CacheUtil.INSTANCE.getCurrentDictTagNew(), customDictWithWords.getWordbook().getTag()), customDictWithWords.getWords().size()));
}
List mutableList = CollectionsKt.toMutableList((Collection) arrayList);
item = CacheUtil.INSTANCE.getDictTagList().getItem();
if (item != null) {
mutableList.addAll(item);
}
return mutableList;
}
}
dialogExtKt$getAllDictTagInfo$1 = new DialogExtKt$getAllDictTagInfo$1(continuation);
Object obj2 = dialogExtKt$getAllDictTagInfo$1.result;
Object coroutine_suspended2 = IntrinsicsKt.getCOROUTINE_SUSPENDED();
i = dialogExtKt$getAllDictTagInfo$1.label;
if (i != 0) {
}
Iterable<CustomDictWithWords> iterable2 = (Iterable) obj2;
collectionSizeOrDefault = CollectionsKt__IterablesKt.collectionSizeOrDefault(iterable2, 10);
ArrayList arrayList2 = new ArrayList(collectionSizeOrDefault);
while (r7.hasNext()) {
}
List mutableList2 = CollectionsKt.toMutableList((Collection) arrayList2);
item = CacheUtil.INSTANCE.getDictTagList().getItem();
if (item != null) {
}
return mutableList2;
}
@NotNull
public static final TextInfo getTextInfo(@NotNull Context context, int i, @ColorRes int i2, boolean z2) {
Intrinsics.checkNotNullParameter(context, "context");
TextInfo textInfo = new TextInfo();
textInfo.setFontSize(i);
textInfo.setFontSizeUnit(TextInfo.FONT_SIZE_UNIT.SP);
textInfo.setFontColor(ResouresKt.getCompatColor(context, i2));
textInfo.setBold(z2);
return textInfo;
}
public static TextInfo getTextInfo$default(Context context, int i, int i2, boolean z2, int i3, Object obj) {
if ((i3 & 2) != 0) {
i = 16;
}
if ((i3 & 4) != 0) {
i2 = R.color.colorTheme;
}
if ((i3 & 8) != 0) {
z2 = false;
}
return getTextInfo(context, i, i2, z2);
}
public static final void showAppRateDialog(@NotNull final FragmentActivity fragmentActivity) {
Intrinsics.checkNotNullParameter(fragmentActivity, "<this>");
CustomDialog.build().setCustomView(new OnBindView<CustomDialog>() {
{
super(R.layout.dialog_app_rate);
}
@Override
public void onBind(@Nullable final CustomDialog dialog, @Nullable View v2) {
CacheUtil cacheUtil = CacheUtil.INSTANCE;
cacheUtil.setLastReviewRequestDate(System.currentTimeMillis());
cacheUtil.setRequestNum(cacheUtil.getRequestNum() + 1);
if (v2 != null) {
final FragmentActivity fragmentActivity2 = FragmentActivity.this;
DialogAppRateBinding bind = DialogAppRateBinding.bind(v2);
bind.f5504a.setText("😤 意见反馈");
bind.f5505b.setText("👍🏻 五星好评");
AppCompatImageView appCompatImageView = bind.f5506c;
Intrinsics.checkNotNullExpressionValue(appCompatImageView, "it.ivClose");
ViewKt.doOnClick$default((View) appCompatImageView, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
CustomDialog customDialog = CustomDialog.this;
if (customDialog != null) {
customDialog.dismiss();
}
}
}, 2, (Object) null);
SleTextButton sleTextButton = bind.f5504a;
Intrinsics.checkNotNullExpressionValue(sleTextButton, "it.btnFeedback");
ViewKt.doOnClick$default((View) sleTextButton, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
DialogExtKt.showFeedbackDialog();
CacheUtil.INSTANCE.setFeedbacked(true);
CustomDialog customDialog = CustomDialog.this;
if (customDialog != null) {
customDialog.dismiss();
}
}
}, 2, (Object) null);
SleTextButton sleTextButton2 = bind.f5505b;
Intrinsics.checkNotNullExpressionValue(sleTextButton2, "it.btnRate");
ViewKt.doOnClick$default((View) sleTextButton2, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
FragmentActivity fragmentActivity3 = FragmentActivity.this;
String packageName = fragmentActivity3.getPackageName();
Intrinsics.checkNotNullExpressionValue(packageName, "packageName");
MarketUtilKt.launchAppMarket(fragmentActivity3, packageName);
CacheUtil.INSTANCE.setFeedbacked(true);
CustomDialog customDialog = dialog;
if (customDialog != null) {
customDialog.dismiss();
}
}
}, 2, (Object) null);
}
}
}).setMaskColor(ResouresKt.getCompatColor(fragmentActivity, R.color.black30)).show();
}
public static final void showDialog(@NotNull Fragment fragment, @NotNull String title, @Nullable String str, @NotNull String textPositive, @Nullable Function1<? super MessageDialog, Unit> function1, @NotNull String textNegative, @Nullable Function1<? super MessageDialog, Unit> function12, boolean z2) {
Intrinsics.checkNotNullParameter(fragment, "<this>");
Intrinsics.checkNotNullParameter(title, "title");
Intrinsics.checkNotNullParameter(textPositive, "textPositive");
Intrinsics.checkNotNullParameter(textNegative, "textNegative");
Context context = fragment.getContext();
if (context != null) {
final MessageDialog build = MessageDialog.build();
build.setTitleTextInfo(getTextInfo$default(context, 0, R.color.colorFore, true, 2, null));
build.setMessageTextInfo(getTextInfo$default(context, 13, R.color.colorFore, false, 8, null));
build.setOkButton(textPositive);
build.setOkTextInfo(getTextInfo$default(context, 0, 0, true, 6, null));
build.setCancelButton(textNegative);
build.setCancelTextInfo(getTextInfo$default(context, 0, 0, false, 14, null));
build.setDialogLifecycleCallback(new DialogLifecycleCallback<MessageDialog>() {
@Override
@NotNull
public Lifecycle getLifecycle() {
if (super.getLifecycle().getState() == Lifecycle.State.DESTROYED) {
MessageDialog.this.dismiss();
}
Lifecycle lifecycle = super.getLifecycle();
Intrinsics.checkNotNullExpressionValue(lifecycle, "super.lifecycle");
return lifecycle;
}
});
build.setTitle(title).setMessage(str).setOkButton(new d(2, function1)).setCancelButton(new d(3, function12)).setBackgroundColor(ResouresKt.getCompatColor(fragment, R.color.colorBackgroundComponent)).setCancelable(z2).show();
}
}
public static final void showDialog(@NotNull FragmentActivity fragmentActivity, @NotNull String title, @Nullable String str, @NotNull String textPositive, @Nullable Function1<? super MessageDialog, Unit> function1, @NotNull String textNegative, @Nullable Function1<? super MessageDialog, Unit> function12, boolean z2, boolean z3) {
Intrinsics.checkNotNullParameter(fragmentActivity, "<this>");
Intrinsics.checkNotNullParameter(title, "title");
Intrinsics.checkNotNullParameter(textPositive, "textPositive");
Intrinsics.checkNotNullParameter(textNegative, "textNegative");
final MessageDialog build = MessageDialog.build();
build.setTitleTextInfo(getTextInfo(fragmentActivity, 17, R.color.colorFore, true));
build.setMessageTextInfo(getTextInfo$default(fragmentActivity, 14, R.color.colorFore, false, 8, null));
build.setOkButton(textPositive);
build.setOkTextInfo(getTextInfo$default(fragmentActivity, 0, z3 ? R.color.colorThemeEmphasis : R.color.colorTheme, true, 2, null));
build.setCancelButton(textNegative);
build.setCancelTextInfo(getTextInfo$default(fragmentActivity, 0, 0, false, 14, null));
build.setDialogLifecycleCallback(new DialogLifecycleCallback<MessageDialog>() {
@Override
@NotNull
public Lifecycle getLifecycle() {
if (super.getLifecycle().getState() == Lifecycle.State.DESTROYED) {
MessageDialog.this.dismiss();
}
Lifecycle lifecycle = super.getLifecycle();
Intrinsics.checkNotNullExpressionValue(lifecycle, "super.lifecycle");
return lifecycle;
}
});
build.setTitle(title).setMessage(str).setOkButton(new d(0, function1)).setCancelButton(new d(1, function12)).setBackgroundColor(ResouresKt.getCompatColor(fragmentActivity, R.color.colorBackgroundComponent)).setCancelable(z2).show();
}
public static void showDialog$default(Fragment fragment, String str, String str2, String str3, Function1 function1, String str4, Function1 function12, boolean z2, int i, Object obj) {
if ((i & 1) != 0) {
str = "提示!";
}
String str5 = (i & 2) != 0 ? null : str2;
if ((i & 4) != 0) {
str3 = "确定";
}
String str6 = str3;
Function1 function13 = (i & 8) != 0 ? null : function1;
if ((i & 16) != 0) {
str4 = "取消";
}
showDialog(fragment, str, str5, str6, function13, str4, (i & 32) == 0 ? function12 : null, (i & 64) != 0 ? true : z2);
}
public static final boolean showDialog$lambda$4$lambda$2(Function1 function1, MessageDialog dialog, View view) {
if (function1 == null) {
return false;
}
Intrinsics.checkNotNullExpressionValue(dialog, "dialog");
function1.invoke(dialog);
return false;
}
public static final boolean showDialog$lambda$4$lambda$3(Function1 function1, MessageDialog dialog, View view) {
Unit unit;
if (function1 != null) {
Intrinsics.checkNotNullExpressionValue(dialog, "dialog");
function1.invoke(dialog);
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit != null) {
return false;
}
dialog.dismiss();
return false;
}
public static final boolean showDialog$lambda$6(Function1 function1, MessageDialog dialog, View view) {
if (function1 == null) {
return false;
}
Intrinsics.checkNotNullExpressionValue(dialog, "dialog");
function1.invoke(dialog);
return false;
}
public static final boolean showDialog$lambda$7(Function1 function1, MessageDialog dialog, View view) {
Unit unit;
if (function1 != null) {
Intrinsics.checkNotNullExpressionValue(dialog, "dialog");
function1.invoke(dialog);
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit != null) {
return false;
}
dialog.dismiss();
return false;
}
public static final void showDictTagDialog(@NotNull final FragmentActivity fragmentActivity, @NotNull final UserViewModel userViewModel, @NotNull final CustomDictViewModel customDictViewModel) {
Intrinsics.checkNotNullParameter(fragmentActivity, "<this>");
Intrinsics.checkNotNullParameter(userViewModel, "userViewModel");
Intrinsics.checkNotNullParameter(customDictViewModel, "customDictViewModel");
BottomDialog.build().setCustomView(new OnBindView<BottomDialog>() {
{
super(R.layout.dialog_dict_tag);
}
@Override
public void onBind(@Nullable final BottomDialog dialog, @Nullable View v2) {
if (v2 != null) {
final FragmentActivity fragmentActivity2 = FragmentActivity.this;
final UserViewModel userViewModel2 = userViewModel;
CustomDictViewModel customDictViewModel2 = customDictViewModel;
DialogDictTagBinding bind = DialogDictTagBinding.bind(v2);
AppCompatImageView appCompatImageView = bind.f5516a;
Intrinsics.checkNotNullExpressionValue(appCompatImageView, "dictTagBinding.closeBtn");
ViewKt.doOnClick$default((View) appCompatImageView, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
BottomDialog bottomDialog = BottomDialog.this;
if (bottomDialog != null) {
bottomDialog.dismiss();
}
}
}, 2, (Object) null);
RecyclerView recyclerView = bind.f5517b;
Intrinsics.checkNotNullExpressionValue(recyclerView, "dictTagBinding.dictTagList");
RecyclerUtilsKt.setup(RecyclerUtilsKt.dividerSpace$default(RecyclerUtilsKt.linear$default(recyclerView, 0, false, false, false, 15, null), MathKt.roundToInt(TypedValue.applyDimension(1, 10, Resources.getSystem().getDisplayMetrics())), null, 2, null), new Function2<BindingAdapter, RecyclerView, Unit>() {
{
super(2);
}
@Override
public Unit mo1invoke(BindingAdapter bindingAdapter, RecyclerView recyclerView2) {
invoke2(bindingAdapter, recyclerView2);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull final BindingAdapter bindingAdapter, @NotNull RecyclerView recyclerView2) {
boolean C = androidx.recyclerview.widget.a.C(bindingAdapter, "$this$setup", recyclerView2, "it", DictTagBean.class);
final int i = R.layout.list_item_dict_tag;
if (C) {
bindingAdapter.addInterfaceType(DictTagBean.class, new Function2<Object, Integer, Integer>() {
{
super(2);
}
@NotNull
public final Integer invoke(@NotNull Object addInterfaceType, int i2) {
Intrinsics.checkNotNullParameter(addInterfaceType, "$this$addInterfaceType");
return Integer.valueOf(i);
}
@Override
public Integer mo1invoke(Object obj, Integer num) {
return invoke(obj, num.intValue());
}
});
} else {
bindingAdapter.getTypePool().put(DictTagBean.class, new Function2<Object, Integer, Integer>() {
{
super(2);
}
@NotNull
public final Integer invoke(@NotNull Object obj, int i2) {
Intrinsics.checkNotNullParameter(obj, "$this$null");
return Integer.valueOf(i);
}
@Override
public Integer mo1invoke(Object obj, Integer num) {
return invoke(obj, num.intValue());
}
});
}
bindingAdapter.onBind(new Function1<BindingAdapter.BindingViewHolder, Unit>() {
@Override
public Unit invoke(BindingAdapter.BindingViewHolder bindingViewHolder) {
invoke2(bindingViewHolder);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull BindingAdapter.BindingViewHolder onBind) {
ListItemDictTagBinding listItemDictTagBinding;
Intrinsics.checkNotNullParameter(onBind, "$this$onBind");
DictTagBean dictTagBean = (DictTagBean) onBind.getModel();
if (onBind.getViewBinding() == null) {
Object invoke = ListItemDictTagBinding.class.getMethod("bind", View.class).invoke(null, onBind.itemView);
if (invoke == null) {
throw new NullPointerException("null cannot be cast to non-null type tech.xiangzi.painless.databinding.ListItemDictTagBinding");
}
listItemDictTagBinding = (ListItemDictTagBinding) invoke;
onBind.setViewBinding(listItemDictTagBinding);
} else {
ViewBinding viewBinding = onBind.getViewBinding();
if (viewBinding == null) {
throw new NullPointerException("null cannot be cast to non-null type tech.xiangzi.painless.databinding.ListItemDictTagBinding");
}
listItemDictTagBinding = (ListItemDictTagBinding) viewBinding;
}
listItemDictTagBinding.r(dictTagBean);
listItemDictTagBinding.f5794b.setBackgroundResource(dictTagBean.isCurrent() ? R.drawable.bg_list_tag_checked : R.drawable.bg_list_tag_uncheck);
}
});
final FragmentActivity fragmentActivity3 = FragmentActivity.this;
final UserViewModel userViewModel3 = userViewModel2;
bindingAdapter.onClick(R.id.status_btn, new Function2<BindingAdapter.BindingViewHolder, Integer, Unit>() {
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
@DebugMetadata(c = "tech.xiangzi.painless.utils.ext.DialogExtKt$showDictTagDialog$1$onBind$1$2$2$2", f = "DialogExt.kt", i = {}, l = {1076}, m = "invokeSuspend", n = {}, s = {})
@SourceDebugExtension({"SMAP\nDialogExt.kt\nKotlin\n*S Kotlin\n*F\n+ 1 DialogExt.kt\ntech/xiangzi/painless/utils/ext/DialogExtKt$showDictTagDialog$1$onBind$1$2$2$2\n+ 2 Logger.kt\ncom/dylanc/longan/LoggerKt\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,1147:1\n92#2,2:1148\n57#2,2:1150\n1#3:1152\n*S KotlinDebug\n*F\n+ 1 DialogExt.kt\ntech/xiangzi/painless/utils/ext/DialogExtKt$showDictTagDialog$1$onBind$1$2$2$2\n*L\n1075#1:1148,2\n1075#1:1150,2\n1075#1:1152\n*E\n"})
public static final class C01282 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
final UserViewModel $userViewModel;
int label;
public C01282(UserViewModel userViewModel, Continuation<? super C01282> continuation) {
super(2, continuation);
this.$userViewModel = userViewModel;
}
@Override
@NotNull
public final Continuation<Unit> create(@Nullable Object obj, @NotNull Continuation<?> continuation) {
return new C01282(this.$userViewModel, continuation);
}
@Override
@Nullable
public final Object mo1invoke(@NotNull CoroutineScope coroutineScope, @Nullable Continuation<? super Unit> continuation) {
return ((C01282) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override
@Nullable
public final Object invokeSuspend(@NotNull Object obj) {
StackTraceElement it;
String simpleClassName;
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i != 0) {
if (i == 1) {
ResultKt.throwOnFailure(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} else {
ResultKt.throwOnFailure(obj);
int m48getINFOKfHOVCA = LogLevel.INSTANCE.m48getINFOKfHOVCA();
StackTraceElement[] D = androidx.recyclerview.widget.a.D("currentThread().stackTrace");
int length = D.length;
int i2 = 0;
while (true) {
if (i2 < length) {
it = D[i2];
Intrinsics.checkNotNullExpressionValue(it, "it");
if (!LoggerKt.isIgnorable(it)) {
break;
}
i2++;
} else {
it = null;
break;
}
}
if (it == null) {
simpleClassName = null;
} else {
simpleClassName = LoggerKt.getSimpleClassName(it);
}
if (simpleClassName == null) {
simpleClassName = "";
}
LoggerKt.m51logIBjOjVg(m48getINFOKfHOVCA, simpleClassName, "切换单词本成功标记数据变化 同步数据到云端", null);
UserViewModel userViewModel = this.$userViewModel;
UserBean user = CacheUtil.INSTANCE.getUser();
this.label = 1;
if (UserViewModel.syncUserData$default(userViewModel, user, false, null, null, this, 14, null) == coroutine_suspended) {
return coroutine_suspended;
}
}
return Unit.INSTANCE;
}
}
{
super(2);
}
@Override
public Unit mo1invoke(BindingAdapter.BindingViewHolder bindingViewHolder, Integer num) {
invoke(bindingViewHolder, num.intValue());
return Unit.INSTANCE;
}
public final void invoke(@NotNull BindingAdapter.BindingViewHolder onClick, int i2) {
Intrinsics.checkNotNullParameter(onClick, "$this$onClick");
DictTagBean dictTagBean = (DictTagBean) onClick.getModel();
ArrayList<Object> mutable = BindingAdapter.this.getMutable();
Intrinsics.checkNotNull(mutable, "null cannot be cast to non-null type java.util.ArrayList<tech.xiangzi.painless.data.remote.model.DictTagBean?>{ kotlin.collections.TypeAliasesKt.ArrayList<tech.xiangzi.painless.data.remote.model.DictTagBean?> }");
BindingAdapter bindingAdapter2 = BindingAdapter.this;
ArrayList arrayList = new ArrayList();
Iterator<T> it = mutable.iterator();
int i3 = 0;
while (true) {
if (!it.hasNext()) {
bindingAdapter2.setModels(arrayList);
CacheUtil cacheUtil = CacheUtil.INSTANCE;
cacheUtil.setCurrentDictTagName(dictTagBean.getTitle());
WorkManager.getInstance(onClick.getContext()).enqueue(CustomExtKt.initOneTimeWorker$default(InitCurrentDictWorker.class, new Data.Builder().putString(ConstantKt.CHANGE_CURRENT_TAG, dictTagBean.getTag()).build(), null, false, 12, null));
cacheUtil.setUserDictChange(true);
BuildersKt__Builders_commonKt.launch$default(LifecycleOwnerKt.getLifecycleScope(fragmentActivity3), null, null, new C01282(userViewModel3, null), 3, null);
cacheUtil.clearUserFrq();
return;
}
Object next = it.next();
int i4 = i3 + 1;
if (i3 < 0) {
CollectionsKt.throwIndexOverflow();
}
DictTagBean dictTagBean2 = (DictTagBean) next;
if (dictTagBean2 != null) {
dictTagBean2.setCurrent(i3 == onClick.getModelPosition());
}
if (dictTagBean2 != null) {
arrayList.add(dictTagBean2);
}
i3 = i4;
}
}
});
}
});
BuildersKt__Builders_commonKt.launch$default(LifecycleOwnerKt.getLifecycleScope(fragmentActivity2), null, null, new DialogExtKt$showDictTagDialog$1$onBind$1$3(bind, customDictViewModel2, null), 3, null);
}
}
}).setMaxHeight((int) (ApplicationKt.getApplication().getResources().getDisplayMetrics().heightPixels * 0.8f)).setAllowInterceptTouch(false).show();
}
public static final void showFeedbackDialog() {
BottomDialog.build().setCustomView(new OnBindView<BottomDialog>() {
@Override
public void onBind(@Nullable final BottomDialog dialog, @Nullable View v2) {
if (v2 != null) {
View findViewById = v2.findViewById(R.id.close_btn);
Intrinsics.checkNotNullExpressionValue(findViewById, "findViewById<SleRelativeLayout>(R.id.close_btn)");
ViewKt.doOnClick$default(findViewById, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
BottomDialog bottomDialog = BottomDialog.this;
if (bottomDialog != null) {
bottomDialog.dismiss();
}
}
}, 2, (Object) null);
View findViewById2 = v2.findViewById(R.id.email);
Intrinsics.checkNotNullExpressionValue(findViewById2, "findViewById<SleTextButton>(R.id.email)");
ViewKt.doOnClick$default(findViewById2, 1000, false, (Function0) new Function0<Unit>() {
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
IntentsKt.email$default("feedback@xiangzi.tech", null, null, 6, null);
}
}, 2, (Object) null);
View findViewById3 = v2.findViewById(R.id.copy_public_wechat);
Intrinsics.checkNotNullExpressionValue(findViewById3, "findViewById<SleTextButt…(R.id.copy_public_wechat)");
ViewKt.doOnClick$default(findViewById3, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
ClipboardKt.copyToClipboard$default("巷子工作室", (CharSequence) null, 1, (Object) null);
BottomDialog bottomDialog = BottomDialog.this;
if (bottomDialog != null) {
bottomDialog.dismiss();
}
DialogExtKt.showTip$default("复制成功", false, 0, 6, null);
}
}, 2, (Object) null);
}
}
}).show();
}
public static final void showImportDictDialog(@NotNull final LifecycleCoroutineScope viewLifecycleScope, @NotNull final CustomDictViewModel customDictViewModel, @Nullable final Function2<? super String, ? super String, Unit> function2) {
Intrinsics.checkNotNullParameter(viewLifecycleScope, "viewLifecycleScope");
Intrinsics.checkNotNullParameter(customDictViewModel, "customDictViewModel");
BottomDialog.build().setCustomView(new OnBindView<BottomDialog>() {
{
super(R.layout.dialog_import_dict);
}
@Override
public void onBind(@Nullable final BottomDialog dialog, @Nullable final View v2) {
if (v2 != null) {
final Function2<String, String, Unit> function22 = function2;
LifecycleCoroutineScope lifecycleCoroutineScope = viewLifecycleScope;
CustomDictViewModel customDictViewModel2 = customDictViewModel;
DialogImportDictBinding bind = DialogImportDictBinding.bind(v2);
AppCompatImageView closeBtn = bind.f5529a;
Intrinsics.checkNotNullExpressionValue(closeBtn, "closeBtn");
ViewKt.doOnClick$default((View) closeBtn, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
BottomDialog bottomDialog = BottomDialog.this;
if (bottomDialog != null) {
bottomDialog.dismiss();
}
}
}, 2, (Object) null);
if (function22 != null) {
bind.f5530b.setText(ResouresKt.getString(v2, R.string.custom_dict_import));
}
RecyclerView selfDictRv = bind.f5532d;
Intrinsics.checkNotNullExpressionValue(selfDictRv, "selfDictRv");
RecyclerUtilsKt.setup(RecyclerUtilsKt.divider(RecyclerUtilsKt.linear$default(selfDictRv, 0, false, false, false, 15, null), new Function1<DefaultDecoration, Unit>() {
@Override
public Unit invoke(DefaultDecoration defaultDecoration) {
invoke2(defaultDecoration);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull DefaultDecoration divider) {
Intrinsics.checkNotNullParameter(divider, "$this$divider");
divider.setDivider(10, true);
}
}), new Function2<BindingAdapter, RecyclerView, Unit>() {
{
super(2);
}
@Override
public Unit mo1invoke(BindingAdapter bindingAdapter, RecyclerView recyclerView) {
invoke2(bindingAdapter, recyclerView);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull BindingAdapter bindingAdapter, @NotNull RecyclerView recyclerView) {
boolean C = androidx.recyclerview.widget.a.C(bindingAdapter, "$this$setup", recyclerView, "it", CustomDictWithWords.class);
final int i = R.layout.list_item_custom_dict;
if (C) {
bindingAdapter.addInterfaceType(CustomDictWithWords.class, new Function2<Object, Integer, Integer>() {
{
super(2);
}
@NotNull
public final Integer invoke(@NotNull Object addInterfaceType, int i2) {
Intrinsics.checkNotNullParameter(addInterfaceType, "$this$addInterfaceType");
return Integer.valueOf(i);
}
@Override
public Integer mo1invoke(Object obj, Integer num) {
return invoke(obj, num.intValue());
}
});
} else {
bindingAdapter.getTypePool().put(CustomDictWithWords.class, new Function2<Object, Integer, Integer>() {
{
super(2);
}
@NotNull
public final Integer invoke(@NotNull Object obj, int i2) {
Intrinsics.checkNotNullParameter(obj, "$this$null");
return Integer.valueOf(i);
}
@Override
public Integer mo1invoke(Object obj, Integer num) {
return invoke(obj, num.intValue());
}
});
}
final Function2<String, String, Unit> function23 = function22;
final View view = v2;
bindingAdapter.onBind(new Function1<BindingAdapter.BindingViewHolder, Unit>() {
{
super(1);
}
@Override
public Unit invoke(BindingAdapter.BindingViewHolder bindingViewHolder) {
invoke2(bindingViewHolder);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull BindingAdapter.BindingViewHolder onBind) {
ListItemCustomDictBinding listItemCustomDictBinding;
Intrinsics.checkNotNullParameter(onBind, "$this$onBind");
CustomDictWithWords customDictWithWords = (CustomDictWithWords) onBind.getModel();
if (onBind.getViewBinding() == null) {
Object invoke = ListItemCustomDictBinding.class.getMethod("bind", View.class).invoke(null, onBind.itemView);
if (invoke == null) {
throw new NullPointerException("null cannot be cast to non-null type tech.xiangzi.painless.databinding.ListItemCustomDictBinding");
}
listItemCustomDictBinding = (ListItemCustomDictBinding) invoke;
onBind.setViewBinding(listItemCustomDictBinding);
} else {
ViewBinding viewBinding = onBind.getViewBinding();
if (viewBinding == null) {
throw new NullPointerException("null cannot be cast to non-null type tech.xiangzi.painless.databinding.ListItemCustomDictBinding");
}
listItemCustomDictBinding = (ListItemCustomDictBinding) viewBinding;
}
Function2<String, String, Unit> function24 = function23;
View view2 = view;
listItemCustomDictBinding.f5769c.setText(customDictWithWords.getWordbook().getName());
listItemCustomDictBinding.f5767a.setText("共计 " + customDictWithWords.getWords().size() + " 个单词");
if (function24 != null) {
listItemCustomDictBinding.f5768b.setText(ResouresKt.getString(view2, R.string.dict_import));
}
}
});
final Function2<String, String, Unit> function24 = function22;
final BottomDialog bottomDialog = dialog;
bindingAdapter.onClick(R.id.edit_btn, new Function2<BindingAdapter.BindingViewHolder, Integer, Unit>() {
{
super(2);
}
@Override
public Unit mo1invoke(BindingAdapter.BindingViewHolder bindingViewHolder, Integer num) {
invoke(bindingViewHolder, num.intValue());
return Unit.INSTANCE;
}
public final void invoke(@NotNull BindingAdapter.BindingViewHolder onClick, int i2) {
StackTraceElement it;
String simpleClassName;
Intrinsics.checkNotNullParameter(onClick, "$this$onClick");
CustomDictWithWords customDictWithWords = (CustomDictWithWords) onClick.getModel();
Function2<String, String, Unit> function25 = function24;
if (function25 != null) {
function25.mo1invoke(customDictWithWords.getWordbook().getTag(), customDictWithWords.getWordbook().getName());
} else {
String str = "选择的单词本 tag: " + customDictWithWords.getWordbook().getTag();
int m48getINFOKfHOVCA = LogLevel.INSTANCE.m48getINFOKfHOVCA();
StackTraceElement[] D = androidx.recyclerview.widget.a.D("currentThread().stackTrace");
int length = D.length;
int i3 = 0;
while (true) {
if (i3 < length) {
it = D[i3];
Intrinsics.checkNotNullExpressionValue(it, "it");
if (!LoggerKt.isIgnorable(it)) {
break;
} else {
i3++;
}
} else {
it = null;
break;
}
}
if (it == null) {
simpleClassName = null;
} else {
simpleClassName = LoggerKt.getSimpleClassName(it);
}
if (simpleClassName == null) {
simpleClassName = "";
}
LoggerKt.m51logIBjOjVg(m48getINFOKfHOVCA, simpleClassName, str, null);
Pair[] pairArr = {TuplesKt.to(ConstantKt.CUSTOM_DICT_TAG, customDictWithWords.getWordbook().getTag()), TuplesKt.to(ConstantKt.CUSTOM_DICT_NAME, customDictWithWords.getWordbook().getName())};
Activity topActivity = ActivityKt.getTopActivity();
Pair[] pairArr2 = (Pair[]) Arrays.copyOf(pairArr, 2);
Pair[] pairArr3 = (Pair[]) Arrays.copyOf(pairArr2, pairArr2.length);
Intent putExtras = new Intent(topActivity, (Class<?>) CustomDictDetailActivity.class).putExtras(BundleKt.bundleOf((Pair[]) Arrays.copyOf(pairArr3, pairArr3.length)));
Intrinsics.checkNotNullExpressionValue(putExtras, "Intent(this, T::class.java).putExtras(bundle)");
Unit unit = Unit.INSTANCE;
topActivity.startActivity(putExtras);
}
BottomDialog bottomDialog2 = bottomDialog;
if (bottomDialog2 != null) {
bottomDialog2.dismiss();
}
}
});
}
});
BuildersKt__Builders_commonKt.launch$default(lifecycleCoroutineScope, null, null, new DialogExtKt$showImportDictDialog$1$onBind$1$1$4(bind, customDictViewModel2, null), 3, null);
SleTextButton newDicBtn = bind.f5531c;
Intrinsics.checkNotNullExpressionValue(newDicBtn, "newDicBtn");
ViewKt.doOnClick$default((View) newDicBtn, 1000, false, (Function0) new DialogExtKt$showImportDictDialog$1$onBind$1$1$5(v2, lifecycleCoroutineScope, customDictViewModel2, bind), 2, (Object) null);
}
}
}).show();
}
public static final void showLoginDialog(@NotNull final FragmentActivity fragmentActivity, @NotNull final UserViewModel viewModel, @NotNull final IWXAPI api, boolean z2, boolean z3) {
StackTraceElement it;
Intrinsics.checkNotNullParameter(fragmentActivity, "<this>");
Intrinsics.checkNotNullParameter(viewModel, "viewModel");
Intrinsics.checkNotNullParameter(api, "api");
String str = "showLoginDialog: isUserClickLogin: " + z3 + ' ';
int m48getINFOKfHOVCA = LogLevel.INSTANCE.m48getINFOKfHOVCA();
StackTraceElement[] D = androidx.recyclerview.widget.a.D("currentThread().stackTrace");
int length = D.length;
int i = 0;
while (true) {
if (i >= length) {
it = null;
break;
}
it = D[i];
Intrinsics.checkNotNullExpressionValue(it, "it");
if (!LoggerKt.isIgnorable(it)) {
break;
} else {
i++;
}
}
String simpleClassName = it == null ? null : LoggerKt.getSimpleClassName(it);
if (simpleClassName == null) {
simpleClassName = "";
}
LoggerKt.m51logIBjOjVg(m48getINFOKfHOVCA, simpleClassName, str, null);
BottomDialog.build().setCustomView(new OnBindView<BottomDialog>() {
{
super(R.layout.dialog_login);
}
@Override
public void onBind(@Nullable final BottomDialog dialog, @Nullable View v2) {
if (v2 != null) {
final UserViewModel userViewModel = UserViewModel.this;
final FragmentActivity fragmentActivity2 = fragmentActivity;
final IWXAPI iwxapi = api;
final DialogLoginBinding bind = DialogLoginBinding.bind(v2);
AppCompatImageView closeBtn = bind.f5543a;
Intrinsics.checkNotNullExpressionValue(closeBtn, "closeBtn");
ViewKt.doOnClick$default((View) closeBtn, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
BottomDialog bottomDialog = BottomDialog.this;
if (bottomDialog != null) {
bottomDialog.dismiss();
}
}
}, 2, (Object) null);
AppCompatTextView privacyTip = bind.f5549h;
Intrinsics.checkNotNullExpressionValue(privacyTip, "privacyTip");
SpannableXKt.activateClick(privacyTip, false).setText(SpannableXKt.spannable(bind, new Function1<SpanDsl, Unit>() {
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "", "Ltech/xiangzi/painless/utils/spannable/SpanDsl;", "invoke"}, k = 3, mv = {1, 8, 0}, xi = 48)
public static final class AnonymousClass1 extends Lambda implements Function1<SpanDsl, Unit> {
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
public AnonymousClass1() {
super(1);
}
@Override
public Unit invoke(SpanDsl spanDsl) {
invoke2(spanDsl);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull SpanDsl span) {
Intrinsics.checkNotNullParameter(span, "$this$span");
span.underline(span, "隐私政策");
span.clickable(span, (r15 & 1) != 0 ? null : null, (r15 & 2) != 0 ? null : null, (r15 & 4) != 0 ? null : null, (r15 & 8) != 0 ? null : null, (r15 & 16) != 0 ? null : "隐私政策", (r15 & 32) == 0 ?
throw new UnsupportedOperationException("Method not decompiled: tech.xiangzi.painless.utils.ext.DialogExtKt$showLoginDialog$1$onBind$1$1$2.AnonymousClass1.invoke2(tech.xiangzi.painless.utils.spannable.SpanDsl):void");
}
}
@Override
public Unit invoke(SpanDsl spanDsl) {
invoke2(spanDsl);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull SpanDsl spannable) {
Intrinsics.checkNotNullParameter(spannable, "$this$spannable");
SpanDsl.span$default(spannable, "我已阅读并同意 隐私政策", null, AnonymousClass1.INSTANCE, 1, null);
}
}));
AppCompatTextView getCodeBtn = bind.f5546d;
Intrinsics.checkNotNullExpressionValue(getCodeBtn, "getCodeBtn");
ViewKt.doOnClick$default((View) getCodeBtn, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
AppCompatEditText emailText = DialogLoginBinding.this.f5545c;
Intrinsics.checkNotNullExpressionValue(emailText, "emailText");
if (!StringKt.isEmail(StringsKt.trim((CharSequence) emailText.getText().toString()).toString())) {
DialogExtKt.showTip$default("\\uD83D\\uDE2D 邮箱格式不对哦", true, 0, 4, null);
return;
}
userViewModel.getCode(String.valueOf(DialogLoginBinding.this.f5545c.getText()));
AppCompatTextView getCodeBtn2 = DialogLoginBinding.this.f5546d;
Intrinsics.checkNotNullExpressionValue(getCodeBtn2, "getCodeBtn");
TextViewKt.startCountDown(getCodeBtn2, fragmentActivity2, 30, new Function2<TextView, Integer, Unit>() {
@Override
public Unit mo1invoke(TextView textView, Integer num) {
invoke(textView, num.intValue());
return Unit.INSTANCE;
}
public final void invoke(@NotNull TextView startCountDown, int i2) {
Intrinsics.checkNotNullParameter(startCountDown, "$this$startCountDown");
startCountDown.setText(i2 + " s");
startCountDown.setTextColor(ResouresKt.getCompatColor(startCountDown, R.color.gray));
}
}, new Function1<TextView, Unit>() {
@Override
public Unit invoke(TextView textView) {
invoke2(textView);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull TextView startCountDown) {
Intrinsics.checkNotNullParameter(startCountDown, "$this$startCountDown");
startCountDown.setText("重新获取");
startCountDown.setTextColor(ResouresKt.getCompatColor(startCountDown, R.color.colorThemeEmphasis));
}
});
}
}, 2, (Object) null);
AppCompatTextView privacyTip2 = bind.f5549h;
Intrinsics.checkNotNullExpressionValue(privacyTip2, "privacyTip");
ViewKt.doOnClick$default((View) privacyTip2, 100, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
DialogLoginBinding.this.f5548g.setChecked(!r0.isChecked());
}
}, 2, (Object) null);
LinearLayout privacyCheck = bind.f;
Intrinsics.checkNotNullExpressionValue(privacyCheck, "privacyCheck");
ViewKt.doOnClick$default((View) privacyCheck, 100, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
DialogLoginBinding.this.f5548g.setChecked(!r0.isChecked());
}
}, 2, (Object) null);
SleTextButton loginBtn = bind.f5547e;
Intrinsics.checkNotNullExpressionValue(loginBtn, "loginBtn");
ViewKt.doOnClick$default((View) loginBtn, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
String str2;
StackTraceElement it2;
String simpleClassName2;
StackTraceElement it3;
String simpleClassName3;
AppCompatEditText emailText = DialogLoginBinding.this.f5545c;
Intrinsics.checkNotNullExpressionValue(emailText, "emailText");
int i2 = 0;
if (!TextViewKt.isTextEmpty(emailText)) {
AppCompatEditText codeText = DialogLoginBinding.this.f5544b;
Intrinsics.checkNotNullExpressionValue(codeText, "codeText");
if (!TextViewKt.isTextEmpty(codeText)) {
if (!DialogLoginBinding.this.f5548g.isChecked()) {
str2 = "😭 请先阅读并同意隐私协议";
DialogExtKt.showTip$default(str2, true, 0, 4, null);
}
CacheUtil cacheUtil = CacheUtil.INSTANCE;
String str3 = "";
if (!cacheUtil.getUser().isRealLogin() && cacheUtil.getUser().isLogin()) {
int m48getINFOKfHOVCA2 = LogLevel.INSTANCE.m48getINFOKfHOVCA();
StackTraceElement[] D2 = androidx.recyclerview.widget.a.D("currentThread().stackTrace");
int length2 = D2.length;
while (true) {
if (i2 < length2) {
it3 = D2[i2];
Intrinsics.checkNotNullExpressionValue(it3, "it");
if (!LoggerKt.isIgnorable(it3)) {
break;
} else {
i2++;
}
} else {
it3 = null;
break;
}
}
if (it3 == null) {
simpleClassName3 = null;
} else {
simpleClassName3 = LoggerKt.getSimpleClassName(it3);
}
if (simpleClassName3 != null) {
str3 = simpleClassName3;
}
LoggerKt.m51logIBjOjVg(m48getINFOKfHOVCA2, str3, "执行绑定逻辑", null);
UserViewModel userViewModel2 = userViewModel;
AppCompatEditText emailText2 = DialogLoginBinding.this.f5545c;
Intrinsics.checkNotNullExpressionValue(emailText2, "emailText");
String obj = StringsKt.trim((CharSequence) emailText2.getText().toString()).toString();
AppCompatEditText codeText2 = DialogLoginBinding.this.f5544b;
Intrinsics.checkNotNullExpressionValue(codeText2, "codeText");
userViewModel2.bindEmail(new Login(obj, StringsKt.trim((CharSequence) codeText2.getText().toString()).toString()), true);
return;
}
int m48getINFOKfHOVCA3 = LogLevel.INSTANCE.m48getINFOKfHOVCA();
StackTraceElement[] D3 = androidx.recyclerview.widget.a.D("currentThread().stackTrace");
int length3 = D3.length;
while (true) {
if (i2 < length3) {
it2 = D3[i2];
Intrinsics.checkNotNullExpressionValue(it2, "it");
if (!LoggerKt.isIgnorable(it2)) {
break;
} else {
i2++;
}
} else {
it2 = null;
break;
}
}
if (it2 == null) {
simpleClassName2 = null;
} else {
simpleClassName2 = LoggerKt.getSimpleClassName(it2);
}
if (simpleClassName2 != null) {
str3 = simpleClassName2;
}
LoggerKt.m51logIBjOjVg(m48getINFOKfHOVCA3, str3, "执行登录逻辑", null);
UserViewModel userViewModel3 = userViewModel;
AppCompatEditText emailText3 = DialogLoginBinding.this.f5545c;
Intrinsics.checkNotNullExpressionValue(emailText3, "emailText");
String obj2 = StringsKt.trim((CharSequence) emailText3.getText().toString()).toString();
AppCompatEditText codeText3 = DialogLoginBinding.this.f5544b;
Intrinsics.checkNotNullExpressionValue(codeText3, "codeText");
userViewModel3.loginByEmail(new Login(obj2, StringsKt.trim((CharSequence) codeText3.getText().toString()).toString()));
return;
}
}
str2 = "请输入邮箱或验证码!";
DialogExtKt.showTip$default(str2, true, 0, 4, null);
}
}, 2, (Object) null);
SleRelativeLayout wechatLoginBtn = bind.i;
Intrinsics.checkNotNullExpressionValue(wechatLoginBtn, "wechatLoginBtn");
ViewKt.doOnClick$default((View) wechatLoginBtn, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
String str2;
if (!DialogLoginBinding.this.f5548g.isChecked()) {
str2 = "😭 请先阅读并同意隐私协议";
} else {
if (iwxapi.isWXAppInstalled()) {
SendAuth.Req req = new SendAuth.Req();
req.scope = "snsapi_userinfo";
req.state = "wechat_sdk_demo_test";
iwxapi.sendReq(req);
return;
}
str2 = "您还未安装微信客户端!";
}
DialogExtKt.showTip$default(str2, true, 0, 4, null);
}
}, 2, (Object) null);
}
}
}).show(fragmentActivity);
}
public static void showLoginDialog$default(FragmentActivity fragmentActivity, UserViewModel userViewModel, IWXAPI iwxapi, boolean z2, boolean z3, int i, Object obj) {
if ((i & 4) != 0) {
z2 = false;
}
if ((i & 8) != 0) {
z3 = false;
}
showLoginDialog(fragmentActivity, userViewModel, iwxapi, z2, z3);
}
public static final void showLogoutDialog(@NotNull final FragmentActivity fragmentActivity, @NotNull final UserViewModel userViewModel) {
Intrinsics.checkNotNullParameter(fragmentActivity, "<this>");
Intrinsics.checkNotNullParameter(userViewModel, "userViewModel");
userViewModel.sendAnalyticsData(EventType.TouchExit);
CustomDialog.build().setCustomView(new OnBindView<CustomDialog>() {
{
super(R.layout.dialog_log_out);
}
@Override
public void onBind(@Nullable final CustomDialog dialog, @Nullable View v2) {
if (v2 != null) {
final FragmentActivity fragmentActivity2 = FragmentActivity.this;
final UserViewModel userViewModel2 = userViewModel;
final DialogLogOutBinding bind = DialogLogOutBinding.bind(v2);
SleTextButton sleTextButton = bind.f5537a;
Intrinsics.checkNotNullExpressionValue(sleTextButton, "it.btnJoinPro");
ViewKt.doOnClick$default((View) sleTextButton, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
CustomDialog customDialog = CustomDialog.this;
if (customDialog != null) {
customDialog.dismiss();
}
userViewModel2.sendAnalyticsData(EventType.BuyExit);
CustomExtKt.toPayPage(fragmentActivity2);
}
}, 2, (Object) null);
AppCompatTextView appCompatTextView = bind.f5538b;
Intrinsics.checkNotNullExpressionValue(appCompatTextView, "it.btnLogOut");
ViewKt.doOnClick$default((View) appCompatTextView, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
UserViewModel.this.logout();
CustomDialog customDialog = dialog;
if (customDialog != null) {
customDialog.dismiss();
}
}
}, 2, (Object) null);
AppCompatImageView appCompatImageView = bind.f5541e;
Intrinsics.checkNotNullExpressionValue(appCompatImageView, "it.ivClose");
ViewKt.doOnClick$default((View) appCompatImageView, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
CustomDialog customDialog = CustomDialog.this;
if (customDialog != null) {
customDialog.dismiss();
}
}
}, 2, (Object) null);
RelativeLayout relativeLayout = bind.f5539c;
Intrinsics.checkNotNullExpressionValue(relativeLayout, "it.couponRl");
long currentTimeMillis = System.currentTimeMillis();
CacheUtil cacheUtil = CacheUtil.INSTANCE;
CustomExtKt.visibleOrGone(relativeLayout, currentTimeMillis <= cacheUtil.getCouponEndTimeMillis());
long a2 = h.a(1000, cacheUtil.getCouponEndTimeMillis());
AppCompatTextView appCompatTextView2 = bind.f5540d;
Intrinsics.checkNotNullExpressionValue(appCompatTextView2, "it.couponTv");
TextViewKt.startCountDown(appCompatTextView2, fragmentActivity2, (int) a2, new Function2<TextView, Integer, Unit>() {
{
super(2);
}
@Override
public Unit mo1invoke(TextView textView, Integer num) {
invoke(textView, num.intValue());
return Unit.INSTANCE;
}
public final void invoke(@NotNull final TextView startCountDown, int i) {
Intrinsics.checkNotNullParameter(startCountDown, "$this$startCountDown");
final String formatNumberWithZero = FormatExtKt.formatNumberWithZero(i / 3600);
final String formatNumberWithZero2 = FormatExtKt.formatNumberWithZero((i % 3600) / 60);
final String formatNumberWithZero3 = FormatExtKt.formatNumberWithZero(i % 60);
DialogLogOutBinding.this.f5540d.setText(SpannableXKt.spannable(startCountDown, new Function1<SpanDsl, Unit>() {
{
super(1);
}
@Override
public Unit invoke(SpanDsl spanDsl) {
invoke2(spanDsl);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull SpanDsl spannable) {
Intrinsics.checkNotNullParameter(spannable, "$this$spannable");
StringBuilder sb = new StringBuilder("限时折扣 ");
sb.append(formatNumberWithZero);
sb.append(" 时 ");
sb.append(formatNumberWithZero2);
sb.append(" 分 ");
String p2 = androidx.activity.result.b.p(sb, formatNumberWithZero3, " 秒后结束");
final TextView textView = startCountDown;
final String str = formatNumberWithZero;
final String str2 = formatNumberWithZero2;
final String str3 = formatNumberWithZero3;
SpanDsl.span$default(spannable, p2, null, new Function1<SpanDsl, Unit>() {
{
super(1);
}
@Override
public Unit invoke(SpanDsl spanDsl) {
invoke2(spanDsl);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull SpanDsl span) {
Intrinsics.checkNotNullParameter(span, "$this$span");
span.typeface(span, Typeface.create(ResouresKt.getCompatFont(textView, R.font.roboto_black), 0), null, String.valueOf(str));
span.typeface(span, Typeface.create(ResouresKt.getCompatFont(textView, R.font.roboto_black), 0), null, String.valueOf(str2));
span.typeface(span, Typeface.create(ResouresKt.getCompatFont(textView, R.font.roboto_black), 0), null, String.valueOf(str3));
}
}, 1, null);
}
}));
}
}, new Function1<TextView, Unit>() {
{
super(1);
}
@Override
public Unit invoke(TextView textView) {
invoke2(textView);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull TextView startCountDown) {
Intrinsics.checkNotNullParameter(startCountDown, "$this$startCountDown");
RelativeLayout relativeLayout2 = DialogLogOutBinding.this.f5539c;
Intrinsics.checkNotNullExpressionValue(relativeLayout2, "it.couponRl");
CustomExtKt.gone(relativeLayout2);
}
});
}
}
}).setMaskColor(ResouresKt.getCompatColor(fragmentActivity, R.color.black30)).show();
}
public static final void showNewWord100Dialog(@NotNull final Fragment fragment, @NotNull final Function0<Unit> toPay, @NotNull final Function0<Unit> show, @NotNull final Function0<Unit> dismiss) {
Intrinsics.checkNotNullParameter(fragment, "<this>");
Intrinsics.checkNotNullParameter(toPay, "toPay");
Intrinsics.checkNotNullParameter(show, "show");
Intrinsics.checkNotNullParameter(dismiss, "dismiss");
CustomDialog.build().setCustomView(new OnBindView<CustomDialog>() {
{
super(R.layout.dialog_new_word_100);
}
@Override
public void onBind(@Nullable final CustomDialog dialog, @Nullable final View v2) {
if (v2 != null) {
Fragment fragment2 = Fragment.this;
final Function0<Unit> function0 = toPay;
final DialogNewWord100Binding bind = DialogNewWord100Binding.bind(v2);
long currentTimeMillis = System.currentTimeMillis();
CacheUtil cacheUtil = CacheUtil.INSTANCE;
final boolean z2 = currentTimeMillis > cacheUtil.getCouponEndTimeMillis();
bind.f5553b.setText(z2 ? "立即加入" : "获取折扣");
SleTextButton sleTextButton = bind.f5553b;
Intrinsics.checkNotNullExpressionValue(sleTextButton, "it.btnJoinPro");
ViewKt.doOnClick$default((View) sleTextButton, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
function0.invoke();
CustomDialog customDialog = dialog;
if (customDialog != null) {
customDialog.dismiss();
}
}
}, 2, (Object) null);
AppCompatTextView appCompatTextView = bind.f5552a;
Intrinsics.checkNotNullExpressionValue(appCompatTextView, "it.btnCancel");
ViewKt.doOnClick$default((View) appCompatTextView, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
CustomDialog customDialog = CustomDialog.this;
if (customDialog != null) {
customDialog.dismiss();
}
}
}, 2, (Object) null);
bind.f.setText(z2 ? "加入高级会员" : "终身会员限时折扣");
if (!z2) {
long a2 = h.a(1000, cacheUtil.getCouponEndTimeMillis());
SleTextButton sleTextButton2 = bind.f5554c;
Intrinsics.checkNotNullExpressionValue(sleTextButton2, "it.countDownTv");
TextViewKt.startCountDown(sleTextButton2, fragment2, (int) a2, new Function2<TextView, Integer, Unit>() {
{
super(2);
}
@Override
public Unit mo1invoke(TextView textView, Integer num) {
invoke(textView, num.intValue());
return Unit.INSTANCE;
}
public final void invoke(@NotNull TextView startCountDown, int i) {
Intrinsics.checkNotNullParameter(startCountDown, "$this$startCountDown");
String formatNumberWithZero = FormatExtKt.formatNumberWithZero(i / 3600);
String formatNumberWithZero2 = FormatExtKt.formatNumberWithZero((i % 3600) / 60);
String formatNumberWithZero3 = FormatExtKt.formatNumberWithZero(i % 60);
DialogNewWord100Binding.this.f5554c.setText(formatNumberWithZero + AbstractJsonLexerKt.COLON + formatNumberWithZero2 + AbstractJsonLexerKt.COLON + formatNumberWithZero3 + ' ');
}
}, new Function1<TextView, Unit>() {
{
super(1);
}
@Override
public Unit invoke(TextView textView) {
invoke2(textView);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull TextView startCountDown) {
Intrinsics.checkNotNullParameter(startCountDown, "$this$startCountDown");
SleTextButton sleTextButton3 = DialogNewWord100Binding.this.f5554c;
Intrinsics.checkNotNullExpressionValue(sleTextButton3, "it.countDownTv");
CustomExtKt.gone(sleTextButton3);
}
});
sleTextButton2.setColor(ResouresKt.getCompatColor(v2, R.color.colorTheme));
Intrinsics.checkNotNullExpressionValue(sleTextButton2, "it.countDownTv");
CustomExtKt.visible(sleTextButton2);
}
bind.f5555d.setText("\u1f973 恭喜 100 词成就达成!加入高级会员即刻解锁 16 项专属权益,为学习提速!");
bind.f5556e.setText(SpannableXKt.spannable(v2, new Function1<SpanDsl, Unit>() {
{
super(1);
}
@Override
public Unit invoke(SpanDsl spanDsl) {
invoke2(spanDsl);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull SpanDsl spannable) {
StringBuilder sb;
String str;
Intrinsics.checkNotNullParameter(spannable, "$this$spannable");
if (z2) {
sb = new StringBuilder("仅 ¥");
sb.append(CacheUtil.INSTANCE.getOriginalPrice());
str = ".00,一次购买终身可用。";
} else {
sb = new StringBuilder("限时折扣仅 ¥");
CacheUtil cacheUtil2 = CacheUtil.INSTANCE;
sb.append(cacheUtil2.getAfterCouponPrice());
sb.append(".00,原价 ¥");
sb.append(cacheUtil2.getOriginalPrice());
str = ".00";
}
sb.append(str);
String sb2 = sb.toString();
final boolean z3 = z2;
final View view = v2;
SpanDsl.span$default(spannable, sb2, null, new Function1<SpanDsl, Unit>() {
{
super(1);
}
@Override
public Unit invoke(SpanDsl spanDsl) {
invoke2(spanDsl);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull SpanDsl span) {
CacheUtil cacheUtil3;
Typeface create;
StringBuilder sb3;
Intrinsics.checkNotNullParameter(span, "$this$span");
if (z3) {
int compatColor = ResouresKt.getCompatColor(view, R.color.colorThemeEmphasis);
StringBuilder sb4 = new StringBuilder("¥");
cacheUtil3 = CacheUtil.INSTANCE;
sb4.append(cacheUtil3.getOriginalPrice());
sb4.append(".00");
span.color(span, compatColor, sb4.toString());
create = Typeface.create(ResouresKt.getCompatFont(view, R.font.roboto_black), 0);
sb3 = new StringBuilder("¥");
} else {
int compatColor2 = ResouresKt.getCompatColor(view, R.color.colorThemeEmphasis);
StringBuilder sb5 = new StringBuilder("¥");
cacheUtil3 = CacheUtil.INSTANCE;
sb5.append(cacheUtil3.getAfterCouponPrice());
sb5.append(".00");
span.color(span, compatColor2, sb5.toString());
span.color(span, ResouresKt.getCompatColor(view, R.color.colorFore3), "¥" + cacheUtil3.getOriginalPrice() + ".00");
span.strikethrough(span, "¥" + cacheUtil3.getOriginalPrice() + ".00");
span.typeface(span, Typeface.create(ResouresKt.getCompatFont(view, R.font.roboto_black), 0), null, "¥" + cacheUtil3.getAfterCouponPrice() + ".00");
create = Typeface.create(ResouresKt.getCompatFont(view, R.font.roboto_black), 0);
sb3 = new StringBuilder("¥");
}
sb3.append(cacheUtil3.getOriginalPrice());
sb3.append(".00");
span.typeface(span, create, null, sb3.toString());
}
}, 1, null);
}
}));
}
}
}).setDialogLifecycleCallback(new DialogLifecycleCallback<CustomDialog>() {
@Override
public void onDismiss(@Nullable CustomDialog dialog) {
super.onDismiss((DialogExtKt$showNewWord100Dialog$2) dialog);
dismiss.invoke();
}
@Override
public void onShow(@Nullable CustomDialog dialog) {
super.onShow((DialogExtKt$showNewWord100Dialog$2) dialog);
show.invoke();
}
}).setMaskColor(ResouresKt.getCompatColor(fragment, R.color.black30)).setCancelable(false).show();
}
public static final void showPrivacyDialog(@NotNull final FragmentActivity fragmentActivity) {
Intrinsics.checkNotNullParameter(fragmentActivity, "<this>");
CustomDialog.build().setCustomView(new OnBindView<CustomDialog>() {
{
super(R.layout.dialog_app_privacy);
}
@Override
public void onBind(@Nullable final CustomDialog dialog, @Nullable final View v2) {
if (v2 != null) {
final FragmentActivity fragmentActivity2 = FragmentActivity.this;
DialogAppPrivacyBinding bind = DialogAppPrivacyBinding.bind(v2);
SleTextButton agreeBtn = bind.f5499a;
Intrinsics.checkNotNullExpressionValue(agreeBtn, "agreeBtn");
ViewKt.doOnClick$default((View) agreeBtn, 1000, false, (Function0) new Function0<Unit>() {
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
@DebugMetadata(c = "tech.xiangzi.painless.utils.ext.DialogExtKt$showPrivacyDialog$1$onBind$1$1$1$1", f = "DialogExt.kt", i = {}, l = {345}, m = "invokeSuspend", n = {}, s = {})
public static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
int label;
public AnonymousClass1(Continuation<? super AnonymousClass1> continuation) {
super(2, continuation);
}
@Override
@NotNull
public final Continuation<Unit> create(@Nullable Object obj, @NotNull Continuation<?> continuation) {
return new AnonymousClass1(continuation);
}
@Override
@Nullable
public final Object mo1invoke(@NotNull CoroutineScope coroutineScope, @Nullable Continuation<? super Unit> continuation) {
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override
@Nullable
public final Object invokeSuspend(@NotNull Object obj) {
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
FlowBus.EventBus with = FlowBus.INSTANCE.with(ConstantKt.AGREE_PRIVACY);
Boolean boxBoolean = Boxing.boxBoolean(true);
this.label = 1;
if (with.post((FlowBus.EventBus) boxBoolean, (Continuation<? super Unit>) this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return Unit.INSTANCE;
}
}
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
CacheUtil.INSTANCE.setAgreePrivacy(true);
App.Companion companion = App.INSTANCE;
companion.instance().initBugly();
companion.instance().initOaid();
CustomDialog customDialog = CustomDialog.this;
if (customDialog != null) {
customDialog.dismiss();
}
BuildersKt__Builders_commonKt.launch$default(LifecycleOwnerKt.getLifecycleScope(fragmentActivity2), null, null, new AnonymousClass1(null), 3, null);
}
}, 2, (Object) null);
AppCompatTextView refuseBtn = bind.f5501c;
Intrinsics.checkNotNullExpressionValue(refuseBtn, "refuseBtn");
ViewKt.doOnClick$default((View) refuseBtn, 1000, false, (Function0) new Function0<Unit>() {
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
@DebugMetadata(c = "tech.xiangzi.painless.utils.ext.DialogExtKt$showPrivacyDialog$1$onBind$1$1$2$1", f = "DialogExt.kt", i = {}, l = {351}, m = "invokeSuspend", n = {}, s = {})
public static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
int label;
public AnonymousClass1(Continuation<? super AnonymousClass1> continuation) {
super(2, continuation);
}
@Override
@NotNull
public final Continuation<Unit> create(@Nullable Object obj, @NotNull Continuation<?> continuation) {
return new AnonymousClass1(continuation);
}
@Override
@Nullable
public final Object mo1invoke(@NotNull CoroutineScope coroutineScope, @Nullable Continuation<? super Unit> continuation) {
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override
@Nullable
public final Object invokeSuspend(@NotNull Object obj) {
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
FlowBus.EventBus with = FlowBus.INSTANCE.with(ConstantKt.AGREE_PRIVACY);
Boolean boxBoolean = Boxing.boxBoolean(false);
this.label = 1;
if (with.post((FlowBus.EventBus) boxBoolean, (Continuation<? super Unit>) this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return Unit.INSTANCE;
}
}
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
CustomDialog customDialog = CustomDialog.this;
if (customDialog != null) {
customDialog.dismiss();
}
BuildersKt__Builders_commonKt.launch$default(LifecycleOwnerKt.getLifecycleScope(fragmentActivity2), null, null, new AnonymousClass1(null), 3, null);
}
}, 2, (Object) null);
final List listOf = CollectionsKt.listOf((Object[]) new String[]{"《服务协议》", "《隐私政策》"});
AppCompatTextView privacyContent = bind.f5500b;
Intrinsics.checkNotNullExpressionValue(privacyContent, "privacyContent");
SpannableXKt.activateClick(privacyContent, false).setText(SpannableXKt.spannable(bind, new Function1<SpanDsl, Unit>() {
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "", "Ltech/xiangzi/painless/utils/spannable/SpanDsl;", "invoke"}, k = 3, mv = {1, 8, 0}, xi = 48)
public static final class AnonymousClass1 extends Lambda implements Function1<SpanDsl, Unit> {
final List<String> $privacyList;
final View $this_apply;
public AnonymousClass1(View view, List<String> list) {
super(1);
this.$this_apply = view;
this.$privacyList = list;
}
public static final void invoke$lambda$0(List privacyList, int i, View view, String str, IsClickedState isClickedState) {
String str2;
Intrinsics.checkNotNullParameter(privacyList, "$privacyList");
if (Intrinsics.areEqual(str, privacyList.get(0))) {
str2 = "https://xiangzi.tech/terms-and-conditions-cn.html";
} else if (!Intrinsics.areEqual(str, privacyList.get(1))) {
return;
} else {
str2 = "https://www.xiangzi.tech/privacy-policy-cn.html";
}
IntentsKt.browse$default(str2, false, 2, null);
}
@Override
public Unit invoke(SpanDsl spanDsl) {
invoke2(spanDsl);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull SpanDsl span) {
Intrinsics.checkNotNullParameter(span, "$this$span");
span.color(span, ResouresKt.getCompatColor(this.$this_apply, R.color.colorTheme), this.$privacyList);
final List<String> list = this.$privacyList;
span.clickable(span, (r15 & 1) != 0 ? null : null, (r15 & 2) != 0 ? null : null, (r15 & 4) != 0 ? null : null, (r15 & 8) != 0 ? null : null, (r15 & 16) != 0 ? null : list, (r15 & 32) == 0 ?
throw new UnsupportedOperationException("Method not decompiled: tech.xiangzi.painless.utils.ext.DialogExtKt$showPrivacyDialog$1$onBind$1$1$3.AnonymousClass1.invoke2(tech.xiangzi.painless.utils.spannable.SpanDsl):void");
}
}
{
super(1);
}
@Override
public Unit invoke(SpanDsl spanDsl) {
invoke2(spanDsl);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull SpanDsl spannable) {
Intrinsics.checkNotNullParameter(spannable, "$this$spannable");
SpanDsl.span$default(spannable, v2.getResources().getString(R.string.privacy_content), null, new AnonymousClass1(v2, listOf), 1, null);
}
}));
}
}
}).setMaskColor(ResouresKt.getCompatColor(fragmentActivity, R.color.black30)).setCancelable(false).show();
}
public static final void showReportDialog(@NotNull final Function2<? super String, ? super String, Unit> reportCallback) {
Intrinsics.checkNotNullParameter(reportCallback, "reportCallback");
BottomDialog.build().setCustomView(new OnBindView<BottomDialog>() {
{
super(R.layout.dialog_report);
}
@Override
public void onBind(@Nullable final BottomDialog dialog, @Nullable View v2) {
if (v2 != null) {
final Function2<String, String, Unit> function2 = reportCallback;
final DialogReportBinding bind = DialogReportBinding.bind(v2);
AppCompatImageView closeBtn = bind.f5569a;
Intrinsics.checkNotNullExpressionValue(closeBtn, "closeBtn");
ViewKt.doOnClick$default((View) closeBtn, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
BottomDialog bottomDialog = BottomDialog.this;
if (bottomDialog != null) {
bottomDialog.dismiss();
}
}
}, 2, (Object) null);
SleTextButton reportBtn = bind.f5571c;
Intrinsics.checkNotNullExpressionValue(reportBtn, "reportBtn");
ViewKt.doOnClick$default((View) reportBtn, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
AppCompatEditText reportEt = DialogReportBinding.this.f5572d;
Intrinsics.checkNotNullExpressionValue(reportEt, "reportEt");
if (StringsKt.trim((CharSequence) reportEt.getText().toString()).toString().length() == 0) {
DialogExtKt.showTip$default("😭 请输入问题描述哦", true, 0, 4, null);
return;
}
Function2<String, String, Unit> function22 = function2;
AppCompatEditText reportEt2 = DialogReportBinding.this.f5572d;
Intrinsics.checkNotNullExpressionValue(reportEt2, "reportEt");
String obj = reportEt2.getText().toString();
AppCompatEditText contactEt = DialogReportBinding.this.f5570b;
Intrinsics.checkNotNullExpressionValue(contactEt, "contactEt");
function22.mo1invoke(obj, contactEt.getText().toString());
BottomDialog bottomDialog = dialog;
if (bottomDialog != null) {
bottomDialog.dismiss();
}
}
}, 2, (Object) null);
}
}
}).setAllowInterceptTouch(false).show();
}
public static final void showTip(@NotNull final String msg, boolean z2, int i) {
Intrinsics.checkNotNullParameter(msg, "msg");
if (StringsKt.trim((CharSequence) msg).toString().length() == 0) {
return;
}
PopTip.build(IOSStyle.style()).setCustomView(new OnBindView<PopTip>() {
{
super(R.layout.pop_tip_custom);
}
@Override
public void onBind(@Nullable PopTip dialog, @Nullable View v2) {
if (v2 != null) {
PopTipCustomBinding.bind(v2).f5945a.setText(msg);
}
}
}).setBackgroundColorRes(z2 ? R.color.colorThemeEmphasis : R.color.customTheme80).show().autoDismiss(i * 1000);
}
public static void showTip$default(String str, boolean z2, int i, int i2, Object obj) {
if ((i2 & 2) != 0) {
z2 = false;
}
if ((i2 & 4) != 0) {
i = 2;
}
showTip(str, z2, i);
}
public static final void showWheelPickerDialog(@NotNull final List<String> items, final int i, @NotNull final Function1<? super Integer, Unit> callback) {
Intrinsics.checkNotNullParameter(items, "items");
Intrinsics.checkNotNullParameter(callback, "callback");
BottomDialog.build().setCustomView(new OnBindView<BottomDialog>() {
{
super(R.layout.dialog_wheel_picker);
}
@Override
public void onBind(@Nullable final BottomDialog dialog, @Nullable View v2) {
if (v2 != null) {
List<String> list = items;
int i2 = i;
final Function1<Integer, Unit> function1 = callback;
final DialogWheelPickerBinding bind = DialogWheelPickerBinding.bind(v2);
LoopView onBind$lambda$2$lambda$1$lambda$0 = bind.f5574a;
Intrinsics.checkNotNullExpressionValue(onBind$lambda$2$lambda$1$lambda$0, "onBind$lambda$2$lambda$1$lambda$0");
onBind$lambda$2$lambda$1$lambda$0.setDividerColor(ResouresKt.getCompatColor(onBind$lambda$2$lambda$1$lambda$0, R.color.colorBorder));
onBind$lambda$2$lambda$1$lambda$0.setCenterTextColor(ResouresKt.getCompatColor(onBind$lambda$2$lambda$1$lambda$0, R.color.colorFore));
onBind$lambda$2$lambda$1$lambda$0.setOuterTextColor(ResouresKt.getCompatColor(onBind$lambda$2$lambda$1$lambda$0, R.color.colorFore3));
onBind$lambda$2$lambda$1$lambda$0.setItems(list);
onBind$lambda$2$lambda$1$lambda$0.setInitPosition(i2);
SleTextButton sleTextButton = bind.f5575b;
Intrinsics.checkNotNullExpressionValue(sleTextButton, "it.submitBtn");
ViewKt.doOnClick$default((View) sleTextButton, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
function1.invoke(Integer.valueOf(bind.f5574a.getSelectedItem()));
BottomDialog bottomDialog = dialog;
if (bottomDialog != null) {
bottomDialog.dismiss();
}
}
}, 2, (Object) null);
}
}
}).setAllowInterceptTouch(false).show();
}
}