forked from Juby210/discord-jadx
32 lines
1.3 KiB
Java
32 lines
1.3 KiB
Java
package com.discord.widgets.guilds.invite;
|
|
|
|
import android.content.Intent;
|
|
import androidx.activity.result.ActivityResult;
|
|
import androidx.activity.result.ActivityResultCallback;
|
|
import d0.z.d.m;
|
|
import java.io.Serializable;
|
|
import kotlin.jvm.functions.Function1;
|
|
/* compiled from: WidgetGuildInviteSettings.kt */
|
|
public final class WidgetGuildInviteSettings$Companion$registerForResult$1<O> implements ActivityResultCallback<ActivityResult> {
|
|
public final /* synthetic */ Function1 $callback;
|
|
|
|
public WidgetGuildInviteSettings$Companion$registerForResult$1(Function1 function1) {
|
|
this.$callback = function1;
|
|
}
|
|
|
|
public final void onActivityResult(ActivityResult activityResult) {
|
|
m.checkNotNullExpressionValue(activityResult, "activityResult");
|
|
if (activityResult.getResultCode() == -1) {
|
|
Intent data = activityResult.getData();
|
|
GuildInvite guildInvite = null;
|
|
Serializable serializableExtra = data != null ? data.getSerializableExtra("EXTRA_CREATED_INVITE") : null;
|
|
if (serializableExtra instanceof GuildInvite) {
|
|
guildInvite = serializableExtra;
|
|
}
|
|
GuildInvite guildInvite2 = guildInvite;
|
|
if (guildInvite2 != null) {
|
|
this.$callback.invoke(guildInvite2);
|
|
}
|
|
}
|
|
}
|
|
}
|