discord-jadx/app/src/main/java/com/discord/views/premiumguild/PremiumGuildProgressView.java

68 lines
3.0 KiB
Java

package com.discord.views.premiumguild;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import c.a.i.n2;
import com.discord.utilities.drawable.DrawableCompat;
import com.discord.utilities.premium.PremiumGuildSubscriptionUtils;
import d0.z.d.m;
/* compiled from: PremiumGuildProgressView.kt */
public final class PremiumGuildProgressView extends FrameLayout {
public final n2 i;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public PremiumGuildProgressView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
m.checkNotNullParameter(context, "context");
View inflate = LayoutInflater.from(getContext()).inflate(2131558787, (ViewGroup) this, false);
addView(inflate);
int i = 2131364459;
ImageView imageView = (ImageView) inflate.findViewById(2131364459);
if (imageView != null) {
i = 2131364461;
TextView textView = (TextView) inflate.findViewById(2131364461);
if (textView != null) {
i = 2131364462;
ProgressBar progressBar = (ProgressBar) inflate.findViewById(2131364462);
if (progressBar != null) {
n2 n2Var = new n2((FrameLayout) inflate, imageView, textView, progressBar);
m.checkNotNullExpressionValue(n2Var, "ViewPremiumGuildProgress…rom(context), this, true)");
this.i = n2Var;
return;
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
}
public final void a(int i, int i2) {
ImageView imageView = this.i.b;
int i3 = 0;
if (i == 0) {
Context context = getContext();
m.checkNotNullExpressionValue(context, "context");
i3 = DrawableCompat.getThemedDrawableRes$default(context, 2130968721, 0, 2, (Object) null);
} else if (i == 1) {
i3 = 2131231459;
} else if (i == 2) {
i3 = 2131231460;
} else if (i == 3) {
i3 = 2131231461;
}
imageView.setImageResource(i3);
TextView textView = this.i.f129c;
m.checkNotNullExpressionValue(textView, "binding.progressLevelText");
textView.setText(i != 0 ? i != 1 ? i != 2 ? i != 3 ? "" : getContext().getString(2131892316) : getContext().getString(2131892315) : getContext().getString(2131892314) : getContext().getString(2131892169));
ProgressBar progressBar = this.i.d;
m.checkNotNullExpressionValue(progressBar, "binding.progressProgress");
progressBar.setProgress(PremiumGuildSubscriptionUtils.INSTANCE.calculatePercentToNextTier(i, i2));
}
}