94 lines
5.1 KiB
Java
94 lines
5.1 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 com.discord.R;
|
|
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;
|
|
import d0.z.d.m;
|
|
/* 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.values();
|
|
int[] iArr2 = new int[7];
|
|
$EnumSwitchMapping$1 = iArr2;
|
|
iArr2[guildScheduledEventTiming.ordinal()] = 1;
|
|
iArr2[guildScheduledEventTiming2.ordinal()] = 2;
|
|
iArr2[guildScheduledEventTiming3.ordinal()] = 3;
|
|
}
|
|
}
|
|
|
|
/* 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;
|
|
}
|
|
|
|
public final void configure(long j) {
|
|
GuildScheduledEventTiming eventTiming = GuildScheduledEventUtilitiesKt.getEventTiming(j);
|
|
ImageView imageView = this.binding.b;
|
|
int ordinal = eventTiming.ordinal();
|
|
if (ordinal == 3 || ordinal == 4) {
|
|
imageView.setImageResource(R.drawable.ic_clock_20dp);
|
|
ColorCompatKt.tintWithColor(imageView, ColorCompat.getThemedColor(imageView.getContext(), (int) R.attr.colorControlBrandForegroundNew));
|
|
} else if (ordinal != 5) {
|
|
imageView.setImageResource(R.drawable.ic_event_20dp);
|
|
ColorCompatKt.tintWithColor(imageView, ColorCompat.getThemedColor(imageView.getContext(), (int) R.attr.colorControlBrandForegroundNew));
|
|
} else {
|
|
imageView.setImageResource(R.drawable.ic_channel_stage_24dp);
|
|
ColorCompatKt.tintWithColor(imageView, ColorCompat.getColor(imageView.getContext(), (int) R.color.status_green_600));
|
|
}
|
|
TextView textView = this.binding.f1616c;
|
|
int ordinal2 = eventTiming.ordinal();
|
|
textView.setTextColor((ordinal2 == 3 || ordinal2 == 4) ? ColorCompat.getThemedColor(textView.getContext(), (int) R.attr.colorControlBrandForegroundNew) : ordinal2 != 5 ? ColorCompat.getThemedColor(textView.getContext(), (int) R.attr.colorHeaderPrimary) : ColorCompat.getColor(textView.getContext(), (int) R.color.status_green_600));
|
|
Context context = textView.getContext();
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
textView.setText(GuildScheduledEventUtilitiesKt.getEventStartingTimeString(j, context));
|
|
}
|
|
}
|