2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.widgets.servers;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.res.Resources;
|
|
|
|
import android.view.View;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.RelativeLayout;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import c.a.d.l;
|
|
|
|
import c.a.l.b;
|
|
|
|
import c.d.b.a.a;
|
|
|
|
import com.discord.api.role.GuildRole;
|
|
|
|
import com.discord.app.AppActivity;
|
|
|
|
import com.discord.app.AppFragment;
|
|
|
|
import com.discord.databinding.WidgetServerSettingsEditIntegrationBinding;
|
|
|
|
import com.discord.models.domain.ModelGuildIntegration;
|
|
|
|
import com.discord.models.guild.Guild;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.stores.StoreUser;
|
|
|
|
import com.discord.utilities.color.ColorCompat;
|
|
|
|
import com.discord.utilities.dimmer.DimmerView;
|
|
|
|
import com.discord.utilities.guilds.RoleUtils;
|
|
|
|
import com.discord.utilities.resources.StringResourceUtilsKt;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import com.discord.utilities.stateful.StatefulViews;
|
|
|
|
import com.discord.utilities.time.TimeUtils;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
|
|
import com.discord.views.CheckedSetting;
|
|
|
|
import com.discord.views.RadioManager;
|
|
|
|
import d0.g;
|
|
|
|
import d0.t.n;
|
|
|
|
import d0.t.o;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import kotlin.Lazy;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import kotlin.reflect.KProperty;
|
|
|
|
import rx.Observable;
|
|
|
|
/* compiled from: WidgetServerSettingsEditIntegration.kt */
|
|
|
|
public final class WidgetServerSettingsEditIntegration extends AppFragment {
|
|
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.W(WidgetServerSettingsEditIntegration.class, "binding", "getBinding()Lcom/discord/databinding/WidgetServerSettingsEditIntegrationBinding;", 0)};
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private static final String INTENT_EXTRA_GUILD_ID = "INTENT_EXTRA_GUILD_ID";
|
|
|
|
private static final String INTENT_EXTRA_INTEGRATION_ID = "INTENT_EXTRA_INTEGRATION_ID";
|
2021-07-13 20:23:20 +00:00
|
|
|
private static final int STATE_KEY_ENABLE_TWITCH_EMOTES = 2131363022;
|
|
|
|
private static final int STATE_KEY_EXPIRE_BEHAVIOR = 2131363025;
|
|
|
|
private static final int STATE_KEY_GRACE_PERIOD = 2131363026;
|
2021-06-27 20:44:35 +00:00
|
|
|
private static final int[] gracePeriodDays = {1, 3, 7, 14, 30};
|
|
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetServerSettingsEditIntegration$binding$2.INSTANCE, null, 2, null);
|
|
|
|
private RadioManager expiryBehaviorRadioManager;
|
|
|
|
private final Lazy expiryBehaviorRadios$delegate = g.lazy(new WidgetServerSettingsEditIntegration$expiryBehaviorRadios$2(this));
|
|
|
|
private RadioManager gracePeriodRadioManager;
|
|
|
|
private final Lazy gracePeriodRadios$delegate = g.lazy(new WidgetServerSettingsEditIntegration$gracePeriodRadios$2(this));
|
2021-07-13 20:23:20 +00:00
|
|
|
private final StatefulViews state = new StatefulViews(2131363022, 2131363025, 2131363026);
|
2021-06-27 20:44:35 +00:00
|
|
|
|
|
|
|
/* compiled from: WidgetServerSettingsEditIntegration.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void launch(long j, long j2, Context context) {
|
|
|
|
m.checkNotNullParameter(context, "context");
|
|
|
|
Intent intent = new Intent();
|
|
|
|
intent.putExtra("INTENT_EXTRA_GUILD_ID", j);
|
|
|
|
intent.putExtra("INTENT_EXTRA_INTEGRATION_ID", j2);
|
|
|
|
l.d(context, WidgetServerSettingsEditIntegration.class, intent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetServerSettingsEditIntegration.kt */
|
|
|
|
public static final class Model {
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private final Guild guild;
|
|
|
|
private final ModelGuildIntegration integration;
|
|
|
|
private final GuildRole role;
|
|
|
|
|
|
|
|
/* compiled from: WidgetServerSettingsEditIntegration.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Observable<Model> get(long j, long j2) {
|
|
|
|
StoreStream.Companion companion = StoreStream.Companion;
|
|
|
|
Observable g = Observable.g(StoreUser.observeMe$default(companion.getUsers(), false, 1, null), companion.getGuilds().observeGuild(j), companion.getGuilds().observeRoles(j), companion.getPermissions().observePermissionsForGuild(j), companion.getGuildIntegrations().get(j, j2), WidgetServerSettingsEditIntegration$Model$Companion$get$1.INSTANCE);
|
|
|
|
m.checkNotNullExpressionValue(g, "Observable.combineLatest… }\n }\n }");
|
2021-07-03 23:36:06 +00:00
|
|
|
Observable<Model> r = ObservableExtensionsKt.computationLatest(g).r();
|
|
|
|
m.checkNotNullExpressionValue(r, "Observable.combineLatest… .distinctUntilChanged()");
|
|
|
|
return r;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Model(Guild guild, ModelGuildIntegration modelGuildIntegration, GuildRole guildRole) {
|
|
|
|
m.checkNotNullParameter(guild, "guild");
|
|
|
|
m.checkNotNullParameter(modelGuildIntegration, "integration");
|
|
|
|
this.guild = guild;
|
|
|
|
this.integration = modelGuildIntegration;
|
|
|
|
this.role = guildRole;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ Model copy$default(Model model, Guild guild, ModelGuildIntegration modelGuildIntegration, GuildRole guildRole, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
guild = model.guild;
|
|
|
|
}
|
|
|
|
if ((i & 2) != 0) {
|
|
|
|
modelGuildIntegration = model.integration;
|
|
|
|
}
|
|
|
|
if ((i & 4) != 0) {
|
|
|
|
guildRole = model.role;
|
|
|
|
}
|
|
|
|
return model.copy(guild, modelGuildIntegration, guildRole);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild component1() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final ModelGuildIntegration component2() {
|
|
|
|
return this.integration;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildRole component3() {
|
|
|
|
return this.role;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Model copy(Guild guild, ModelGuildIntegration modelGuildIntegration, GuildRole guildRole) {
|
|
|
|
m.checkNotNullParameter(guild, "guild");
|
|
|
|
m.checkNotNullParameter(modelGuildIntegration, "integration");
|
|
|
|
return new Model(guild, modelGuildIntegration, guildRole);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof Model)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
Model model = (Model) obj;
|
|
|
|
return m.areEqual(this.guild, model.guild) && m.areEqual(this.integration, model.integration) && m.areEqual(this.role, model.role);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild getGuild() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final ModelGuildIntegration getIntegration() {
|
|
|
|
return this.integration;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildRole getRole() {
|
|
|
|
return this.role;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
Guild guild = this.guild;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (guild != null ? guild.hashCode() : 0) * 31;
|
|
|
|
ModelGuildIntegration modelGuildIntegration = this.integration;
|
|
|
|
int hashCode2 = (hashCode + (modelGuildIntegration != null ? modelGuildIntegration.hashCode() : 0)) * 31;
|
|
|
|
GuildRole guildRole = this.role;
|
|
|
|
if (guildRole != null) {
|
|
|
|
i = guildRole.hashCode();
|
|
|
|
}
|
|
|
|
return hashCode2 + i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
StringBuilder L = a.L("Model(guild=");
|
|
|
|
L.append(this.guild);
|
|
|
|
L.append(", integration=");
|
|
|
|
L.append(this.integration);
|
|
|
|
L.append(", role=");
|
|
|
|
L.append(this.role);
|
|
|
|
L.append(")");
|
|
|
|
return L.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetServerSettingsEditIntegration() {
|
2021-07-13 20:23:20 +00:00
|
|
|
super(2131559174);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$configureUI(WidgetServerSettingsEditIntegration widgetServerSettingsEditIntegration, Model model) {
|
|
|
|
widgetServerSettingsEditIntegration.configureUI(model);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ WidgetServerSettingsEditIntegrationBinding access$getBinding$p(WidgetServerSettingsEditIntegration widgetServerSettingsEditIntegration) {
|
|
|
|
return widgetServerSettingsEditIntegration.getBinding();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ RadioManager access$getExpiryBehaviorRadioManager$p(WidgetServerSettingsEditIntegration widgetServerSettingsEditIntegration) {
|
|
|
|
RadioManager radioManager = widgetServerSettingsEditIntegration.expiryBehaviorRadioManager;
|
|
|
|
if (radioManager == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("expiryBehaviorRadioManager");
|
|
|
|
}
|
|
|
|
return radioManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ int[] access$getGracePeriodDays$cp() {
|
|
|
|
return gracePeriodDays;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ RadioManager access$getGracePeriodRadioManager$p(WidgetServerSettingsEditIntegration widgetServerSettingsEditIntegration) {
|
|
|
|
RadioManager radioManager = widgetServerSettingsEditIntegration.gracePeriodRadioManager;
|
|
|
|
if (radioManager == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("gracePeriodRadioManager");
|
|
|
|
}
|
|
|
|
return radioManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ StatefulViews access$getState$p(WidgetServerSettingsEditIntegration widgetServerSettingsEditIntegration) {
|
|
|
|
return widgetServerSettingsEditIntegration.state;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$setExpiryBehaviorRadioManager$p(WidgetServerSettingsEditIntegration widgetServerSettingsEditIntegration, RadioManager radioManager) {
|
|
|
|
widgetServerSettingsEditIntegration.expiryBehaviorRadioManager = radioManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$setGracePeriodRadioManager$p(WidgetServerSettingsEditIntegration widgetServerSettingsEditIntegration, RadioManager radioManager) {
|
|
|
|
widgetServerSettingsEditIntegration.gracePeriodRadioManager = radioManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void configureUI(Model model) {
|
|
|
|
if (model == null) {
|
|
|
|
AppActivity appActivity = getAppActivity();
|
|
|
|
if (appActivity != null) {
|
|
|
|
appActivity.finish();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2021-07-13 20:23:20 +00:00
|
|
|
setActionBarTitle(2131890526);
|
2021-06-27 20:44:35 +00:00
|
|
|
setActionBarSubtitle(model.getGuild().getName());
|
|
|
|
boolean areEqual = m.areEqual(model.getIntegration().getType(), "twitch");
|
|
|
|
TextView textView = getBinding().m;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.editIntegrationName");
|
|
|
|
textView.setText(model.getIntegration().getDisplayName());
|
|
|
|
TextView textView2 = getBinding().n;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.editIntegrationOwnerName");
|
|
|
|
textView2.setText(model.getIntegration().getUser().r());
|
2021-07-03 23:36:06 +00:00
|
|
|
getBinding().l.setImageResource(areEqual ? 2131230882 : 2131230883);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().p.d.setOnClickListener(new WidgetServerSettingsEditIntegration$configureUI$1(this, model));
|
|
|
|
int i = 0;
|
|
|
|
WidgetServerSettingsEditIntegration$configureUI$2 widgetServerSettingsEditIntegration$configureUI$2 = null;
|
|
|
|
DimmerView.setDimmed$default(getBinding().b, model.getIntegration().isSyncing(), false, 2, null);
|
|
|
|
TextView textView3 = getBinding().p.b;
|
|
|
|
m.checkNotNullExpressionValue(textView3, "binding.syncSettings.editIntegrationLastSyncTime");
|
|
|
|
WidgetServerSettingsEditIntegrationBinding binding = getBinding();
|
|
|
|
m.checkNotNullExpressionValue(binding, "binding");
|
|
|
|
CoordinatorLayout coordinatorLayout = binding.a;
|
|
|
|
m.checkNotNullExpressionValue(coordinatorLayout, "binding.root");
|
|
|
|
Context context = coordinatorLayout.getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "binding.root.context");
|
|
|
|
textView3.setText(TimeUtils.toReadableTimeString$default(context, TimeUtils.parseUTCDate(model.getIntegration().getSyncedAt()), null, 4, null));
|
2021-07-13 20:23:20 +00:00
|
|
|
TextView textView4 = getBinding().p.f166c;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(textView4, "binding.syncSettings.edi…ntegrationSubscriberCount");
|
|
|
|
Resources resources = getResources();
|
|
|
|
m.checkNotNullExpressionValue(resources, "resources");
|
|
|
|
WidgetServerSettingsEditIntegrationBinding binding2 = getBinding();
|
|
|
|
m.checkNotNullExpressionValue(binding2, "binding");
|
|
|
|
CoordinatorLayout coordinatorLayout2 = binding2.a;
|
|
|
|
m.checkNotNullExpressionValue(coordinatorLayout2, "binding.root");
|
|
|
|
Context context2 = coordinatorLayout2.getContext();
|
|
|
|
m.checkNotNullExpressionValue(context2, "binding.root.context");
|
2021-07-13 20:23:20 +00:00
|
|
|
textView4.setText(b.k(StringResourceUtilsKt.getQuantityString(resources, context2, areEqual ? 2131755232 : 2131755231, model.getIntegration().getSubscriberCount(), Integer.valueOf(model.getIntegration().getSubscriberCount())), new Object[0], null, 2));
|
2021-06-27 20:44:35 +00:00
|
|
|
RelativeLayout relativeLayout = getBinding().p.f;
|
|
|
|
if (model.getRole() != null) {
|
|
|
|
widgetServerSettingsEditIntegration$configureUI$2 = new WidgetServerSettingsEditIntegration$configureUI$2(model);
|
|
|
|
}
|
|
|
|
relativeLayout.setOnClickListener(widgetServerSettingsEditIntegration$configureUI$2);
|
|
|
|
TextView textView5 = getBinding().p.e;
|
|
|
|
m.checkNotNullExpressionValue(textView5, "binding.syncSettings.editIntegrationSyncedRole");
|
|
|
|
textView5.setText(model.getRole() != null ? model.getRole().f() : "None");
|
|
|
|
getBinding().p.e.setTextColor(RoleUtils.getOpaqueColor(model.getRole(), ColorCompat.getColor(this, 2131100121)));
|
2021-07-13 20:23:20 +00:00
|
|
|
int intValue = ((Number) this.state.get(2131363025, Integer.valueOf(model.getIntegration().getExpireBehavior()))).intValue();
|
2021-06-27 20:44:35 +00:00
|
|
|
RadioManager radioManager = this.expiryBehaviorRadioManager;
|
|
|
|
if (radioManager == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("expiryBehaviorRadioManager");
|
|
|
|
}
|
|
|
|
radioManager.a(getExpiryBehaviorRadios().get(intValue));
|
2021-07-13 20:23:20 +00:00
|
|
|
int intValue2 = ((Number) this.state.get(2131363026, Integer.valueOf(getGracePeriodPosition(model.getIntegration().getExpireGracePeriod())))).intValue();
|
2021-06-27 20:44:35 +00:00
|
|
|
RadioManager radioManager2 = this.gracePeriodRadioManager;
|
|
|
|
if (radioManager2 == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("gracePeriodRadioManager");
|
|
|
|
}
|
|
|
|
radioManager2.a(getGracePeriodRadios().get(intValue2));
|
2021-07-13 20:23:20 +00:00
|
|
|
LinearLayout linearLayout = getBinding().f1893c;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(linearLayout, "binding.editIntegrationCustomEmotesContainer");
|
|
|
|
if (!areEqual) {
|
|
|
|
i = 8;
|
|
|
|
}
|
|
|
|
linearLayout.setVisibility(i);
|
|
|
|
CheckedSetting checkedSetting = getBinding().d;
|
|
|
|
m.checkNotNullExpressionValue(checkedSetting, "binding.editIntegrationCustomEmotesToggle");
|
|
|
|
StatefulViews statefulViews = this.state;
|
|
|
|
CheckedSetting checkedSetting2 = getBinding().d;
|
|
|
|
m.checkNotNullExpressionValue(checkedSetting2, "binding.editIntegrationCustomEmotesToggle");
|
|
|
|
checkedSetting.setChecked(((Boolean) statefulViews.get(checkedSetting2.getId(), Boolean.valueOf(model.getIntegration().isEnableEmoticons()))).booleanValue());
|
|
|
|
this.state.configureSaveActionView(getBinding().o);
|
|
|
|
getBinding().o.setOnClickListener(new WidgetServerSettingsEditIntegration$configureUI$3(this, model));
|
|
|
|
}
|
|
|
|
|
|
|
|
private final WidgetServerSettingsEditIntegrationBinding getBinding() {
|
|
|
|
return (WidgetServerSettingsEditIntegrationBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final List<CheckedSetting> getExpiryBehaviorRadios() {
|
|
|
|
return (List) this.expiryBehaviorRadios$delegate.getValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
private final int getGracePeriodPosition(int i) {
|
|
|
|
if (i == 1) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (i == 3) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (i == 7) {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
if (i != 14) {
|
|
|
|
return i != 30 ? 0 : 4;
|
|
|
|
}
|
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
private final List<CheckedSetting> getGracePeriodRadios() {
|
|
|
|
return (List) this.gracePeriodRadios$delegate.getValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
private final RadioManager setupRadioManager(List<CheckedSetting> list, int i) {
|
|
|
|
RadioManager radioManager = new RadioManager(list);
|
|
|
|
int i2 = 0;
|
|
|
|
for (Object obj : list) {
|
|
|
|
int i3 = i2 + 1;
|
|
|
|
if (i2 < 0) {
|
|
|
|
n.throwIndexOverflow();
|
|
|
|
}
|
|
|
|
CheckedSetting checkedSetting = (CheckedSetting) obj;
|
|
|
|
checkedSetting.e(new WidgetServerSettingsEditIntegration$setupRadioManager$$inlined$forEachIndexed$lambda$1(checkedSetting, i2, this, radioManager, i));
|
|
|
|
i2 = i3;
|
|
|
|
}
|
|
|
|
return radioManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppFragment, androidx.fragment.app.Fragment
|
|
|
|
public void onPause() {
|
|
|
|
super.onPause();
|
|
|
|
StoreStream.Companion.getGuildIntegrations().onIntegrationScreenClosed();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
|
|
public void onViewBound(View view) {
|
|
|
|
m.checkNotNullParameter(view, "view");
|
|
|
|
super.onViewBound(view);
|
|
|
|
setRetainInstance(true);
|
2021-07-13 20:23:20 +00:00
|
|
|
this.expiryBehaviorRadioManager = setupRadioManager(getExpiryBehaviorRadios(), 2131363025);
|
|
|
|
this.gracePeriodRadioManager = setupRadioManager(getGracePeriodRadios(), 2131363026);
|
2021-06-27 20:44:35 +00:00
|
|
|
AppFragment.setActionBarDisplayHomeAsUpEnabled$default(this, false, 1, null);
|
|
|
|
this.state.setupUnsavedChangesConfirmation(this);
|
|
|
|
List<CheckedSetting> gracePeriodRadios = getGracePeriodRadios();
|
|
|
|
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(gracePeriodRadios, 10));
|
|
|
|
int i = 0;
|
|
|
|
for (Object obj : gracePeriodRadios) {
|
|
|
|
int i2 = i + 1;
|
|
|
|
if (i < 0) {
|
|
|
|
n.throwIndexOverflow();
|
|
|
|
}
|
|
|
|
CheckedSetting checkedSetting = (CheckedSetting) obj;
|
|
|
|
Resources resources = getResources();
|
|
|
|
m.checkNotNullExpressionValue(resources, "resources");
|
|
|
|
Context context = checkedSetting.getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "radio.context");
|
|
|
|
int[] iArr = gracePeriodDays;
|
2021-07-13 20:23:20 +00:00
|
|
|
checkedSetting.setText(StringResourceUtilsKt.getQuantityString(resources, context, 2131755223, iArr[i], Integer.valueOf(iArr[i])));
|
2021-06-27 20:44:35 +00:00
|
|
|
arrayList.add(Unit.a);
|
|
|
|
i = i2;
|
|
|
|
}
|
|
|
|
getBinding().d.e(new WidgetServerSettingsEditIntegration$onViewBound$2(this));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
|
|
public void onViewBoundOrOnResume() {
|
|
|
|
super.onViewBoundOrOnResume();
|
|
|
|
long longExtra = getMostRecentIntent().getLongExtra("INTENT_EXTRA_GUILD_ID", -1);
|
|
|
|
long longExtra2 = getMostRecentIntent().getLongExtra("INTENT_EXTRA_INTEGRATION_ID", -1);
|
|
|
|
StoreStream.Companion.getGuildIntegrations().onIntegrationScreenOpened(longExtra);
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(Model.Companion.get(longExtra, longExtra2), this, null, 2, null), WidgetServerSettingsEditIntegration.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetServerSettingsEditIntegration$onViewBoundOrOnResume$1(this), 62, (Object) null);
|
|
|
|
}
|
|
|
|
}
|