2021-08-20 02:22:46 +00:00
|
|
|
package com.discord.widgets.guildscheduledevent;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.util.AttributeSet;
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
|
|
import c.a.k.b;
|
2021-09-15 06:33:54 +00:00
|
|
|
import c.d.b.a.a;
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.z.d.m;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.discord.R;
|
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
2021-09-22 06:37:51 +00:00
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventEntityType;
|
2021-08-28 06:29:07 +00:00
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventStatus;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.discord.databinding.GuildScheduledEventBottomButtonViewBinding;
|
|
|
|
import com.discord.utilities.color.ColorCompat;
|
|
|
|
import com.discord.utilities.drawable.DrawableCompat;
|
|
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventTiming;
|
|
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilitiesKt;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
2021-09-29 17:50:51 +00:00
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
2021-08-20 02:22:46 +00:00
|
|
|
/* compiled from: GuildScheduledEventBottomButtonView.kt */
|
|
|
|
public final class GuildScheduledEventBottomButtonView extends ConstraintLayout {
|
|
|
|
private final GuildScheduledEventBottomButtonViewBinding binding;
|
|
|
|
|
2021-09-09 06:47:34 +00:00
|
|
|
/* compiled from: GuildScheduledEventBottomButtonView.kt */
|
2021-09-15 06:33:54 +00:00
|
|
|
public static final class VisibilityInfo {
|
2021-10-07 06:22:31 +00:00
|
|
|
private final boolean canConnect;
|
|
|
|
private final boolean canConnectToChannel;
|
2021-09-15 06:33:54 +00:00
|
|
|
private final boolean canRsvp;
|
|
|
|
private final boolean canShare;
|
|
|
|
private final boolean canStartEvent;
|
|
|
|
private final GuildScheduledEvent guildScheduledEvent;
|
|
|
|
private final boolean isAnyButtonVisible;
|
2021-09-27 20:31:35 +00:00
|
|
|
private final boolean isConnected;
|
2021-09-29 17:50:51 +00:00
|
|
|
private final boolean isDetailView;
|
|
|
|
private final boolean isEndEventVisible;
|
2021-09-15 06:33:54 +00:00
|
|
|
private final boolean isEventActive;
|
|
|
|
private final boolean isEventComplete;
|
2021-09-18 07:43:22 +00:00
|
|
|
private final boolean isShareVisible;
|
2021-09-15 06:33:54 +00:00
|
|
|
private final boolean isStartEventVisible;
|
2021-09-24 06:27:57 +00:00
|
|
|
private final boolean primaryInteractionButtonEnabled;
|
2021-09-18 07:43:22 +00:00
|
|
|
private final boolean primaryInteractionButtonVisible;
|
2021-09-15 06:33:54 +00:00
|
|
|
private final GuildScheduledEventTiming timing;
|
2021-09-09 06:47:34 +00:00
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public VisibilityInfo(GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7) {
|
2021-09-15 06:33:54 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
|
|
|
this.guildScheduledEvent = guildScheduledEvent;
|
|
|
|
this.canRsvp = z2;
|
|
|
|
this.canShare = z3;
|
|
|
|
this.canStartEvent = z4;
|
2021-09-27 20:31:35 +00:00
|
|
|
this.isConnected = z5;
|
2021-10-07 06:22:31 +00:00
|
|
|
this.canConnect = z6;
|
|
|
|
this.isDetailView = z7;
|
2021-09-15 06:33:54 +00:00
|
|
|
GuildScheduledEventTiming eventTiming = GuildScheduledEventUtilitiesKt.getEventTiming(guildScheduledEvent);
|
|
|
|
this.timing = eventTiming;
|
2021-10-07 06:22:31 +00:00
|
|
|
boolean z8 = true;
|
|
|
|
boolean z9 = guildScheduledEvent.k() == GuildScheduledEventStatus.COMPLETED;
|
|
|
|
this.isEventComplete = z9;
|
|
|
|
boolean z10 = eventTiming == GuildScheduledEventTiming.LIVE;
|
|
|
|
this.isEventActive = z10;
|
|
|
|
this.canConnectToChannel = z6;
|
2021-09-18 07:43:22 +00:00
|
|
|
this.primaryInteractionButtonVisible = z2;
|
2021-10-07 06:22:31 +00:00
|
|
|
this.primaryInteractionButtonEnabled = !z9 && (!z10 || (guildScheduledEvent.e() != GuildScheduledEventEntityType.EXTERNAL && z6));
|
|
|
|
boolean isStartable = (!z4 || z9) ? false : eventTiming.isStartable();
|
2021-09-15 06:33:54 +00:00
|
|
|
this.isStartEventVisible = isStartable;
|
2021-10-07 06:22:31 +00:00
|
|
|
boolean z11 = z7 && z10 && z5 && z4;
|
|
|
|
this.isEndEventVisible = z11;
|
|
|
|
boolean z12 = z3 && !z9;
|
|
|
|
this.isShareVisible = z12;
|
|
|
|
if (!z2 && !isStartable && !z11 && !z12) {
|
|
|
|
z8 = false;
|
2021-09-15 06:33:54 +00:00
|
|
|
}
|
2021-10-07 06:22:31 +00:00
|
|
|
this.isAnyButtonVisible = z8;
|
2021-09-09 06:47:34 +00:00
|
|
|
}
|
|
|
|
|
2021-09-29 17:50:51 +00:00
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
2021-10-07 06:22:31 +00:00
|
|
|
public /* synthetic */ VisibilityInfo(GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this(guildScheduledEvent, z2, z3, z4, z5, z6, (i & 64) != 0 ? false : z7);
|
2021-09-29 17:50:51 +00:00
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public static /* synthetic */ VisibilityInfo copy$default(VisibilityInfo visibilityInfo, GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, int i, Object obj) {
|
2021-09-15 06:33:54 +00:00
|
|
|
if ((i & 1) != 0) {
|
|
|
|
guildScheduledEvent = visibilityInfo.guildScheduledEvent;
|
|
|
|
}
|
2021-09-09 06:47:34 +00:00
|
|
|
if ((i & 2) != 0) {
|
2021-09-15 06:33:54 +00:00
|
|
|
z2 = visibilityInfo.canRsvp;
|
2021-09-09 06:47:34 +00:00
|
|
|
}
|
|
|
|
if ((i & 4) != 0) {
|
2021-09-15 06:33:54 +00:00
|
|
|
z3 = visibilityInfo.canShare;
|
2021-09-09 06:47:34 +00:00
|
|
|
}
|
|
|
|
if ((i & 8) != 0) {
|
2021-09-15 06:33:54 +00:00
|
|
|
z4 = visibilityInfo.canStartEvent;
|
2021-09-09 06:47:34 +00:00
|
|
|
}
|
2021-09-27 20:31:35 +00:00
|
|
|
if ((i & 16) != 0) {
|
|
|
|
z5 = visibilityInfo.isConnected;
|
|
|
|
}
|
2021-09-29 17:50:51 +00:00
|
|
|
if ((i & 32) != 0) {
|
2021-10-07 06:22:31 +00:00
|
|
|
z6 = visibilityInfo.canConnect;
|
2021-09-29 17:50:51 +00:00
|
|
|
}
|
2021-10-07 06:22:31 +00:00
|
|
|
if ((i & 64) != 0) {
|
|
|
|
z7 = visibilityInfo.isDetailView;
|
|
|
|
}
|
|
|
|
return visibilityInfo.copy(guildScheduledEvent, z2, z3, z4, z5, z6, z7);
|
2021-09-15 06:33:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEvent component1() {
|
|
|
|
return this.guildScheduledEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component2() {
|
|
|
|
return this.canRsvp;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component3() {
|
|
|
|
return this.canShare;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component4() {
|
|
|
|
return this.canStartEvent;
|
2021-09-09 06:47:34 +00:00
|
|
|
}
|
|
|
|
|
2021-09-27 20:31:35 +00:00
|
|
|
public final boolean component5() {
|
|
|
|
return this.isConnected;
|
|
|
|
}
|
|
|
|
|
2021-09-29 17:50:51 +00:00
|
|
|
public final boolean component6() {
|
2021-10-07 06:22:31 +00:00
|
|
|
return this.canConnect;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component7() {
|
2021-09-29 17:50:51 +00:00
|
|
|
return this.isDetailView;
|
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public final VisibilityInfo copy(GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7) {
|
2021-09-09 06:47:34 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
2021-10-07 06:22:31 +00:00
|
|
|
return new VisibilityInfo(guildScheduledEvent, z2, z3, z4, z5, z6, z7);
|
2021-09-15 06:33:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof VisibilityInfo)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
VisibilityInfo visibilityInfo = (VisibilityInfo) obj;
|
2021-10-07 06:22:31 +00:00
|
|
|
return m.areEqual(this.guildScheduledEvent, visibilityInfo.guildScheduledEvent) && this.canRsvp == visibilityInfo.canRsvp && this.canShare == visibilityInfo.canShare && this.canStartEvent == visibilityInfo.canStartEvent && this.isConnected == visibilityInfo.isConnected && this.canConnect == visibilityInfo.canConnect && this.isDetailView == visibilityInfo.isDetailView;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanConnect() {
|
|
|
|
return this.canConnect;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanConnectToChannel() {
|
|
|
|
return this.canConnectToChannel;
|
2021-09-15 06:33:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanRsvp() {
|
|
|
|
return this.canRsvp;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanShare() {
|
|
|
|
return this.canShare;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanStartEvent() {
|
|
|
|
return this.canStartEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEvent getGuildScheduledEvent() {
|
|
|
|
return this.guildScheduledEvent;
|
|
|
|
}
|
|
|
|
|
2021-09-24 06:27:57 +00:00
|
|
|
public final boolean getPrimaryInteractionButtonEnabled() {
|
|
|
|
return this.primaryInteractionButtonEnabled;
|
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
public final boolean getPrimaryInteractionButtonVisible() {
|
|
|
|
return this.primaryInteractionButtonVisible;
|
|
|
|
}
|
|
|
|
|
2021-09-15 06:33:54 +00:00
|
|
|
public final GuildScheduledEventTiming getTiming() {
|
|
|
|
return this.timing;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
GuildScheduledEvent guildScheduledEvent = this.guildScheduledEvent;
|
|
|
|
int hashCode = (guildScheduledEvent != null ? guildScheduledEvent.hashCode() : 0) * 31;
|
|
|
|
boolean z2 = this.canRsvp;
|
|
|
|
int i = 1;
|
|
|
|
if (z2) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
int i2 = z2 ? 1 : 0;
|
|
|
|
int i3 = z2 ? 1 : 0;
|
|
|
|
int i4 = z2 ? 1 : 0;
|
|
|
|
int i5 = (hashCode + i2) * 31;
|
|
|
|
boolean z3 = this.canShare;
|
|
|
|
if (z3) {
|
|
|
|
z3 = true;
|
|
|
|
}
|
|
|
|
int i6 = z3 ? 1 : 0;
|
|
|
|
int i7 = z3 ? 1 : 0;
|
|
|
|
int i8 = z3 ? 1 : 0;
|
|
|
|
int i9 = (i5 + i6) * 31;
|
|
|
|
boolean z4 = this.canStartEvent;
|
2021-09-27 20:31:35 +00:00
|
|
|
if (z4) {
|
|
|
|
z4 = true;
|
|
|
|
}
|
|
|
|
int i10 = z4 ? 1 : 0;
|
|
|
|
int i11 = z4 ? 1 : 0;
|
|
|
|
int i12 = z4 ? 1 : 0;
|
|
|
|
int i13 = (i9 + i10) * 31;
|
|
|
|
boolean z5 = this.isConnected;
|
2021-09-29 17:50:51 +00:00
|
|
|
if (z5) {
|
|
|
|
z5 = true;
|
|
|
|
}
|
|
|
|
int i14 = z5 ? 1 : 0;
|
|
|
|
int i15 = z5 ? 1 : 0;
|
|
|
|
int i16 = z5 ? 1 : 0;
|
|
|
|
int i17 = (i13 + i14) * 31;
|
2021-10-07 06:22:31 +00:00
|
|
|
boolean z6 = this.canConnect;
|
|
|
|
if (z6) {
|
|
|
|
z6 = true;
|
2021-09-15 06:33:54 +00:00
|
|
|
}
|
2021-10-07 06:22:31 +00:00
|
|
|
int i18 = z6 ? 1 : 0;
|
|
|
|
int i19 = z6 ? 1 : 0;
|
|
|
|
int i20 = z6 ? 1 : 0;
|
|
|
|
int i21 = (i17 + i18) * 31;
|
|
|
|
boolean z7 = this.isDetailView;
|
|
|
|
if (!z7) {
|
|
|
|
i = z7 ? 1 : 0;
|
|
|
|
}
|
|
|
|
return i21 + i;
|
2021-09-15 06:33:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isAnyButtonVisible() {
|
|
|
|
return this.isAnyButtonVisible;
|
|
|
|
}
|
|
|
|
|
2021-09-27 20:31:35 +00:00
|
|
|
public final boolean isConnected() {
|
|
|
|
return this.isConnected;
|
|
|
|
}
|
|
|
|
|
2021-09-29 17:50:51 +00:00
|
|
|
public final boolean isDetailView() {
|
|
|
|
return this.isDetailView;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isEndEventVisible() {
|
|
|
|
return this.isEndEventVisible;
|
|
|
|
}
|
|
|
|
|
2021-09-15 06:33:54 +00:00
|
|
|
public final boolean isEventActive() {
|
|
|
|
return this.isEventActive;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isEventComplete() {
|
|
|
|
return this.isEventComplete;
|
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
public final boolean isShareVisible() {
|
|
|
|
return this.isShareVisible;
|
2021-09-15 06:33:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isStartEventVisible() {
|
|
|
|
return this.isStartEventVisible;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-10-09 06:29:02 +00:00
|
|
|
StringBuilder O = a.O("VisibilityInfo(guildScheduledEvent=");
|
|
|
|
O.append(this.guildScheduledEvent);
|
|
|
|
O.append(", canRsvp=");
|
|
|
|
O.append(this.canRsvp);
|
|
|
|
O.append(", canShare=");
|
|
|
|
O.append(this.canShare);
|
|
|
|
O.append(", canStartEvent=");
|
|
|
|
O.append(this.canStartEvent);
|
|
|
|
O.append(", isConnected=");
|
|
|
|
O.append(this.isConnected);
|
|
|
|
O.append(", canConnect=");
|
|
|
|
O.append(this.canConnect);
|
|
|
|
O.append(", isDetailView=");
|
|
|
|
return a.K(O, this.isDetailView, ")");
|
2021-09-09 06:47:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-20 02:22:46 +00:00
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public GuildScheduledEventBottomButtonView(Context context) {
|
|
|
|
super(context);
|
|
|
|
m.checkNotNullParameter(context, "context");
|
|
|
|
GuildScheduledEventBottomButtonViewBinding a = GuildScheduledEventBottomButtonViewBinding.a(LayoutInflater.from(getContext()), this, true);
|
|
|
|
m.checkNotNullExpressionValue(a, "GuildScheduledEventBotto…rom(context), this, true)");
|
|
|
|
this.binding = a;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public GuildScheduledEventBottomButtonView(Context context, AttributeSet attributeSet) {
|
|
|
|
super(context, attributeSet);
|
|
|
|
m.checkNotNullParameter(context, "context");
|
|
|
|
m.checkNotNullParameter(attributeSet, "attrs");
|
|
|
|
GuildScheduledEventBottomButtonViewBinding a = GuildScheduledEventBottomButtonViewBinding.a(LayoutInflater.from(getContext()), this, true);
|
|
|
|
m.checkNotNullExpressionValue(a, "GuildScheduledEventBotto…rom(context), this, true)");
|
|
|
|
this.binding = a;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public GuildScheduledEventBottomButtonView(Context context, AttributeSet attributeSet, int i) {
|
|
|
|
super(context, attributeSet, i);
|
|
|
|
m.checkNotNullParameter(context, "context");
|
|
|
|
m.checkNotNullParameter(attributeSet, "attrs");
|
|
|
|
GuildScheduledEventBottomButtonViewBinding a = GuildScheduledEventBottomButtonViewBinding.a(LayoutInflater.from(getContext()), this, true);
|
|
|
|
m.checkNotNullExpressionValue(a, "GuildScheduledEventBotto…rom(context), this, true)");
|
|
|
|
this.binding = a;
|
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public static /* synthetic */ void configure$default(GuildScheduledEventBottomButtonView guildScheduledEventBottomButtonView, GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, Function0 function0, Function0 function02, Function0 function03, Function0 function04, Function0 function05, int i, Object obj) {
|
|
|
|
boolean z8 = false;
|
|
|
|
boolean z9 = (i & 2) != 0 ? false : z2;
|
|
|
|
boolean z10 = (i & 4) != 0 ? false : z3;
|
|
|
|
boolean z11 = (i & 8) != 0 ? false : z4;
|
|
|
|
boolean z12 = (i & 16) != 0 ? false : z5;
|
|
|
|
boolean z13 = (i & 32) != 0 ? false : z6;
|
|
|
|
if ((i & 64) == 0) {
|
|
|
|
z8 = z7;
|
|
|
|
}
|
|
|
|
guildScheduledEventBottomButtonView.configure(guildScheduledEvent, z9, z10, z11, z12, z13, z8, (i & 128) != 0 ? GuildScheduledEventBottomButtonView$configure$1.INSTANCE : function0, (i & 256) != 0 ? GuildScheduledEventBottomButtonView$configure$2.INSTANCE : function02, (i & 512) != 0 ? GuildScheduledEventBottomButtonView$configure$3.INSTANCE : function03, (i & 1024) != 0 ? GuildScheduledEventBottomButtonView$configure$4.INSTANCE : function04, (i & 2048) != 0 ? GuildScheduledEventBottomButtonView$configure$5.INSTANCE : function05);
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
2021-09-29 17:50:51 +00:00
|
|
|
private final void configureInterestedButton(VisibilityInfo visibilityInfo, boolean z2, Function0<Unit> function0, Function0<Unit> function02, Function0<Unit> function03) {
|
2021-10-28 19:31:20 +00:00
|
|
|
ImageView imageView = this.binding.f2031c;
|
2021-09-15 06:33:54 +00:00
|
|
|
int i = 8;
|
2021-09-18 07:43:22 +00:00
|
|
|
imageView.setVisibility(visibilityInfo.getPrimaryInteractionButtonVisible() ? 0 : 8);
|
2021-09-29 17:50:51 +00:00
|
|
|
boolean primaryInteractionButtonEnabled = visibilityInfo.getPrimaryInteractionButtonEnabled();
|
|
|
|
int i2 = R.drawable.bg_guild_scheduled_event_list_item_interested_button_default;
|
|
|
|
if (!primaryInteractionButtonEnabled) {
|
|
|
|
i2 = R.drawable.bg_guild_scheduled_event_list_item_interested_button_disabled;
|
|
|
|
} else if (!visibilityInfo.isEndEventVisible()) {
|
|
|
|
if (visibilityInfo.isEventActive()) {
|
|
|
|
i2 = R.drawable.bg_guild_scheduled_event_list_item_interested_button_active;
|
|
|
|
} else if (z2) {
|
|
|
|
i2 = R.drawable.bg_guild_scheduled_event_list_item_interested_button_interested;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
imageView.setImageResource(i2);
|
|
|
|
imageView.setOnClickListener(new GuildScheduledEventBottomButtonView$configureInterestedButton$$inlined$apply$lambda$1(visibilityInfo, z2, function03, function02, function0));
|
2021-09-24 06:27:57 +00:00
|
|
|
imageView.setEnabled(visibilityInfo.getPrimaryInteractionButtonEnabled());
|
2021-09-18 07:43:22 +00:00
|
|
|
TextView textView = this.binding.d;
|
|
|
|
if (visibilityInfo.getPrimaryInteractionButtonVisible()) {
|
|
|
|
i = 0;
|
|
|
|
}
|
|
|
|
textView.setVisibility(i);
|
2021-10-08 22:11:56 +00:00
|
|
|
int color = !visibilityInfo.getPrimaryInteractionButtonEnabled() ? ColorCompat.getColor(textView.getContext(), (int) R.color.white_alpha_40) : (!z2 || visibilityInfo.isEventActive() || visibilityInfo.isEventComplete()) ? ColorCompat.getColor(textView.getContext(), (int) R.color.white) : ColorCompat.getThemedColor(textView.getContext(), (int) R.attr.colorBackgroundAccent);
|
2021-09-29 17:50:51 +00:00
|
|
|
int i3 = (visibilityInfo.isEventActive() || !visibilityInfo.getPrimaryInteractionButtonEnabled()) ? 0 : z2 ? R.drawable.ic_check_active_16dp : R.drawable.ic_bell_16dp;
|
2021-10-07 06:22:31 +00:00
|
|
|
int i4 = (!visibilityInfo.isEventActive() || visibilityInfo.getGuildScheduledEvent().e() != GuildScheduledEventEntityType.EXTERNAL) ? (!visibilityInfo.isEventActive() || visibilityInfo.getCanConnectToChannel()) ? visibilityInfo.isEndEventVisible() ? R.string.end_event : (!visibilityInfo.isEventActive() || !visibilityInfo.isConnected()) ? (!visibilityInfo.isEventActive() || visibilityInfo.getGuildScheduledEvent().e() != GuildScheduledEventEntityType.VOICE) ? visibilityInfo.isEventActive() ? R.string.stage_channel_join_button : visibilityInfo.isEventComplete() ? R.string.guild_event_invite_completed : R.string.stage_instance_interested_label : R.string.guild_event_join : R.string.go_to_channel : R.string.channel_locked_short : R.string.guild_event_started;
|
2021-09-29 17:50:51 +00:00
|
|
|
DrawableCompat.setCompoundDrawablesCompat$default(textView, i3, 0, 0, 0, 14, (Object) null);
|
2021-08-20 02:22:46 +00:00
|
|
|
textView.setTextColor(color);
|
|
|
|
Context context = textView.getContext();
|
|
|
|
m.checkNotNullExpressionValue(context, "context");
|
2021-09-29 17:50:51 +00:00
|
|
|
textView.setText(b.h(context, i4, new Object[0], null, 4));
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final void configureShareButton(VisibilityInfo visibilityInfo, Function0<Unit> function0) {
|
|
|
|
ImageView imageView = this.binding.e;
|
|
|
|
m.checkNotNullExpressionValue(imageView, "this");
|
|
|
|
imageView.setVisibility(visibilityInfo.isShareVisible() ? 0 : 8);
|
|
|
|
imageView.setOnClickListener(new GuildScheduledEventBottomButtonView$configureShareButton$$inlined$apply$lambda$1(visibilityInfo, function0));
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void configureStartEventButton(VisibilityInfo visibilityInfo, Function0<Unit> function0) {
|
|
|
|
TextView textView = this.binding.g;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.startEventButtonText");
|
|
|
|
int i = 0;
|
|
|
|
textView.setVisibility(visibilityInfo.isStartEventVisible() ? 0 : 8);
|
|
|
|
ImageView imageView = this.binding.f;
|
|
|
|
if (!visibilityInfo.isStartEventVisible()) {
|
|
|
|
i = 8;
|
|
|
|
}
|
|
|
|
imageView.setVisibility(i);
|
|
|
|
imageView.setOnClickListener(new GuildScheduledEventBottomButtonView$configureStartEventButton$$inlined$apply$lambda$1(visibilityInfo, function0));
|
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public final void configure(GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, Function0<Unit> function0, Function0<Unit> function02, Function0<Unit> function03, Function0<Unit> function04, Function0<Unit> function05) {
|
2021-09-18 07:43:22 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
|
|
|
m.checkNotNullParameter(function0, "onRsvpButtonClicked");
|
|
|
|
m.checkNotNullParameter(function02, "onStartEventButtonClicked");
|
|
|
|
m.checkNotNullParameter(function03, "onShareButtonClicked");
|
|
|
|
m.checkNotNullParameter(function04, "onJoinButtonClicked");
|
2021-09-29 17:50:51 +00:00
|
|
|
m.checkNotNullParameter(function05, "onEndEventButtonClicked");
|
2021-10-07 06:22:31 +00:00
|
|
|
VisibilityInfo visibilityInfo = new VisibilityInfo(guildScheduledEvent, z3, z4, z5, z6, z7, false, 64, null);
|
2021-09-18 07:43:22 +00:00
|
|
|
configureStartEventButton(visibilityInfo, function02);
|
2021-09-29 17:50:51 +00:00
|
|
|
configureInterestedButton(visibilityInfo, z2, function0, function04, function05);
|
2021-09-18 07:43:22 +00:00
|
|
|
configureShareButton(visibilityInfo, function03);
|
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public final void configureForDetails(GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, Function0<Unit> function0, Function0<Unit> function02, Function0<Unit> function03, Function0<Unit> function04, Function0<Unit> function05, Function0<Unit> function06) {
|
|
|
|
boolean z8;
|
2021-09-29 17:50:51 +00:00
|
|
|
Function0<Unit> function07;
|
|
|
|
Function0<Unit> function08;
|
|
|
|
VisibilityInfo visibilityInfo;
|
2021-09-18 07:43:22 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
|
|
|
m.checkNotNullParameter(function0, "onStartEventButtonClicked");
|
|
|
|
m.checkNotNullParameter(function02, "onRsvpButtonClicked");
|
|
|
|
m.checkNotNullParameter(function03, "onShareButtonClicked");
|
|
|
|
m.checkNotNullParameter(function05, "onJoinButtonClicked");
|
2021-09-29 17:50:51 +00:00
|
|
|
m.checkNotNullParameter(function06, "onEndEventButtonClicked");
|
2021-10-07 06:22:31 +00:00
|
|
|
VisibilityInfo visibilityInfo2 = new VisibilityInfo(guildScheduledEvent, true, z4, z5, z3, z6, true);
|
2021-09-29 17:50:51 +00:00
|
|
|
configureStartEventButton(visibilityInfo2, function0);
|
2021-09-18 07:43:22 +00:00
|
|
|
int i = 8;
|
2021-09-29 17:50:51 +00:00
|
|
|
if (visibilityInfo2.isStartEventVisible()) {
|
2021-10-28 19:31:20 +00:00
|
|
|
ImageView imageView = this.binding.f2031c;
|
2021-09-18 07:43:22 +00:00
|
|
|
m.checkNotNullExpressionValue(imageView, "binding.interestedButton");
|
|
|
|
imageView.setVisibility(8);
|
|
|
|
TextView textView = this.binding.d;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.interestedButtonText");
|
|
|
|
textView.setVisibility(8);
|
2021-09-29 17:50:51 +00:00
|
|
|
visibilityInfo = visibilityInfo2;
|
|
|
|
function08 = function04;
|
|
|
|
function07 = function03;
|
2021-10-07 06:22:31 +00:00
|
|
|
z8 = z7;
|
2021-09-18 07:43:22 +00:00
|
|
|
} else {
|
2021-09-29 17:50:51 +00:00
|
|
|
visibilityInfo = visibilityInfo2;
|
|
|
|
function08 = function04;
|
|
|
|
function07 = function03;
|
2021-10-07 06:22:31 +00:00
|
|
|
z8 = z7;
|
2021-09-29 17:50:51 +00:00
|
|
|
configureInterestedButton(visibilityInfo2, z2, function02, function05, function06);
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
2021-09-29 17:50:51 +00:00
|
|
|
configureShareButton(visibilityInfo, function07);
|
2021-09-18 07:43:22 +00:00
|
|
|
ImageView imageView2 = this.binding.b;
|
2021-10-07 06:22:31 +00:00
|
|
|
if (function08 != null && (z5 || z8)) {
|
2021-09-15 06:33:54 +00:00
|
|
|
i = 0;
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
2021-09-18 07:43:22 +00:00
|
|
|
imageView2.setVisibility(i);
|
2021-09-29 17:50:51 +00:00
|
|
|
if (function08 != null) {
|
2021-10-07 06:22:31 +00:00
|
|
|
imageView2.setOnClickListener(new GuildScheduledEventBottomButtonView$configureForDetails$$inlined$apply$lambda$1(function08, z5, z8));
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEventBottomButtonViewBinding getBinding() {
|
|
|
|
return this.binding;
|
|
|
|
}
|
|
|
|
}
|