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.w2;
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 w2 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(2131558796, this);
int i2 = 2131363247;
ImageView imageView = (ImageView) findViewById(2131363247);
if (imageView != null) {
i2 = 2131363503;
GuildView guildView = (GuildView) findViewById(2131363503);
if (guildView != null) {
i2 = 2131363504;
GuildView guildView2 = (GuildView) findViewById(2131363504);
if (guildView2 != null) {
i2 = 2131363505;
GuildView guildView3 = (GuildView) findViewById(2131363505);
if (guildView3 != null) {
i2 = 2131363506;
GuildView guildView4 = (GuildView) findViewById(2131363506);
if (guildView4 != null) {
i2 = 2131363507;
GridLayout gridLayout = (GridLayout) findViewById(2131363507);
if (gridLayout != null) {
w2 w2Var = new w2(this, imageView, guildView, guildView2, guildView3, guildView4, gridLayout);
m.checkNotNullExpressionValue(w2Var, "ViewServerFolderBinding.…ater.from(context), this)");
this.j = w2Var;
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);
}
}