forked from Juby210/discord-jadx
144 lines
7.8 KiB
Java
144 lines
7.8 KiB
Java
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 c0.z.d.m;
|
|
import com.discord.R;
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventStatus;
|
|
import com.discord.databinding.GuildScheduledEventDateViewBinding;
|
|
import com.discord.utilities.color.ColorCompat;
|
|
import com.discord.utilities.color.ColorCompatKt;
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventTiming;
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilitiesKt;
|
|
/* compiled from: GuildScheduledEventDateView.kt */
|
|
public final class GuildScheduledEventDateView extends ConstraintLayout {
|
|
private final GuildScheduledEventDateViewBinding binding;
|
|
|
|
public final /* synthetic */ class WhenMappings {
|
|
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
|
public static final /* synthetic */ int[] $EnumSwitchMapping$1;
|
|
|
|
static {
|
|
GuildScheduledEventTiming.values();
|
|
int[] iArr = new int[7];
|
|
$EnumSwitchMapping$0 = iArr;
|
|
GuildScheduledEventTiming guildScheduledEventTiming = GuildScheduledEventTiming.LIVE;
|
|
iArr[guildScheduledEventTiming.ordinal()] = 1;
|
|
GuildScheduledEventTiming guildScheduledEventTiming2 = GuildScheduledEventTiming.SOON;
|
|
iArr[guildScheduledEventTiming2.ordinal()] = 2;
|
|
GuildScheduledEventTiming guildScheduledEventTiming3 = GuildScheduledEventTiming.NOW;
|
|
iArr[guildScheduledEventTiming3.ordinal()] = 3;
|
|
GuildScheduledEventTiming guildScheduledEventTiming4 = GuildScheduledEventTiming.EXPIRED;
|
|
iArr[guildScheduledEventTiming4.ordinal()] = 4;
|
|
GuildScheduledEventTiming.values();
|
|
int[] iArr2 = new int[7];
|
|
$EnumSwitchMapping$1 = iArr2;
|
|
iArr2[guildScheduledEventTiming.ordinal()] = 1;
|
|
iArr2[guildScheduledEventTiming2.ordinal()] = 2;
|
|
iArr2[guildScheduledEventTiming3.ordinal()] = 3;
|
|
iArr2[guildScheduledEventTiming4.ordinal()] = 4;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public GuildScheduledEventDateView(Context context) {
|
|
super(context);
|
|
m.checkNotNullParameter(context, "context");
|
|
GuildScheduledEventDateViewBinding a = GuildScheduledEventDateViewBinding.a(LayoutInflater.from(getContext()), this, true);
|
|
m.checkNotNullExpressionValue(a, "GuildScheduledEventDateV…rom(context), this, true)");
|
|
this.binding = a;
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public GuildScheduledEventDateView(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
m.checkNotNullParameter(context, "context");
|
|
m.checkNotNullParameter(attributeSet, "attrs");
|
|
GuildScheduledEventDateViewBinding a = GuildScheduledEventDateViewBinding.a(LayoutInflater.from(getContext()), this, true);
|
|
m.checkNotNullExpressionValue(a, "GuildScheduledEventDateV…rom(context), this, true)");
|
|
this.binding = a;
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public GuildScheduledEventDateView(Context context, AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
m.checkNotNullParameter(context, "context");
|
|
m.checkNotNullParameter(attributeSet, "attrs");
|
|
GuildScheduledEventDateViewBinding a = GuildScheduledEventDateViewBinding.a(LayoutInflater.from(getContext()), this, true);
|
|
m.checkNotNullExpressionValue(a, "GuildScheduledEventDateV…rom(context), this, true)");
|
|
this.binding = a;
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:13:0x005a */
|
|
/* JADX WARNING: Removed duplicated region for block: B:15:0x0068 */
|
|
private final void configureViaTiming(GuildScheduledEventTiming guildScheduledEventTiming, CharSequence charSequence) {
|
|
int ordinal;
|
|
int i;
|
|
ImageView imageView = this.binding.b;
|
|
int ordinal2 = guildScheduledEventTiming.ordinal();
|
|
if (!(ordinal2 == 3 || ordinal2 == 4)) {
|
|
if (ordinal2 == 5) {
|
|
imageView.setImageResource(R.drawable.ic_event_20dp);
|
|
ColorCompatKt.tintWithColor(imageView, ColorCompat.getColor(imageView.getContext(), (int) R.color.status_green_600));
|
|
} else if (ordinal2 != 6) {
|
|
imageView.setImageResource(R.drawable.ic_event_20dp);
|
|
ColorCompatKt.tintWithColor(imageView, ColorCompat.getThemedColor(imageView.getContext(), (int) R.attr.colorControlBrandForegroundNew));
|
|
}
|
|
TextView textView = this.binding.f2032c;
|
|
ordinal = guildScheduledEventTiming.ordinal();
|
|
if (!(ordinal == 3 || ordinal == 4)) {
|
|
if (ordinal != 5) {
|
|
i = ColorCompat.getColor(textView.getContext(), (int) R.color.status_green_600);
|
|
} else if (ordinal != 6) {
|
|
i = ColorCompat.getThemedColor(textView.getContext(), (int) R.attr.colorHeaderSecondary);
|
|
}
|
|
textView.setTextColor(i);
|
|
textView.setText(charSequence);
|
|
}
|
|
i = ColorCompat.getThemedColor(textView.getContext(), (int) R.attr.colorControlBrandForegroundNew);
|
|
textView.setTextColor(i);
|
|
textView.setText(charSequence);
|
|
}
|
|
imageView.setImageResource(R.drawable.ic_clock_20dp);
|
|
ColorCompatKt.tintWithColor(imageView, ColorCompat.getThemedColor(imageView.getContext(), (int) R.attr.colorControlBrandForegroundNew));
|
|
TextView textView = this.binding.f2032c;
|
|
ordinal = guildScheduledEventTiming.ordinal();
|
|
if (ordinal != 5) {
|
|
}
|
|
textView.setTextColor(i);
|
|
textView.setText(charSequence);
|
|
}
|
|
|
|
public final void configure(long j) {
|
|
GuildScheduledEventTiming eventTiming = GuildScheduledEventUtilitiesKt.getEventTiming(j);
|
|
Context context = getContext();
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
configureViaTiming(eventTiming, GuildScheduledEventUtilitiesKt.getEventStartingTimeString(j, context));
|
|
}
|
|
|
|
public final void configure(GuildScheduledEvent guildScheduledEvent) {
|
|
m.checkNotNullParameter(guildScheduledEvent, "event");
|
|
if (guildScheduledEvent.k() == GuildScheduledEventStatus.CANCELED || guildScheduledEvent.k() == GuildScheduledEventStatus.COMPLETED) {
|
|
ImageView imageView = this.binding.b;
|
|
imageView.setImageResource(R.drawable.ic_event_20dp);
|
|
ColorCompatKt.tintWithColor(imageView, ColorCompat.getThemedColor(imageView.getContext(), (int) R.attr.colorControlBrandForegroundNew));
|
|
TextView textView = this.binding.f2032c;
|
|
textView.setTextColor(ColorCompat.getThemedColor(textView.getContext(), (int) R.attr.colorHeaderSecondary));
|
|
Context context = textView.getContext();
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
textView.setText(GuildScheduledEventUtilitiesKt.getEventStartingTimeString(guildScheduledEvent, context));
|
|
m.checkNotNullExpressionValue(textView, "binding.guildScheduledEv…meString(context)\n }");
|
|
return;
|
|
}
|
|
GuildScheduledEventTiming eventTiming = GuildScheduledEventUtilitiesKt.getEventTiming(guildScheduledEvent);
|
|
Context context2 = getContext();
|
|
m.checkNotNullExpressionValue(context2, "context");
|
|
configureViaTiming(eventTiming, GuildScheduledEventUtilitiesKt.getEventStartingTimeString(guildScheduledEvent, context2));
|
|
}
|
|
}
|