discord-jadx/app/src/main/java/com/discord/views/ServerFolderView.java

117 lines
4.8 KiB
Java

package com.discord.views;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.GridLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.annotation.AnimRes;
import c.a.i.x2;
import com.discord.utilities.accessibility.AccessibilityUtils;
import d0.z.d.m;
/* compiled from: ServerFolderView.kt */
public final class ServerFolderView extends LinearLayout {
public static final /* synthetic */ int i = 0;
public final x2 j;
public Long k;
public boolean l;
/* compiled from: ServerFolderView.kt */
public static final class a implements Animation.AnimationListener {
public final /* synthetic */ ServerFolderView i;
public a(ServerFolderView serverFolderView) {
this.i = serverFolderView;
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(Animation animation) {
ServerFolderView serverFolderView = this.i;
int i = ServerFolderView.i;
serverFolderView.a();
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ServerFolderView(Context context, AttributeSet attributeSet) {
super(context, attributeSet, 0);
m.checkNotNullParameter(context, "context");
LayoutInflater.from(context).inflate(2131558803, this);
int i2 = 2131363278;
ImageView imageView = (ImageView) findViewById(2131363278);
if (imageView != null) {
i2 = 2131363551;
GuildView guildView = (GuildView) findViewById(2131363551);
if (guildView != null) {
i2 = 2131363552;
GuildView guildView2 = (GuildView) findViewById(2131363552);
if (guildView2 != null) {
i2 = 2131363553;
GuildView guildView3 = (GuildView) findViewById(2131363553);
if (guildView3 != null) {
i2 = 2131363554;
GuildView guildView4 = (GuildView) findViewById(2131363554);
if (guildView4 != null) {
i2 = 2131363555;
GridLayout gridLayout = (GridLayout) findViewById(2131363555);
if (gridLayout != null) {
x2 x2Var = new x2(this, imageView, guildView, guildView2, guildView3, guildView4, gridLayout);
m.checkNotNullExpressionValue(x2Var, "ViewServerFolderBinding.…ater.from(context), this)");
this.j = x2Var;
setOrientation(1);
return;
}
}
}
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(i2)));
}
public final void a() {
if (this.l) {
ImageView imageView = this.j.b;
m.checkNotNullExpressionValue(imageView, "binding.folderViewFolderImage");
imageView.setVisibility(0);
GridLayout gridLayout = this.j.g;
m.checkNotNullExpressionValue(gridLayout, "binding.guildViews");
gridLayout.setVisibility(8);
return;
}
ImageView imageView2 = this.j.b;
m.checkNotNullExpressionValue(imageView2, "binding.folderViewFolderImage");
imageView2.setVisibility(8);
GridLayout gridLayout2 = this.j.g;
m.checkNotNullExpressionValue(gridLayout2, "binding.guildViews");
gridLayout2.setVisibility(0);
}
public final void b(@AnimRes int i2) {
Animation loadAnimation = AnimationUtils.loadAnimation(getContext(), i2);
loadAnimation.setAnimationListener(new a(this));
if (AccessibilityUtils.INSTANCE.isReducedMotionEnabled()) {
m.checkNotNullExpressionValue(loadAnimation, "animation");
loadAnimation.setDuration(0);
}
ImageView imageView = this.j.b;
m.checkNotNullExpressionValue(imageView, "binding.folderViewFolderImage");
imageView.setVisibility(0);
GridLayout gridLayout = this.j.g;
m.checkNotNullExpressionValue(gridLayout, "binding.guildViews");
gridLayout.setVisibility(0);
this.j.b.startAnimation(loadAnimation);
}
}