discord-jadx/app/src/main/java/com/discord/widgets/stage/usersheet/UserProfileStageActionsView...

265 lines
12 KiB
Java

package com.discord.widgets.stage.usersheet;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import c.d.b.a.a;
import com.discord.api.channel.Channel;
import com.discord.api.voice.state.StageRequestToSpeakState;
import com.discord.databinding.UserProfileStageActionsViewBinding;
import com.discord.utilities.drawable.DrawableCompat;
import com.discord.widgets.stage.StageRoles;
import d0.z.d.m;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: UserProfileStageActionsView.kt */
public final class UserProfileStageActionsView extends LinearLayout {
private final UserProfileStageActionsViewBinding binding;
/* compiled from: UserProfileStageActionsView.kt */
public static final class ViewState {
private final Channel channel;
private final boolean isInvitingToSpeak;
private final boolean isMe;
private final boolean isUpdatingSuppressed;
private final StageRoles myStageRole;
private final boolean userInSameVoiceChannel;
private final StageRequestToSpeakState userRequestToSpeakState;
private final StageRoles userStageRole;
private ViewState(boolean z2, Channel channel, StageRoles stageRoles, StageRoles stageRoles2, StageRequestToSpeakState stageRequestToSpeakState, boolean z3, boolean z4, boolean z5) {
this.isMe = z2;
this.channel = channel;
this.myStageRole = stageRoles;
this.userStageRole = stageRoles2;
this.userRequestToSpeakState = stageRequestToSpeakState;
this.userInSameVoiceChannel = z3;
this.isUpdatingSuppressed = z4;
this.isInvitingToSpeak = z5;
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ ViewState(boolean z2, Channel channel, StageRoles stageRoles, StageRoles stageRoles2, StageRequestToSpeakState stageRequestToSpeakState, boolean z3, boolean z4, boolean z5, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(z2, channel, stageRoles, stageRoles2, stageRequestToSpeakState, z3, (i & 64) != 0 ? false : z4, (i & 128) != 0 ? false : z5);
}
public /* synthetic */ ViewState(boolean z2, Channel channel, StageRoles stageRoles, StageRoles stageRoles2, StageRequestToSpeakState stageRequestToSpeakState, boolean z3, boolean z4, boolean z5, DefaultConstructorMarker defaultConstructorMarker) {
this(z2, channel, stageRoles, stageRoles2, stageRequestToSpeakState, z3, z4, z5);
}
/* renamed from: copy-pGLTHTc$default reason: not valid java name */
public static /* synthetic */ ViewState m48copypGLTHTc$default(ViewState viewState, boolean z2, Channel channel, StageRoles stageRoles, StageRoles stageRoles2, StageRequestToSpeakState stageRequestToSpeakState, boolean z3, boolean z4, boolean z5, int i, Object obj) {
return viewState.m51copypGLTHTc((i & 1) != 0 ? viewState.isMe : z2, (i & 2) != 0 ? viewState.channel : channel, (i & 4) != 0 ? viewState.myStageRole : stageRoles, (i & 8) != 0 ? viewState.userStageRole : stageRoles2, (i & 16) != 0 ? viewState.userRequestToSpeakState : stageRequestToSpeakState, (i & 32) != 0 ? viewState.userInSameVoiceChannel : z3, (i & 64) != 0 ? viewState.isUpdatingSuppressed : z4, (i & 128) != 0 ? viewState.isInvitingToSpeak : z5);
}
public final boolean component1() {
return this.isMe;
}
public final Channel component2() {
return this.channel;
}
/* renamed from: component3-twRsX-0 reason: not valid java name */
public final StageRoles m49component3twRsX0() {
return this.myStageRole;
}
/* renamed from: component4-twRsX-0 reason: not valid java name */
public final StageRoles m50component4twRsX0() {
return this.userStageRole;
}
public final StageRequestToSpeakState component5() {
return this.userRequestToSpeakState;
}
public final boolean component6() {
return this.userInSameVoiceChannel;
}
public final boolean component7() {
return this.isUpdatingSuppressed;
}
public final boolean component8() {
return this.isInvitingToSpeak;
}
/* renamed from: copy-pGLTHTc reason: not valid java name */
public final ViewState m51copypGLTHTc(boolean z2, Channel channel, StageRoles stageRoles, StageRoles stageRoles2, StageRequestToSpeakState stageRequestToSpeakState, boolean z3, boolean z4, boolean z5) {
m.checkNotNullParameter(stageRequestToSpeakState, "userRequestToSpeakState");
return new ViewState(z2, channel, stageRoles, stageRoles2, stageRequestToSpeakState, z3, z4, z5);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ViewState)) {
return false;
}
ViewState viewState = (ViewState) obj;
return this.isMe == viewState.isMe && m.areEqual(this.channel, viewState.channel) && m.areEqual(this.myStageRole, viewState.myStageRole) && m.areEqual(this.userStageRole, viewState.userStageRole) && m.areEqual(this.userRequestToSpeakState, viewState.userRequestToSpeakState) && this.userInSameVoiceChannel == viewState.userInSameVoiceChannel && this.isUpdatingSuppressed == viewState.isUpdatingSuppressed && this.isInvitingToSpeak == viewState.isInvitingToSpeak;
}
public final Channel getChannel() {
return this.channel;
}
/* renamed from: getMyStageRole-twRsX-0 reason: not valid java name */
public final StageRoles m52getMyStageRoletwRsX0() {
return this.myStageRole;
}
public final boolean getUserInSameVoiceChannel() {
return this.userInSameVoiceChannel;
}
public final StageRequestToSpeakState getUserRequestToSpeakState() {
return this.userRequestToSpeakState;
}
/* renamed from: getUserStageRole-twRsX-0 reason: not valid java name */
public final StageRoles m53getUserStageRoletwRsX0() {
return this.userStageRole;
}
public int hashCode() {
boolean z2 = this.isMe;
int i = 1;
if (z2) {
z2 = true;
}
int i2 = z2 ? 1 : 0;
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = i2 * 31;
Channel channel = this.channel;
int i6 = 0;
int hashCode = (i5 + (channel != null ? channel.hashCode() : 0)) * 31;
StageRoles stageRoles = this.myStageRole;
int hashCode2 = (hashCode + (stageRoles != null ? stageRoles.hashCode() : 0)) * 31;
StageRoles stageRoles2 = this.userStageRole;
int hashCode3 = (hashCode2 + (stageRoles2 != null ? stageRoles2.hashCode() : 0)) * 31;
StageRequestToSpeakState stageRequestToSpeakState = this.userRequestToSpeakState;
if (stageRequestToSpeakState != null) {
i6 = stageRequestToSpeakState.hashCode();
}
int i7 = (hashCode3 + i6) * 31;
boolean z3 = this.userInSameVoiceChannel;
if (z3) {
z3 = true;
}
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = z3 ? 1 : 0;
int i11 = (i7 + i8) * 31;
boolean z4 = this.isUpdatingSuppressed;
if (z4) {
z4 = true;
}
int i12 = z4 ? 1 : 0;
int i13 = z4 ? 1 : 0;
int i14 = z4 ? 1 : 0;
int i15 = (i11 + i12) * 31;
boolean z5 = this.isInvitingToSpeak;
if (!z5) {
i = z5 ? 1 : 0;
}
return i15 + i;
}
public final boolean isInvitingToSpeak() {
return this.isInvitingToSpeak;
}
public final boolean isMe() {
return this.isMe;
}
public final boolean isUpdatingSuppressed() {
return this.isUpdatingSuppressed;
}
public String toString() {
StringBuilder K = a.K("ViewState(isMe=");
K.append(this.isMe);
K.append(", channel=");
K.append(this.channel);
K.append(", myStageRole=");
K.append(this.myStageRole);
K.append(", userStageRole=");
K.append(this.userStageRole);
K.append(", userRequestToSpeakState=");
K.append(this.userRequestToSpeakState);
K.append(", userInSameVoiceChannel=");
K.append(this.userInSameVoiceChannel);
K.append(", isUpdatingSuppressed=");
K.append(this.isUpdatingSuppressed);
K.append(", isInvitingToSpeak=");
return a.F(K, this.isInvitingToSpeak, ")");
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public UserProfileStageActionsView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
m.checkNotNullParameter(context, "context");
m.checkNotNullParameter(attributeSet, "attrs");
View inflate = LayoutInflater.from(context).inflate(2131558719, (ViewGroup) this, false);
addView(inflate);
int i = 2131365562;
TextView textView = (TextView) inflate.findViewById(2131365562);
if (textView != null) {
i = 2131365563;
TextView textView2 = (TextView) inflate.findViewById(2131365563);
if (textView2 != null) {
UserProfileStageActionsViewBinding userProfileStageActionsViewBinding = new UserProfileStageActionsViewBinding((LinearLayout) inflate, textView, textView2);
m.checkNotNullExpressionValue(userProfileStageActionsViewBinding, "UserProfileStageActionsV…rom(context), this, true)");
this.binding = userProfileStageActionsViewBinding;
return;
}
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
}
public final void setOnInviteToSpeak(Function0<Unit> function0) {
m.checkNotNullParameter(function0, "onInviteToSpeak");
this.binding.b.setOnClickListener(new UserProfileStageActionsView$setOnInviteToSpeak$1(function0));
}
public final void setOnMoveToAudience(Function0<Unit> function0) {
m.checkNotNullParameter(function0, "onMoveToAudience");
this.binding.f1644c.setOnClickListener(new UserProfileStageActionsView$setOnMoveToAudience$1(function0));
}
public final void updateView(ViewState viewState) {
m.checkNotNullParameter(viewState, "viewState");
StageRoles r0 = viewState.m52getMyStageRoletwRsX0();
int i = 8;
if (r0 == null || !StageRoles.m25isModeratorimpl(r0.m28unboximpl()) || !viewState.getUserInSameVoiceChannel()) {
setVisibility(8);
return;
}
setVisibility(0);
TextView textView = this.binding.b;
textView.setVisibility(viewState.getUserRequestToSpeakState().getCanBeInvitedToSpeak() ? 0 : 8);
textView.setEnabled(!viewState.isInvitingToSpeak());
textView.setText(viewState.isMe() ? 2131891398 : 2131893540);
DrawableCompat.setCompoundDrawablesCompat$default(textView, viewState.isMe() ? 2131231980 : 2131231977, 0, 0, 0, 14, (Object) null);
TextView textView2 = this.binding.f1644c;
StageRoles r4 = viewState.m53getUserStageRoletwRsX0();
if (r4 != null && StageRoles.m26isSpeakerimpl(r4.m28unboximpl())) {
i = 0;
}
textView2.setVisibility(i);
textView2.setEnabled(!viewState.isUpdatingSuppressed());
}
}