无痛单词 v1.8.1版本的 MD5 值为:7ae56c6858542fe70230b6be4f1a4b5a
以下内容为反编译后的 JoinProActivity.java 源代码,内容仅作参考
package tech.xiangzi.painless.ui.activity;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Typeface;
import android.net.wifi.ApplicationKt;
import android.net.wifi.IntentsKt;
import android.net.wifi.ResouresKt;
import android.net.wifi.TextViewKt;
import android.net.wifi.ViewKt;
import android.os.Handler;
import android.os.Looper;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.core.app.NotificationCompat;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewbinding.ViewBinding;
import com.drake.brv.BindingAdapter;
import com.drake.brv.DefaultDecoration;
import com.drake.brv.annotaion.DividerOrientation;
import com.drake.brv.utils.RecyclerUtilsKt;
import com.freddy.silhouette.ext.DensityExtKt;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import java.util.ArrayList;
import java.util.List;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlin.jvm.internal.SourceDebugExtension;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import tech.xiangzi.painless.R;
import tech.xiangzi.painless.data.ConstantKt;
import tech.xiangzi.painless.data.remote.model.MembershipBean;
import tech.xiangzi.painless.data.remote.model.SettingNormalBean;
import tech.xiangzi.painless.data.remote.response.WXPayResponse;
import tech.xiangzi.painless.databinding.ActivityJoinProBinding;
import tech.xiangzi.painless.databinding.ListItemMembershipPrivateRightBinding;
import tech.xiangzi.painless.ui.LooperLayoutManager;
import tech.xiangzi.painless.ui.activity.JoinProActivity;
import tech.xiangzi.painless.ui.widgets.RoundedBlurView;
import tech.xiangzi.painless.ui.widgets.SpacesItemDecoration;
import tech.xiangzi.painless.utils.CacheUtil;
import tech.xiangzi.painless.utils.bus.FlowBus;
import tech.xiangzi.painless.utils.ext.CustomExtKt;
import tech.xiangzi.painless.utils.ext.DialogExtKt;
import tech.xiangzi.painless.utils.ext.FormatExtKt;
import tech.xiangzi.painless.utils.ext.TextExtKt;
import tech.xiangzi.painless.utils.spannable.SpanDsl;
import tech.xiangzi.painless.utils.spannable.SpannableXKt;
import tech.xiangzi.painless.vdb.DataBindingConfig;
import tech.xiangzi.painless.vdb.JoinProData;
import tech.xiangzi.painless.vm.UserViewModel;
@Metadata(d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0006\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0001$B\u0005¢\u0006\u0002\u0010\u0003J\u0012\u0010\u0018\u001a\u00020\u00192\b\u0010\u001a\u001a\u0004\u0018\u00010\u001bH\u0016J\b\u0010\u001c\u001a\u00020\u001dH\u0016J\b\u0010\u001e\u001a\u00020\u001fH\u0016J\b\u0010 \u001a\u00020\u001fH\u0014J\u0012\u0010!\u001a\u00020\u001f2\b\b\u0002\u0010\"\u001a\u00020\u0019H\u0002J\b\u0010#\u001a\u00020\u001fH\u0016R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u001b\u0010\u0006\u001a\u00020\u00078BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\n\u0010\u000b\u001a\u0004\b\b\u0010\tR\u001b\u0010\f\u001a\u00020\r8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0010\u0010\u000b\u001a\u0004\b\u000e\u0010\u000fR\u000e\u0010\u0011\u001a\u00020\u0012X\u0082\u0004¢\u0006\u0002\n\u0000R\u001b\u0010\u0013\u001a\u00020\u00148BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0017\u0010\u000b\u001a\u0004\b\u0015\u0010\u0016¨\u0006%"}, d2 = {"Ltech/xiangzi/painless/ui/activity/JoinProActivity;", "Ltech/xiangzi/painless/ui/base/BaseDBActivity;", "Ltech/xiangzi/painless/databinding/ActivityJoinProBinding;", "()V", "autoLoopHandler", "Landroid/os/Handler;", "couponEndTime", "", "getCouponEndTime", "()J", "couponEndTime$delegate", "Lkotlin/Lazy;", "joinProData", "Ltech/xiangzi/painless/vdb/JoinProData;", "getJoinProData", "()Ltech/xiangzi/painless/vdb/JoinProData;", "joinProData$delegate", "scrollRunnable", "Ljava/lang/Runnable;", "userViewModel", "Ltech/xiangzi/painless/vm/UserViewModel;", "getUserViewModel", "()Ltech/xiangzi/painless/vm/UserViewModel;", "userViewModel$delegate", "dispatchKeyEvent", "", NotificationCompat.CATEGORY_EVENT, "Landroid/view/KeyEvent;", "getDataBindingConfig", "Ltech/xiangzi/painless/vdb/DataBindingConfig;", "initView", "", "onDestroy", "payCallback", "success", "startObserve", "ClickProxy", "app_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
@SourceDebugExtension({"SMAP\nJoinProActivity.kt\nKotlin\n*S Kotlin\n*F\n+ 1 JoinProActivity.kt\ntech/xiangzi/painless/ui/activity/JoinProActivity\n+ 2 ActivityViewModelLazy.kt\nandroidx/activity/ActivityViewModelLazyKt\n+ 3 ImmersionBar.kt\ncom/gyf/immersionbar/ktx/ImmersionBarKt\n+ 4 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 5 Activity.kt\ncom/dylanc/longan/ActivityKt\n+ 6 Application.kt\ncom/dylanc/longan/ApplicationKt\n+ 7 Screen.kt\ncom/dylanc/longan/ScreenKt\n+ 8 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,399:1\n75#2,13:400\n18#3,2:413\n1#4:415\n160#5:416\n162#5:422\n162#5:423\n162#5:424\n162#5:425\n51#6:417\n44#6:418\n41#6:419\n27#7:420\n27#7:421\n819#8:426\n847#8,2:427\n*S KotlinDebug\n*F\n+ 1 JoinProActivity.kt\ntech/xiangzi/painless/ui/activity/JoinProActivity\n*L\n67#1:400,13\n96#1:413,2\n96#1:415\n101#1:416\n193#1:422\n200#1:423\n206#1:424\n207#1:425\n105#1:417\n105#1:418\n105#1:419\n107#1:420\n108#1:421\n221#1:426\n221#1:427,2\n*E\n"})
public final class JoinProActivity extends Hilt_JoinProActivity<ActivityJoinProBinding> {
@NotNull
private final Lazy userViewModel;
@NotNull
private final Lazy joinProData = LazyKt.lazy(new Function0<JoinProData>() {
@Override
@NotNull
public final JoinProData invoke() {
return new JoinProData();
}
});
@NotNull
private final Lazy couponEndTime = LazyKt.lazy(new Function0<Long>() {
@Override
@NotNull
public final Long invoke() {
return Long.valueOf(com.blankj.utilcode.util.h.a(1000, CacheUtil.INSTANCE.getCouponEndTimeMillis()));
}
});
@NotNull
private final Handler autoLoopHandler = new Handler(Looper.getMainLooper());
@NotNull
private final Runnable scrollRunnable = new Runnable() {
@Override
public void run() {
Handler handler;
JoinProActivity.access$getBinding(JoinProActivity.this).i.scrollBy(2, 0);
handler = JoinProActivity.this.autoLoopHandler;
handler.postDelayed(this, 10L);
}
};
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0006\b\u0086\u0004\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0006\u0010\u0003\u001a\u00020\u0004J\u0006\u0010\u0005\u001a\u00020\u0004J\u0006\u0010\u0006\u001a\u00020\u0004J\u0006\u0010\u0007\u001a\u00020\u0004J\u0006\u0010\b\u001a\u00020\u0004J\u0006\u0010\t\u001a\u00020\u0004¨\u0006\n"}, d2 = {"Ltech/xiangzi/painless/ui/activity/JoinProActivity$ClickProxy;", "", "(Ltech/xiangzi/painless/ui/activity/JoinProActivity;)V", "chooseEver", "", "chooseYear", "goBack", "pay", "toConditions", "toPrivacy", "app_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
@SourceDebugExtension({"SMAP\nJoinProActivity.kt\nKotlin\n*S Kotlin\n*F\n+ 1 JoinProActivity.kt\ntech/xiangzi/painless/ui/activity/JoinProActivity$ClickProxy\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,399:1\n1#2:400\n*E\n"})
public final class ClickProxy {
public ClickProxy() {
}
public final void chooseEver() {
JoinProActivity.this.getJoinProData().updateProductRadio(1);
}
public final void chooseYear() {
JoinProActivity.this.getJoinProData().updateProductRadio(0);
}
public final void goBack() {
if (CacheUtil.INSTANCE.getFirstStartHomeTimeMillis() == 0) {
com.blankj.utilcode.util.a.a(R.anim.fade_in, R.anim.slide_out_bottom, MainActivity.class);
}
JoinProActivity.this.finish();
}
public final void pay() {
String str;
if (JoinProActivity.access$getBinding(JoinProActivity.this).f5396n.isChecked()) {
String str2 = JoinProActivity.this.getJoinProData().getFinalPayId().get();
if (str2 != null) {
JoinProActivity.this.getUserViewModel().getOrderForWX(str2);
return;
}
return;
}
if (!JoinProActivity.access$getBinding(JoinProActivity.this).f5386b.isChecked() || (str = JoinProActivity.this.getJoinProData().getFinalPayId().get()) == null) {
return;
}
JoinProActivity.this.getUserViewModel().getOrderForAli(str);
}
public final void toConditions() {
IntentsKt.browse$default("https://xiangzi.tech/terms-and-conditions-cn.html", false, 2, null);
}
public final void toPrivacy() {
IntentsKt.browse$default("https://www.xiangzi.tech/privacy-policy-cn.html", false, 2, null);
}
}
public JoinProActivity() {
final Function0 function0 = null;
this.userViewModel = new ViewModelLazy(Reflection.getOrCreateKotlinClass(UserViewModel.class), new Function0<ViewModelStore>() {
{
super(0);
}
@Override
@NotNull
public final ViewModelStore invoke() {
ViewModelStore viewModelStore = ComponentActivity.this.getViewModelStore();
Intrinsics.checkNotNullExpressionValue(viewModelStore, "viewModelStore");
return viewModelStore;
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
@Override
@NotNull
public final ViewModelProvider.Factory invoke() {
ViewModelProvider.Factory defaultViewModelProviderFactory = ComponentActivity.this.getDefaultViewModelProviderFactory();
Intrinsics.checkNotNullExpressionValue(defaultViewModelProviderFactory, "defaultViewModelProviderFactory");
return defaultViewModelProviderFactory;
}
}, new Function0<CreationExtras>() {
{
super(0);
}
@Override
@NotNull
public final CreationExtras invoke() {
CreationExtras creationExtras;
Function0 function02 = Function0.this;
if (function02 != null && (creationExtras = (CreationExtras) function02.invoke()) != null) {
return creationExtras;
}
CreationExtras defaultViewModelCreationExtras = this.getDefaultViewModelCreationExtras();
Intrinsics.checkNotNullExpressionValue(defaultViewModelCreationExtras, "this.defaultViewModelCreationExtras");
return defaultViewModelCreationExtras;
}
});
}
public static final ActivityJoinProBinding access$getBinding(JoinProActivity joinProActivity) {
return (ActivityJoinProBinding) joinProActivity.getBinding();
}
private final long getCouponEndTime() {
return ((Number) this.couponEndTime.getValue()).longValue();
}
public final JoinProData getJoinProData() {
return (JoinProData) this.joinProData.getValue();
}
public final UserViewModel getUserViewModel() {
return (UserViewModel) this.userViewModel.getValue();
}
public static final boolean initView$lambda$6$lambda$5$lambda$4(ActivityJoinProBinding this_with, View view, MotionEvent motionEvent) {
Intrinsics.checkNotNullParameter(this_with, "$this_with");
return this_with.f5393k.onTouchEvent(motionEvent);
}
public final void payCallback(boolean success) {
getUserViewModel().getUserInfo();
}
public static void payCallback$default(JoinProActivity joinProActivity, boolean z2, int i, Object obj) {
if ((i & 1) != 0) {
z2 = true;
}
joinProActivity.payCallback(z2);
}
@Override
public boolean dispatchKeyEvent(@Nullable KeyEvent event) {
if (event == null) {
return false;
}
if (event.getKeyCode() == 4) {
return true;
}
return super.dispatchKeyEvent(event);
}
@Override
@NotNull
public DataBindingConfig getDataBindingConfig() {
return new DataBindingConfig(R.layout.activity_join_pro).addBindingParams(4, getJoinProData()).addBindingParams(3, new ClickProxy());
}
@Override
public void initView() {
int i = 0;
com.gyf.immersionbar.g t2 = com.gyf.immersionbar.g.t(this, false);
Intrinsics.checkNotNullExpressionValue(t2, "this");
t2.e();
CacheUtil cacheUtil = CacheUtil.INSTANCE;
t2.q(cacheUtil.getUiMode() != 1);
t2.g();
getJoinProData().updatePrice(this, cacheUtil.getYearPrice(), cacheUtil.getAfterCouponPrice(), cacheUtil.getOriginalPrice());
getUserViewModel().m1918getMembershipPrice();
final ActivityJoinProBinding activityJoinProBinding = (ActivityJoinProBinding) getBinding();
AppCompatTextView appCompatTextView = activityJoinProBinding.f5387c;
StringBuilder sb = new StringBuilder("Painless ");
PackageManager packageManager = ApplicationKt.getApplication().getPackageManager();
String packageName = ApplicationKt.getApplication().getPackageName();
Intrinsics.checkNotNullExpressionValue(packageName, "application.packageName");
PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0);
Intrinsics.checkNotNullExpressionValue(packageInfo, "application.packageManag…ckageInfo(packageName, 0)");
String str = packageInfo.versionName;
Intrinsics.checkNotNullExpressionValue(str, "packageInfo.versionName");
sb.append(str);
appCompatTextView.setText(sb.toString());
activityJoinProBinding.f5388d.setLayoutParams(new RelativeLayout.LayoutParams(ApplicationKt.getApplication().getResources().getDisplayMetrics().widthPixels, ApplicationKt.getApplication().getResources().getDisplayMetrics().widthPixels));
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ApplicationKt.getApplication().getResources().getDisplayMetrics().widthPixels, CustomExtKt.dp2px(100) + ApplicationKt.getApplication().getResources().getDisplayMetrics().widthPixels);
RelativeLayout relativeLayout = activityJoinProBinding.f5394l;
relativeLayout.setLayoutParams(layoutParams);
if (getCouponEndTime() > 0) {
AppCompatTextView couponDescTv = activityJoinProBinding.f5389e;
Intrinsics.checkNotNullExpressionValue(couponDescTv, "couponDescTv");
TextViewKt.startCountDown(couponDescTv, this, (int) getCouponEndTime(), 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 i2) {
Intrinsics.checkNotNullParameter(startCountDown, "$this$startCountDown");
final String formatNumberWithZero = FormatExtKt.formatNumberWithZero(i2 / 3600);
final String formatNumberWithZero2 = FormatExtKt.formatNumberWithZero((i2 % 3600) / 60);
final String formatNumberWithZero3 = FormatExtKt.formatNumberWithZero(i2 % 60);
ActivityJoinProBinding.this.f5389e.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 sb2 = new StringBuilder("限时折扣 ");
sb2.append(formatNumberWithZero);
sb2.append(" 时 ");
sb2.append(formatNumberWithZero2);
sb2.append(" 分 ");
String p2 = androidx.activity.result.b.p(sb2, formatNumberWithZero3, " 秒后结束");
final TextView textView = startCountDown;
final String str2 = formatNumberWithZero;
final String str3 = formatNumberWithZero2;
final String str4 = 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(str2));
span.typeface(span, Typeface.create(ResouresKt.getCompatFont(textView, R.font.roboto_black), 0), null, String.valueOf(str3));
span.typeface(span, Typeface.create(ResouresKt.getCompatFont(textView, R.font.roboto_black), 0), null, String.valueOf(str4));
span.color(span, ResouresKt.getCompatColor(textView, R.color.colorThemeEmphasis), CollectionsKt.listOf((Object[]) new String[]{String.valueOf(str2), String.valueOf(str3), String.valueOf(str4)}));
}
}, 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");
JoinProActivity.this.getJoinProData().updateCouponState(true);
}
});
}
eightbitlab.com.blurview.g gVar = new eightbitlab.com.blurview.g(this);
RoundedBlurView roundedBlurView = activityJoinProBinding.f5397o;
roundedBlurView.setupWith(relativeLayout, gVar).e(25.0f);
roundedBlurView.setEnabled(getJoinProData().getCanPay().get());
eightbitlab.com.blurview.g gVar2 = new eightbitlab.com.blurview.g(this);
RoundedBlurView roundedBlurView2 = activityJoinProBinding.f;
roundedBlurView2.setupWith(relativeLayout, gVar2).e(25.0f);
roundedBlurView2.setEnabled(getJoinProData().getCanPay().get());
AppCompatTextView yearPayedText = activityJoinProBinding.f5398p;
Intrinsics.checkNotNullExpressionValue(yearPayedText, "yearPayedText");
TextExtKt.addDrawable$default(yearPayedText, this, R.drawable.ic_check_white, CustomExtKt.dp2px(30), CustomExtKt.dp2px(5), 0, 16, null);
AppCompatTextView everPayedText = activityJoinProBinding.f5390g;
Intrinsics.checkNotNullExpressionValue(everPayedText, "everPayedText");
TextExtKt.addDrawable$default(everPayedText, this, R.drawable.ic_check_white, CustomExtKt.dp2px(30), CustomExtKt.dp2px(5), 0, 16, null);
LooperLayoutManager looperLayoutManager = new LooperLayoutManager();
final RecyclerView initView$lambda$6$lambda$5 = activityJoinProBinding.i;
initView$lambda$6$lambda$5.setLayoutManager(looperLayoutManager);
Intrinsics.checkNotNullExpressionValue(initView$lambda$6$lambda$5, "initView$lambda$6$lambda$5");
RecyclerUtilsKt.setup(initView$lambda$6$lambda$5, 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", SettingNormalBean.class);
final int i2 = R.layout.list_item_membership_private_right;
if (C) {
bindingAdapter.addInterfaceType(SettingNormalBean.class, new Function2<Object, Integer, Integer>() {
{
super(2);
}
@NotNull
public final Integer invoke(@NotNull Object addInterfaceType, int i3) {
Intrinsics.checkNotNullParameter(addInterfaceType, "$this$addInterfaceType");
return Integer.valueOf(i2);
}
@Override
public Integer mo1invoke(Object obj, Integer num) {
return invoke(obj, num.intValue());
}
});
} else {
bindingAdapter.getTypePool().put(SettingNormalBean.class, new Function2<Object, Integer, Integer>() {
{
super(2);
}
@NotNull
public final Integer invoke(@NotNull Object obj, int i3) {
Intrinsics.checkNotNullParameter(obj, "$this$null");
return Integer.valueOf(i2);
}
@Override
public Integer mo1invoke(Object obj, Integer num) {
return invoke(obj, num.intValue());
}
});
}
final RecyclerView recyclerView2 = RecyclerView.this;
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) {
ListItemMembershipPrivateRightBinding listItemMembershipPrivateRightBinding;
Intrinsics.checkNotNullParameter(onBind, "$this$onBind");
SettingNormalBean settingNormalBean = (SettingNormalBean) onBind.getModel();
if (onBind.getViewBinding() == null) {
Object invoke = ListItemMembershipPrivateRightBinding.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.ListItemMembershipPrivateRightBinding");
}
listItemMembershipPrivateRightBinding = (ListItemMembershipPrivateRightBinding) invoke;
onBind.setViewBinding(listItemMembershipPrivateRightBinding);
} else {
ViewBinding viewBinding = onBind.getViewBinding();
if (viewBinding == null) {
throw new NullPointerException("null cannot be cast to non-null type tech.xiangzi.painless.databinding.ListItemMembershipPrivateRightBinding");
}
listItemMembershipPrivateRightBinding = (ListItemMembershipPrivateRightBinding) viewBinding;
}
RecyclerView invoke$lambda$0 = RecyclerView.this;
listItemMembershipPrivateRightBinding.r(settingNormalBean);
Intrinsics.checkNotNullExpressionValue(invoke$lambda$0, "invoke$lambda$0");
listItemMembershipPrivateRightBinding.f5819b.setTextColor(ResouresKt.getCompatColor(invoke$lambda$0, Intrinsics.areEqual(settingNormalBean.getTitle(), "敬请期待") ? R.color.colorFore3 : R.color.colorFore));
}
});
}
});
List<SettingNormalBean> membership_private_right = ConstantKt.getMEMBERSHIP_PRIVATE_RIGHT();
ArrayList arrayList = new ArrayList();
for (Object obj : membership_private_right) {
if (!Intrinsics.areEqual(((SettingNormalBean) obj).getTitle(), "敬请期待")) {
arrayList.add(obj);
}
}
RecyclerUtilsKt.setModels(initView$lambda$6$lambda$5, arrayList);
initView$lambda$6$lambda$5.addItemDecoration(new SpacesItemDecoration(DensityExtKt.getDp(6), 0));
initView$lambda$6$lambda$5.setOnTouchListener(new f(activityJoinProBinding, i));
this.autoLoopHandler.postDelayed(this.scrollRunnable, 1000L);
RecyclerView membershipPrivateRightGrid = activityJoinProBinding.f5391h;
Intrinsics.checkNotNullExpressionValue(membershipPrivateRightGrid, "membershipPrivateRightGrid");
RecyclerUtilsKt.setup(RecyclerUtilsKt.divider(RecyclerUtilsKt.grid$default(membershipPrivateRightGrid, 5, 0, false, false, 14, 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(6, true);
divider.setOrientation(DividerOrientation.GRID);
}
}), 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", SettingNormalBean.class);
final int i2 = R.layout.list_item_membership_private_right;
if (C) {
bindingAdapter.addInterfaceType(SettingNormalBean.class, new Function2<Object, Integer, Integer>() {
{
super(2);
}
@NotNull
public final Integer invoke(@NotNull Object addInterfaceType, int i3) {
Intrinsics.checkNotNullParameter(addInterfaceType, "$this$addInterfaceType");
return Integer.valueOf(i2);
}
@Override
public Integer mo1invoke(Object obj2, Integer num) {
return invoke(obj2, num.intValue());
}
});
} else {
bindingAdapter.getTypePool().put(SettingNormalBean.class, new Function2<Object, Integer, Integer>() {
{
super(2);
}
@NotNull
public final Integer invoke(@NotNull Object obj2, int i3) {
Intrinsics.checkNotNullParameter(obj2, "$this$null");
return Integer.valueOf(i2);
}
@Override
public Integer mo1invoke(Object obj2, Integer num) {
return invoke(obj2, num.intValue());
}
});
}
final JoinProActivity joinProActivity = JoinProActivity.this;
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) {
ListItemMembershipPrivateRightBinding listItemMembershipPrivateRightBinding;
Intrinsics.checkNotNullParameter(onBind, "$this$onBind");
SettingNormalBean settingNormalBean = (SettingNormalBean) onBind.getModel();
if (onBind.getViewBinding() == null) {
Object invoke = ListItemMembershipPrivateRightBinding.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.ListItemMembershipPrivateRightBinding");
}
listItemMembershipPrivateRightBinding = (ListItemMembershipPrivateRightBinding) invoke;
onBind.setViewBinding(listItemMembershipPrivateRightBinding);
} else {
ViewBinding viewBinding = onBind.getViewBinding();
if (viewBinding == null) {
throw new NullPointerException("null cannot be cast to non-null type tech.xiangzi.painless.databinding.ListItemMembershipPrivateRightBinding");
}
listItemMembershipPrivateRightBinding = (ListItemMembershipPrivateRightBinding) viewBinding;
}
JoinProActivity joinProActivity2 = JoinProActivity.this;
listItemMembershipPrivateRightBinding.r(settingNormalBean);
listItemMembershipPrivateRightBinding.f5819b.setTextColor(ResouresKt.getCompatColor(joinProActivity2, Intrinsics.areEqual(settingNormalBean.getTitle(), "敬请期待") ? R.color.colorFore3 : R.color.colorFore));
}
});
}
}).setModels(ConstantKt.getMEMBERSHIP_PRIVATE_RIGHT());
activityJoinProBinding.f5392j.check(R.id.wx_pay_rb);
LinearLayout wxPayLl = activityJoinProBinding.f5395m;
Intrinsics.checkNotNullExpressionValue(wxPayLl, "wxPayLl");
ViewKt.doOnClick$default((View) wxPayLl, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
if (ActivityJoinProBinding.this.f5396n.isChecked()) {
return;
}
ActivityJoinProBinding.this.f5392j.check(R.id.wx_pay_rb);
}
}, 2, (Object) null);
LinearLayout alipayLl = activityJoinProBinding.f5385a;
Intrinsics.checkNotNullExpressionValue(alipayLl, "alipayLl");
ViewKt.doOnClick$default((View) alipayLl, 1000, false, (Function0) new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
if (ActivityJoinProBinding.this.f5386b.isChecked()) {
return;
}
ActivityJoinProBinding.this.f5392j.check(R.id.alipay_rb);
}
}, 2, (Object) null);
}
@Override
public void onDestroy() {
this.autoLoopHandler.removeCallbacks(this.scrollRunnable);
super.onDestroy();
}
@Override
public void startObserve() {
getUserViewModel().getMembershipPrice().observe(this, new JoinProActivity$sam$androidx_lifecycle_Observer$0(new Function1<List<? extends MembershipBean>, Unit>() {
{
super(1);
}
@Override
public Unit invoke(List<? extends MembershipBean> list) {
invoke2((List<MembershipBean>) list);
return Unit.INSTANCE;
}
public final void invoke2(List<MembershipBean> beans) {
Intrinsics.checkNotNullExpressionValue(beans, "beans");
for (MembershipBean membershipBean : beans) {
String productId = membershipBean.getProductId();
int hashCode = productId.hashCode();
if (hashCode != -920831742) {
if (hashCode != 1657294318) {
if (hashCode == 1657873677 && productId.equals("painless_year")) {
CacheUtil.INSTANCE.setYearPrice(membershipBean.getTotalAmount() / 100);
}
} else if (productId.equals("painless_ever")) {
CacheUtil.INSTANCE.setAfterCouponPrice(membershipBean.getTotalAmount() / 100);
}
} else if (productId.equals("painless_ever_original")) {
CacheUtil.INSTANCE.setOriginalPrice(membershipBean.getTotalAmount() / 100);
}
}
JoinProData joinProData = JoinProActivity.this.getJoinProData();
JoinProActivity joinProActivity = JoinProActivity.this;
CacheUtil cacheUtil = CacheUtil.INSTANCE;
joinProData.updatePrice(joinProActivity, cacheUtil.getYearPrice(), cacheUtil.getAfterCouponPrice(), cacheUtil.getOriginalPrice());
}
}));
FlowBus flowBus = FlowBus.INSTANCE;
flowBus.with(ConstantKt.WX_PAY_RESULT).register(this, new Function1<BaseResp, Unit>() {
{
super(1);
}
@Override
public Unit invoke(BaseResp baseResp) {
invoke2(baseResp);
return Unit.INSTANCE;
}
public final void invoke2(@NotNull BaseResp it) {
Intrinsics.checkNotNullParameter(it, "it");
if (it.errCode == 0) {
JoinProActivity.payCallback$default(JoinProActivity.this, false, 1, null);
} else {
DialogExtKt.showTip$default("支付失败", true, 0, 4, null);
}
}
});
getUserViewModel().getAliOrderInfo().observe(this, new JoinProActivity$sam$androidx_lifecycle_Observer$0(new Function1<String, Unit>() {
{
super(1);
}
@Override
public Unit invoke(String str) {
invoke2(str);
return Unit.INSTANCE;
}
public final void invoke2(String it) {
JoinProActivity joinProActivity = JoinProActivity.this;
Intrinsics.checkNotNullExpressionValue(it, "it");
final JoinProActivity joinProActivity2 = JoinProActivity.this;
CustomExtKt.startAliPay(joinProActivity, it, CustomExtKt.initAliHandler(new Function0<Unit>() {
{
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.INSTANCE;
}
public final void invoke2() {
JoinProActivity.payCallback$default(JoinProActivity.this, false, 1, null);
}
}));
}
}));
getUserViewModel().getWxOrderInfo().observe(this, new JoinProActivity$sam$androidx_lifecycle_Observer$0(new Function1<WXPayResponse, Unit>() {
{
super(1);
}
@Override
public Unit invoke(WXPayResponse wXPayResponse) {
invoke2(wXPayResponse);
return Unit.INSTANCE;
}
public final void invoke2(WXPayResponse wXPayResponse) {
CustomExtKt.startWXPay(JoinProActivity.this, wXPayResponse);
}
}));
flowBus.with(ConstantKt.PAY_RESULT_ERROR).register(this, new Function1<Integer, Unit>() {
{
super(1);
}
@Override
public Unit invoke(Integer num) {
invoke(num.intValue());
return Unit.INSTANCE;
}
public final void invoke(int i) {
if (i == 1) {
JoinProActivity.this.payCallback(false);
}
}
});
flowBus.with(ConstantKt.LOGIN_STATE).register(this, new Function1<Integer, Unit>() {
{
super(1);
}
@Override
public Unit invoke(Integer num) {
invoke(num.intValue());
return Unit.INSTANCE;
}
public final void invoke(int i) {
if (i == 2) {
new JoinProActivity.ClickProxy().goBack();
}
}
});
}
}