117 lines
4.9 KiB
Java
117 lines
4.9 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.j.z2;
|
|
import com.discord.R;
|
|
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 z2 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(R.layout.view_server_folder, this);
|
|
int i2 = R.id.folder_view_folder_image;
|
|
ImageView imageView = (ImageView) findViewById(R.id.folder_view_folder_image);
|
|
if (imageView != null) {
|
|
i2 = R.id.guild_view_1;
|
|
GuildView guildView = (GuildView) findViewById(R.id.guild_view_1);
|
|
if (guildView != null) {
|
|
i2 = R.id.guild_view_2;
|
|
GuildView guildView2 = (GuildView) findViewById(R.id.guild_view_2);
|
|
if (guildView2 != null) {
|
|
i2 = R.id.guild_view_3;
|
|
GuildView guildView3 = (GuildView) findViewById(R.id.guild_view_3);
|
|
if (guildView3 != null) {
|
|
i2 = R.id.guild_view_4;
|
|
GuildView guildView4 = (GuildView) findViewById(R.id.guild_view_4);
|
|
if (guildView4 != null) {
|
|
i2 = R.id.guild_views;
|
|
GridLayout gridLayout = (GridLayout) findViewById(R.id.guild_views);
|
|
if (gridLayout != null) {
|
|
z2 z2Var = new z2(this, imageView, guildView, guildView2, guildView3, guildView4, gridLayout);
|
|
m.checkNotNullExpressionValue(z2Var, "ViewServerFolderBinding.…ater.from(context), this)");
|
|
this.j = z2Var;
|
|
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);
|
|
}
|
|
}
|