forked from Juby210/discord-jadx
121 lines
5.2 KiB
Java
121 lines
5.2 KiB
Java
package com.discord.widgets.guilds.join;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.view.View;
|
|
import android.view.Window;
|
|
import androidx.annotation.CallSuper;
|
|
import androidx.annotation.LayoutRes;
|
|
import androidx.fragment.app.Fragment;
|
|
import b.a.d.j;
|
|
import b.d.b.a.a;
|
|
import com.discord.R;
|
|
import com.discord.app.AppActivity;
|
|
import com.discord.app.AppFragment;
|
|
import com.discord.app.LoggingConfig;
|
|
import com.discord.databinding.WidgetGuildJoinBinding;
|
|
import com.discord.models.domain.ModelAuditLogEntry;
|
|
import com.discord.stores.StoreInviteSettings;
|
|
import com.discord.utilities.analytics.AnalyticsTracker;
|
|
import com.discord.utilities.intent.IntentUtils;
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import com.google.android.material.textfield.TextInputLayout;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.reflect.KProperty;
|
|
/* compiled from: WidgetGuildJoin.kt */
|
|
public class WidgetGuildJoin extends AppFragment {
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.b0(WidgetGuildJoin.class, "binding", "getBinding()Lcom/discord/databinding/WidgetGuildJoinBinding;", 0)};
|
|
public static final Companion Companion = new Companion(null);
|
|
private final FragmentViewBindingDelegate binding$delegate;
|
|
private final LoggingConfig loggingConfig;
|
|
|
|
/* compiled from: WidgetGuildJoin.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final void show(Context context, String str) {
|
|
m.checkNotNullParameter(context, "context");
|
|
m.checkNotNullParameter(str, ModelAuditLogEntry.CHANGE_KEY_LOCATION);
|
|
AnalyticsTracker.openModal$default("Join Guild", str, null, 4, null);
|
|
j.e(context, ToolbarButton.class, null, 4);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildJoin.kt */
|
|
public static final class ToolbarButton extends WidgetGuildJoin {
|
|
public ToolbarButton() {
|
|
super(0, 1, null);
|
|
}
|
|
|
|
@Override // com.discord.widgets.guilds.join.WidgetGuildJoin, com.discord.app.AppFragment
|
|
public void onViewBound(View view) {
|
|
Window window;
|
|
m.checkNotNullParameter(view, "view");
|
|
WidgetGuildJoin.super.onViewBound(view);
|
|
AnalyticsTracker.INSTANCE.joinGuildViewed();
|
|
AppActivity appActivity = getAppActivity();
|
|
if (appActivity != null && (window = appActivity.getWindow()) != null) {
|
|
window.setSoftInputMode(36);
|
|
}
|
|
}
|
|
}
|
|
|
|
public WidgetGuildJoin() {
|
|
this(0, 1, null);
|
|
}
|
|
|
|
public WidgetGuildJoin(@LayoutRes int i) {
|
|
super(i);
|
|
this.binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetGuildJoin$binding$2.INSTANCE, null, 2, null);
|
|
this.loggingConfig = new LoggingConfig(false, null, WidgetGuildJoin$loggingConfig$1.INSTANCE, 3);
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ WidgetGuildJoin(int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i2 & 1) != 0 ? R.layout.widget_guild_join : i);
|
|
}
|
|
|
|
public final WidgetGuildJoinBinding getBinding() {
|
|
return (WidgetGuildJoinBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment, com.discord.app.AppLogger.a
|
|
public LoggingConfig getLoggingConfig() {
|
|
return this.loggingConfig;
|
|
}
|
|
|
|
public final void handleGuildJoin() {
|
|
TextInputLayout textInputLayout = getBinding().c;
|
|
m.checkNotNullExpressionValue(textInputLayout, "binding.guildJoinInvite");
|
|
String textOrEmpty = ViewExtensions.getTextOrEmpty(textInputLayout);
|
|
if (textOrEmpty.length() > 0) {
|
|
Intent selectInvite = IntentUtils.RouteBuilders.INSTANCE.selectInvite(textOrEmpty, StoreInviteSettings.LOCATION_JOIN);
|
|
IntentUtils intentUtils = IntentUtils.INSTANCE;
|
|
TextInputLayout textInputLayout2 = getBinding().c;
|
|
m.checkNotNullExpressionValue(textInputLayout2, "binding.guildJoinInvite");
|
|
Context context = textInputLayout2.getContext();
|
|
m.checkNotNullExpressionValue(context, "binding.guildJoinInvite.context");
|
|
IntentUtils.consumeRoutingIntent$default(intentUtils, selectInvite, context, null, 4, null);
|
|
}
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
@CallSuper
|
|
public void onViewBound(View view) {
|
|
m.checkNotNullParameter(view, "view");
|
|
super.onViewBound(view);
|
|
TextInputLayout textInputLayout = getBinding().c;
|
|
m.checkNotNullExpressionValue(textInputLayout, "binding.guildJoinInvite");
|
|
ViewExtensions.setOnImeActionDone$default(textInputLayout, false, new WidgetGuildJoin$onViewBound$1(this), 1, null);
|
|
getBinding().f2389b.setOnClickListener(new WidgetGuildJoin$onViewBound$2(this));
|
|
}
|
|
}
|