405 lines
22 KiB
Java
405 lines
22 KiB
Java
|
package com.discord.widgets.servers.premiumguild;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.content.Intent;
|
||
|
import android.content.res.Resources;
|
||
|
import android.view.View;
|
||
|
import android.view.ViewGroup;
|
||
|
import android.widget.ImageView;
|
||
|
import android.widget.ProgressBar;
|
||
|
import android.widget.TextView;
|
||
|
import androidx.activity.result.ActivityResultLauncher;
|
||
|
import androidx.fragment.app.Fragment;
|
||
|
import androidx.fragment.app.FragmentManager;
|
||
|
import androidx.fragment.app.FragmentViewModelLazyKt;
|
||
|
import androidx.viewpager.widget.PagerAdapter;
|
||
|
import androidx.viewpager.widget.ViewPager;
|
||
|
import c.a.d.f;
|
||
|
import c.a.d.h0;
|
||
|
import c.a.d.j0;
|
||
|
import c.a.d.l;
|
||
|
import c.a.d.o;
|
||
|
import c.a.k.b;
|
||
|
import c.d.b.a.a;
|
||
|
import com.discord.app.AppActivity;
|
||
|
import com.discord.app.AppFragment;
|
||
|
import com.discord.app.AppViewFlipper;
|
||
|
import com.discord.databinding.WidgetServerBoostStatusBinding;
|
||
|
import com.discord.stores.StoreStream;
|
||
|
import com.discord.utilities.analytics.Traits;
|
||
|
import com.discord.utilities.billing.GooglePlayBillingManager;
|
||
|
import com.discord.utilities.color.ColorCompat;
|
||
|
import com.discord.utilities.dimen.DimenUtils;
|
||
|
import com.discord.utilities.premium.PremiumGuildSubscriptionUtils;
|
||
|
import com.discord.utilities.resources.StringResourceUtilsKt;
|
||
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
||
|
import com.discord.utilities.simple_pager.SimplePager;
|
||
|
import com.discord.utilities.view.text.LinkifiedTextView;
|
||
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
||
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
||
|
import com.discord.widgets.notice.WidgetNoticeDialog;
|
||
|
import com.discord.widgets.servers.premiumguild.PremiumGuildViewModel;
|
||
|
import com.discord.widgets.settings.premium.WidgetChoosePlan;
|
||
|
import d0.g;
|
||
|
import d0.t.g0;
|
||
|
import d0.t.n;
|
||
|
import d0.z.d.a0;
|
||
|
import d0.z.d.m;
|
||
|
import java.util.List;
|
||
|
import java.util.Objects;
|
||
|
import kotlin.Lazy;
|
||
|
import kotlin.jvm.functions.Function0;
|
||
|
import kotlin.jvm.functions.Function1;
|
||
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||
|
import kotlin.reflect.KProperty;
|
||
|
import rx.Observable;
|
||
|
/* compiled from: WidgetPremiumGuildSubscription.kt */
|
||
|
public final class WidgetPremiumGuildSubscription extends AppFragment {
|
||
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.V(WidgetPremiumGuildSubscription.class, "binding", "getBinding()Lcom/discord/databinding/WidgetServerBoostStatusBinding;", 0)};
|
||
|
public static final Companion Companion = new Companion(null);
|
||
|
private static final String INTENT_EXTRA_GUILD_ID = "GUILD_ID";
|
||
|
private static final int VIEW_INDEX_LOADED = 2;
|
||
|
private static final int VIEW_INDEX_LOADING = 0;
|
||
|
private static final int VIEW_INDEX_LOAD_FAILED = 1;
|
||
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetPremiumGuildSubscription$binding$2.INSTANCE, null, 2, null);
|
||
|
private final ActivityResultLauncher<Intent> choosePlanLauncher;
|
||
|
private final Lazy guildId$delegate;
|
||
|
private List<? extends ImageView> levelBackgrounds;
|
||
|
private List<? extends TextView> levelText;
|
||
|
private PerksPagerAdapter pagerAdapter;
|
||
|
private final Lazy viewModel$delegate;
|
||
|
private boolean wasPagerPageSet;
|
||
|
|
||
|
/* compiled from: WidgetPremiumGuildSubscription.kt */
|
||
|
public static final class Companion {
|
||
|
private Companion() {
|
||
|
}
|
||
|
|
||
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||
|
this();
|
||
|
}
|
||
|
|
||
|
public final void create(Context context, long j) {
|
||
|
m.checkNotNullParameter(context, "context");
|
||
|
Intent putExtra = new Intent().putExtra("GUILD_ID", j);
|
||
|
m.checkNotNullExpressionValue(putExtra, "Intent().putExtra(INTENT_EXTRA_GUILD_ID, guildId)");
|
||
|
l.d(context, WidgetPremiumGuildSubscription.class, putExtra);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* compiled from: WidgetPremiumGuildSubscription.kt */
|
||
|
public static final class PerksPagerAdapter extends PagerAdapter {
|
||
|
private int premiumTier;
|
||
|
private int subscriptionCount;
|
||
|
|
||
|
public final void configureViews(ViewPager viewPager) {
|
||
|
m.checkNotNullParameter(viewPager, "viewPager");
|
||
|
int childCount = viewPager.getChildCount();
|
||
|
for (int i = 0; i < childCount; i++) {
|
||
|
View childAt = viewPager.getChildAt(i);
|
||
|
m.checkExpressionValueIsNotNull(childAt, "getChildAt(index)");
|
||
|
Object tag = childAt.getTag();
|
||
|
Objects.requireNonNull(tag, "null cannot be cast to non-null type kotlin.Int");
|
||
|
((PremiumGuildSubscriptionPerkView) childAt).configure(((Integer) tag).intValue(), this.premiumTier);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // androidx.viewpager.widget.PagerAdapter
|
||
|
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
|
||
|
m.checkNotNullParameter(viewGroup, "container");
|
||
|
m.checkNotNullParameter(obj, "view");
|
||
|
viewGroup.removeView((View) obj);
|
||
|
}
|
||
|
|
||
|
@Override // androidx.viewpager.widget.PagerAdapter
|
||
|
public int getCount() {
|
||
|
return 3;
|
||
|
}
|
||
|
|
||
|
public final int getPremiumTier() {
|
||
|
return this.premiumTier;
|
||
|
}
|
||
|
|
||
|
public final int getSubscriptionCount() {
|
||
|
return this.subscriptionCount;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.viewpager.widget.PagerAdapter
|
||
|
public View instantiateItem(ViewGroup viewGroup, int i) {
|
||
|
m.checkNotNullParameter(viewGroup, "container");
|
||
|
int i2 = i + 1;
|
||
|
Context context = viewGroup.getContext();
|
||
|
m.checkNotNullExpressionValue(context, "container.context");
|
||
|
PremiumGuildSubscriptionPerkView premiumGuildSubscriptionPerkView = new PremiumGuildSubscriptionPerkView(context, null, 0, 6, null);
|
||
|
premiumGuildSubscriptionPerkView.configure(i2, this.premiumTier);
|
||
|
premiumGuildSubscriptionPerkView.setTag(Integer.valueOf(i2));
|
||
|
viewGroup.addView(premiumGuildSubscriptionPerkView);
|
||
|
return premiumGuildSubscriptionPerkView;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.viewpager.widget.PagerAdapter
|
||
|
public boolean isViewFromObject(View view, Object obj) {
|
||
|
m.checkNotNullParameter(view, "view");
|
||
|
m.checkNotNullParameter(obj, "any");
|
||
|
return m.areEqual(view, obj);
|
||
|
}
|
||
|
|
||
|
public final void setPremiumTier(int i) {
|
||
|
this.premiumTier = i;
|
||
|
}
|
||
|
|
||
|
public final void setSubscriptionCount(int i) {
|
||
|
this.subscriptionCount = i;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public WidgetPremiumGuildSubscription() {
|
||
|
super(2131559159);
|
||
|
WidgetPremiumGuildSubscription$viewModel$2 widgetPremiumGuildSubscription$viewModel$2 = new WidgetPremiumGuildSubscription$viewModel$2(this);
|
||
|
h0 h0Var = new h0(this);
|
||
|
this.viewModel$delegate = FragmentViewModelLazyKt.createViewModelLazy(this, a0.getOrCreateKotlinClass(PremiumGuildViewModel.class), new WidgetPremiumGuildSubscription$appViewModels$$inlined$viewModels$1(h0Var), new j0(widgetPremiumGuildSubscription$viewModel$2));
|
||
|
this.choosePlanLauncher = WidgetChoosePlan.Companion.registerForResult(this, new WidgetPremiumGuildSubscription$choosePlanLauncher$1(this));
|
||
|
this.guildId$delegate = g.lazy(new WidgetPremiumGuildSubscription$guildId$2(this));
|
||
|
}
|
||
|
|
||
|
public static final /* synthetic */ void access$configureLevelBubbles(WidgetPremiumGuildSubscription widgetPremiumGuildSubscription, int i) {
|
||
|
widgetPremiumGuildSubscription.configureLevelBubbles(i);
|
||
|
}
|
||
|
|
||
|
public static final /* synthetic */ void access$configureUI(WidgetPremiumGuildSubscription widgetPremiumGuildSubscription, PremiumGuildViewModel.ViewState viewState) {
|
||
|
widgetPremiumGuildSubscription.configureUI(viewState);
|
||
|
}
|
||
|
|
||
|
public static final /* synthetic */ void access$fetchData(WidgetPremiumGuildSubscription widgetPremiumGuildSubscription) {
|
||
|
widgetPremiumGuildSubscription.fetchData();
|
||
|
}
|
||
|
|
||
|
public static final /* synthetic */ long access$getGuildId$p(WidgetPremiumGuildSubscription widgetPremiumGuildSubscription) {
|
||
|
return widgetPremiumGuildSubscription.getGuildId();
|
||
|
}
|
||
|
|
||
|
public static final /* synthetic */ PremiumGuildViewModel access$getViewModel$p(WidgetPremiumGuildSubscription widgetPremiumGuildSubscription) {
|
||
|
return widgetPremiumGuildSubscription.getViewModel();
|
||
|
}
|
||
|
|
||
|
public static final /* synthetic */ void access$handleEvent(WidgetPremiumGuildSubscription widgetPremiumGuildSubscription, PremiumGuildViewModel.Event event) {
|
||
|
widgetPremiumGuildSubscription.handleEvent(event);
|
||
|
}
|
||
|
|
||
|
private final void configureLevelBubbles(int i) {
|
||
|
int i2 = 0;
|
||
|
while (i2 <= 3) {
|
||
|
List<? extends ImageView> list = this.levelBackgrounds;
|
||
|
if (list == null) {
|
||
|
m.throwUninitializedPropertyAccessException("levelBackgrounds");
|
||
|
}
|
||
|
ImageView imageView = (ImageView) list.get(i2);
|
||
|
ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
|
||
|
int i3 = 32;
|
||
|
layoutParams.height = DimenUtils.dpToPixels(i == i2 ? 32 : 20);
|
||
|
if (i != i2) {
|
||
|
i3 = 20;
|
||
|
}
|
||
|
layoutParams.width = DimenUtils.dpToPixels(i3);
|
||
|
imageView.setLayoutParams(layoutParams);
|
||
|
List<? extends TextView> list2 = this.levelText;
|
||
|
if (list2 == null) {
|
||
|
m.throwUninitializedPropertyAccessException("levelText");
|
||
|
}
|
||
|
TextView textView = (TextView) list2.get(i2);
|
||
|
if (textView != null) {
|
||
|
textView.setTextColor(i == i2 ? ColorCompat.getThemedColor(textView, 2130969872) : ColorCompat.getThemedColor(textView, 2130969883));
|
||
|
}
|
||
|
i2++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private final void configureProgressBar(int i, int i2) {
|
||
|
ProgressBar progressBar = getBinding().l.b;
|
||
|
m.checkNotNullExpressionValue(progressBar, "binding.progress.boostBarProgressBar");
|
||
|
progressBar.setProgress(PremiumGuildSubscriptionUtils.INSTANCE.calculateTotalProgress(i, i2));
|
||
|
ProgressBar progressBar2 = getBinding().l.b;
|
||
|
m.checkNotNullExpressionValue(progressBar2, "binding.progress.boostBarProgressBar");
|
||
|
boolean z2 = false;
|
||
|
progressBar2.setContentDescription(getString(i != 0 ? i != 1 ? i != 2 ? i != 3 ? 0 : 2131892317 : 2131892316 : 2131892315 : 2131892170));
|
||
|
ImageView imageView = getBinding().l.f124c;
|
||
|
m.checkNotNullExpressionValue(imageView, "binding.progress.boostBarTier0Iv");
|
||
|
imageView.setEnabled(i2 > 0);
|
||
|
ImageView imageView2 = getBinding().l.d;
|
||
|
m.checkNotNullExpressionValue(imageView2, "binding.progress.boostBarTier1Iv");
|
||
|
imageView2.setEnabled(i >= 1);
|
||
|
ImageView imageView3 = getBinding().l.f;
|
||
|
m.checkNotNullExpressionValue(imageView3, "binding.progress.boostBarTier2Iv");
|
||
|
imageView3.setEnabled(i >= 2);
|
||
|
ImageView imageView4 = getBinding().l.h;
|
||
|
m.checkNotNullExpressionValue(imageView4, "binding.progress.boostBarTier3Iv");
|
||
|
if (i >= 3) {
|
||
|
z2 = true;
|
||
|
}
|
||
|
imageView4.setEnabled(z2);
|
||
|
}
|
||
|
|
||
|
private final void configureToolbar(String str) {
|
||
|
setActionBarTitle(2131892187);
|
||
|
setActionBarSubtitle(str);
|
||
|
}
|
||
|
|
||
|
private final void configureUI(PremiumGuildViewModel.ViewState viewState) {
|
||
|
if (viewState instanceof PremiumGuildViewModel.ViewState.Loading) {
|
||
|
AppViewFlipper appViewFlipper = getBinding().b;
|
||
|
m.checkNotNullExpressionValue(appViewFlipper, "binding.boostStatusFlipper");
|
||
|
appViewFlipper.setDisplayedChild(0);
|
||
|
} else if (viewState instanceof PremiumGuildViewModel.ViewState.Failure) {
|
||
|
AppViewFlipper appViewFlipper2 = getBinding().b;
|
||
|
m.checkNotNullExpressionValue(appViewFlipper2, "binding.boostStatusFlipper");
|
||
|
appViewFlipper2.setDisplayedChild(1);
|
||
|
getBinding().h.setOnClickListener(new WidgetPremiumGuildSubscription$configureUI$1(this));
|
||
|
} else {
|
||
|
if (viewState instanceof PremiumGuildViewModel.ViewState.Loaded) {
|
||
|
AppViewFlipper appViewFlipper3 = getBinding().b;
|
||
|
m.checkNotNullExpressionValue(appViewFlipper3, "binding.boostStatusFlipper");
|
||
|
appViewFlipper3.setDisplayedChild(2);
|
||
|
}
|
||
|
PremiumGuildViewModel.ViewState.Loaded loaded = (PremiumGuildViewModel.ViewState.Loaded) viewState;
|
||
|
int premiumTier = loaded.getGuild().getPremiumTier();
|
||
|
int premiumSubscriptionCount = loaded.getGuild().getPremiumSubscriptionCount();
|
||
|
configureToolbar(loaded.getGuild().getName());
|
||
|
configureProgressBar(premiumTier, premiumSubscriptionCount);
|
||
|
configureViewpager(premiumTier, premiumSubscriptionCount);
|
||
|
getBinding().e.a(loaded.getMeUser().getPremiumTier(), new WidgetPremiumGuildSubscription$configureUI$2(this));
|
||
|
getBinding().f.a(loaded.getMeUser().getPremiumTier(), false);
|
||
|
TextView textView = getBinding().d;
|
||
|
m.checkNotNullExpressionValue(textView, "binding.boostStatusNumBoosts");
|
||
|
Resources resources = getResources();
|
||
|
m.checkNotNullExpressionValue(resources, "resources");
|
||
|
textView.setText(StringResourceUtilsKt.getQuantityString(resources, requireContext(), 2131755247, premiumSubscriptionCount, Integer.valueOf(premiumSubscriptionCount)));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private final void configureViewpager(int i, int i2) {
|
||
|
PerksPagerAdapter perksPagerAdapter = this.pagerAdapter;
|
||
|
if (perksPagerAdapter == null) {
|
||
|
m.throwUninitializedPropertyAccessException("pagerAdapter");
|
||
|
}
|
||
|
perksPagerAdapter.setPremiumTier(i);
|
||
|
PerksPagerAdapter perksPagerAdapter2 = this.pagerAdapter;
|
||
|
if (perksPagerAdapter2 == null) {
|
||
|
m.throwUninitializedPropertyAccessException("pagerAdapter");
|
||
|
}
|
||
|
perksPagerAdapter2.setSubscriptionCount(i2);
|
||
|
PerksPagerAdapter perksPagerAdapter3 = this.pagerAdapter;
|
||
|
if (perksPagerAdapter3 == null) {
|
||
|
m.throwUninitializedPropertyAccessException("pagerAdapter");
|
||
|
}
|
||
|
SimplePager simplePager = getBinding().k;
|
||
|
m.checkNotNullExpressionValue(simplePager, "binding.boostStatusViewpager");
|
||
|
perksPagerAdapter3.configureViews(simplePager);
|
||
|
if (!this.wasPagerPageSet) {
|
||
|
getBinding().k.setCurrentItem(Math.max(0, i - 1), false);
|
||
|
configureLevelBubbles(Math.max(1, i));
|
||
|
this.wasPagerPageSet = true;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static final void create(Context context, long j) {
|
||
|
Companion.create(context, j);
|
||
|
}
|
||
|
|
||
|
private final void fetchData() {
|
||
|
StoreStream.Companion companion = StoreStream.Companion;
|
||
|
companion.getPremiumGuildSubscriptions().fetchUserGuildPremiumState();
|
||
|
companion.getSubscriptions().fetchSubscriptions();
|
||
|
GooglePlayBillingManager.INSTANCE.queryPurchases();
|
||
|
}
|
||
|
|
||
|
private final WidgetServerBoostStatusBinding getBinding() {
|
||
|
return (WidgetServerBoostStatusBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
||
|
}
|
||
|
|
||
|
private final long getGuildId() {
|
||
|
return ((Number) this.guildId$delegate.getValue()).longValue();
|
||
|
}
|
||
|
|
||
|
private final PremiumGuildViewModel getViewModel() {
|
||
|
return (PremiumGuildViewModel) this.viewModel$delegate.getValue();
|
||
|
}
|
||
|
|
||
|
private final void handleEvent(PremiumGuildViewModel.Event event) {
|
||
|
if (event instanceof PremiumGuildViewModel.Event.LaunchSubscriptionConfirmation) {
|
||
|
PremiumGuildViewModel.Event.LaunchSubscriptionConfirmation launchSubscriptionConfirmation = (PremiumGuildViewModel.Event.LaunchSubscriptionConfirmation) event;
|
||
|
WidgetPremiumGuildSubscriptionConfirmation.Companion.create(requireContext(), launchSubscriptionConfirmation.getGuildId(), launchSubscriptionConfirmation.getSlotId());
|
||
|
} else if (event instanceof PremiumGuildViewModel.Event.LaunchPurchaseSubscription) {
|
||
|
PremiumGuildViewModel.Event.LaunchPurchaseSubscription launchPurchaseSubscription = (PremiumGuildViewModel.Event.LaunchPurchaseSubscription) event;
|
||
|
WidgetChoosePlan.Companion.launch$default(WidgetChoosePlan.Companion, requireContext(), this.choosePlanLauncher, WidgetChoosePlan.ViewType.BUY_PREMIUM_GUILD, launchPurchaseSubscription.getOldSkuName(), new Traits.Location("User-Facing Premium Guild Subscription Fullscreen Modal", launchPurchaseSubscription.getSection(), "Button CTA", "buy", null, 16, null), null, 32, null);
|
||
|
} else if (event instanceof PremiumGuildViewModel.Event.ShowDesktopAlertDialog) {
|
||
|
WidgetNoticeDialog.Companion companion = WidgetNoticeDialog.Companion;
|
||
|
FragmentManager parentFragmentManager = getParentFragmentManager();
|
||
|
m.checkNotNullExpressionValue(parentFragmentManager, "parentFragmentManager");
|
||
|
WidgetNoticeDialog.Companion.show$default(companion, parentFragmentManager, getString(2131892286), b.j(this, 2131892285, new Object[]{f.a.a(360055386693L, null)}, null, 4), getString(2131892257), null, null, null, null, null, null, null, null, 0, null, 16368, null);
|
||
|
} else if (event instanceof PremiumGuildViewModel.Event.UnacknowledgedPurchase) {
|
||
|
o.i(this, 2131886889, 0, 4);
|
||
|
GooglePlayBillingManager.INSTANCE.queryPurchases();
|
||
|
} else if (event instanceof PremiumGuildViewModel.Event.ShowBlockedPlanSwitchAlertDialog) {
|
||
|
WidgetNoticeDialog.Companion companion2 = WidgetNoticeDialog.Companion;
|
||
|
FragmentManager parentFragmentManager2 = getParentFragmentManager();
|
||
|
m.checkNotNullExpressionValue(parentFragmentManager2, "parentFragmentManager");
|
||
|
PremiumGuildViewModel.Event.ShowBlockedPlanSwitchAlertDialog showBlockedPlanSwitchAlertDialog = (PremiumGuildViewModel.Event.ShowBlockedPlanSwitchAlertDialog) event;
|
||
|
String string = getString(showBlockedPlanSwitchAlertDialog.getHeaderStringRes());
|
||
|
String string2 = getString(showBlockedPlanSwitchAlertDialog.getBodyStringRes());
|
||
|
m.checkNotNullExpressionValue(string2, "getString(event.bodyStringRes)");
|
||
|
WidgetNoticeDialog.Companion.show$default(companion2, parentFragmentManager2, string, string2, getString(2131886915), getString(2131887180), g0.mapOf(d0.o.to(2131364130, new WidgetPremiumGuildSubscription$handleEvent$1(this))), null, null, null, null, null, null, 0, null, 16320, null);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.app.AppFragment
|
||
|
public void onViewBound(View view) {
|
||
|
m.checkNotNullParameter(view, "view");
|
||
|
super.onViewBound(view);
|
||
|
AppFragment.setActionBarDisplayHomeAsUpEnabled$default(this, false, 1, null);
|
||
|
this.pagerAdapter = new PerksPagerAdapter();
|
||
|
getBinding().k.setWrapHeight(true);
|
||
|
SimplePager simplePager = getBinding().k;
|
||
|
m.checkNotNullExpressionValue(simplePager, "binding.boostStatusViewpager");
|
||
|
PerksPagerAdapter perksPagerAdapter = this.pagerAdapter;
|
||
|
if (perksPagerAdapter == null) {
|
||
|
m.throwUninitializedPropertyAccessException("pagerAdapter");
|
||
|
}
|
||
|
simplePager.setAdapter(perksPagerAdapter);
|
||
|
getBinding().k.addOnPageChangeListener(new WidgetPremiumGuildSubscription$onViewBound$1(this));
|
||
|
AppFragment.setActionBarOptionsMenu$default(this, 2131623957, WidgetPremiumGuildSubscription$onViewBound$2.INSTANCE, null, 4, null);
|
||
|
LinkifiedTextView linkifiedTextView = getBinding().f1879c;
|
||
|
m.checkNotNullExpressionValue(linkifiedTextView, "binding.boostStatusLearnMore");
|
||
|
b.l(linkifiedTextView, 2131892179, new Object[]{"learnMode"}, WidgetPremiumGuildSubscription$onViewBound$3.INSTANCE);
|
||
|
CharSequence i18nPluralString = StringResourceUtilsKt.getI18nPluralString(requireContext(), 2131755249, 2, 2);
|
||
|
LinkifiedTextView linkifiedTextView2 = getBinding().g;
|
||
|
m.checkNotNullExpressionValue(linkifiedTextView2, "binding.boostStatusProtip");
|
||
|
b.l(linkifiedTextView2, 2131892193, new Object[]{i18nPluralString}, new WidgetPremiumGuildSubscription$onViewBound$4(this));
|
||
|
ImageView imageView = getBinding().l.f124c;
|
||
|
m.checkNotNullExpressionValue(imageView, "binding.progress.boostBarTier0Iv");
|
||
|
ImageView imageView2 = getBinding().l.d;
|
||
|
m.checkNotNullExpressionValue(imageView2, "binding.progress.boostBarTier1Iv");
|
||
|
ImageView imageView3 = getBinding().l.f;
|
||
|
m.checkNotNullExpressionValue(imageView3, "binding.progress.boostBarTier2Iv");
|
||
|
ImageView imageView4 = getBinding().l.h;
|
||
|
m.checkNotNullExpressionValue(imageView4, "binding.progress.boostBarTier3Iv");
|
||
|
this.levelBackgrounds = n.listOf((Object[]) new ImageView[]{imageView, imageView2, imageView3, imageView4});
|
||
|
this.levelText = n.listOf((Object[]) new TextView[]{null, getBinding().l.e, getBinding().l.g, getBinding().l.i});
|
||
|
getBinding().i.setOnClickListener(new WidgetPremiumGuildSubscription$onViewBound$5(this));
|
||
|
getBinding().j.setOnClickListener(new WidgetPremiumGuildSubscription$onViewBound$6(this));
|
||
|
fetchData();
|
||
|
}
|
||
|
|
||
|
@Override // com.discord.app.AppFragment
|
||
|
public void onViewBoundOrOnResume() {
|
||
|
AppActivity appActivity;
|
||
|
super.onViewBoundOrOnResume();
|
||
|
if ((getGuildId() == 0 || getGuildId() == -1) && (appActivity = getAppActivity()) != null) {
|
||
|
appActivity.finish();
|
||
|
}
|
||
|
Observable<PremiumGuildViewModel.ViewState> r = getViewModel().observeViewState().r();
|
||
|
m.checkNotNullExpressionValue(r, "viewModel\n .obser… .distinctUntilChanged()");
|
||
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle(r, this), WidgetPremiumGuildSubscription.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetPremiumGuildSubscription$onViewBoundOrOnResume$1(this), 62, (Object) null);
|
||
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle(getViewModel().observeEvents(), this), WidgetPremiumGuildSubscription.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetPremiumGuildSubscription$onViewBoundOrOnResume$2(this), 62, (Object) null);
|
||
|
}
|
||
|
}
|