111 lines
5.1 KiB
Java
111 lines
5.1 KiB
Java
package com.discord.widgets.tos;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import com.discord.api.report.ReportReason;
|
|
import com.discord.databinding.WidgetTosReportViolationReasonBinding;
|
|
import com.google.android.material.radiobutton.MaterialRadioButton;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Ref$BooleanRef;
|
|
/* compiled from: WidgetTosReportViolationReasonView.kt */
|
|
public final class WidgetTosReportViolationReasonView extends RelativeLayout {
|
|
private final WidgetTosReportViolationReasonBinding binding;
|
|
private ReportReason reason;
|
|
|
|
public WidgetTosReportViolationReasonView(Context context) {
|
|
this(context, null, 0, 6, null);
|
|
}
|
|
|
|
public WidgetTosReportViolationReasonView(Context context, AttributeSet attributeSet) {
|
|
this(context, attributeSet, 0, 4, null);
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetTosReportViolationReasonView(Context context, AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
m.checkNotNullParameter(context, "context");
|
|
View inflate = LayoutInflater.from(context).inflate(2131559278, (ViewGroup) this, false);
|
|
addView(inflate);
|
|
int i2 = 2131364509;
|
|
TextView textView = (TextView) inflate.findViewById(2131364509);
|
|
if (textView != null) {
|
|
i2 = 2131364510;
|
|
TextView textView2 = (TextView) inflate.findViewById(2131364510);
|
|
if (textView2 != null) {
|
|
i2 = 2131364511;
|
|
MaterialRadioButton materialRadioButton = (MaterialRadioButton) inflate.findViewById(2131364511);
|
|
if (materialRadioButton != null) {
|
|
WidgetTosReportViolationReasonBinding widgetTosReportViolationReasonBinding = new WidgetTosReportViolationReasonBinding((RelativeLayout) inflate, textView, textView2, materialRadioButton);
|
|
m.checkNotNullExpressionValue(widgetTosReportViolationReasonBinding, "WidgetTosReportViolation…rom(context), this, true)");
|
|
this.binding = widgetTosReportViolationReasonBinding;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i2)));
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ WidgetTosReportViolationReasonView(Context context, AttributeSet attributeSet, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
|
|
}
|
|
|
|
public final WidgetTosReportViolationReasonBinding getBinding() {
|
|
return this.binding;
|
|
}
|
|
|
|
public final ReportReason getReason() {
|
|
return this.reason;
|
|
}
|
|
|
|
public final boolean isChecked() {
|
|
MaterialRadioButton materialRadioButton = this.binding.d;
|
|
m.checkNotNullExpressionValue(materialRadioButton, "binding.reportReasonRadio");
|
|
return materialRadioButton.isChecked();
|
|
}
|
|
|
|
public final void setChecked(boolean z2) {
|
|
MaterialRadioButton materialRadioButton = this.binding.d;
|
|
m.checkNotNullExpressionValue(materialRadioButton, "binding.reportReasonRadio");
|
|
materialRadioButton.setChecked(z2);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setEnabled(boolean z2) {
|
|
super.setEnabled(z2);
|
|
RelativeLayout relativeLayout = this.binding.a;
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.root");
|
|
relativeLayout.setEnabled(z2);
|
|
MaterialRadioButton materialRadioButton = this.binding.d;
|
|
m.checkNotNullExpressionValue(materialRadioButton, "binding.reportReasonRadio");
|
|
materialRadioButton.setEnabled(z2);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setOnClickListener(View.OnClickListener onClickListener) {
|
|
Ref$BooleanRef ref$BooleanRef = new Ref$BooleanRef();
|
|
ref$BooleanRef.element = false;
|
|
this.binding.a.setOnClickListener(new WidgetTosReportViolationReasonView$setOnClickListener$1(this, ref$BooleanRef, onClickListener));
|
|
this.binding.d.setOnCheckedChangeListener(new WidgetTosReportViolationReasonView$setOnClickListener$2(this, ref$BooleanRef, onClickListener));
|
|
}
|
|
|
|
public final void setReason(ReportReason reportReason) {
|
|
this.reason = reportReason;
|
|
TextView textView = this.binding.f1994c;
|
|
m.checkNotNullExpressionValue(textView, "binding.reportReasonHeader");
|
|
String str = null;
|
|
textView.setText(reportReason != null ? reportReason.b() : null);
|
|
TextView textView2 = this.binding.b;
|
|
m.checkNotNullExpressionValue(textView2, "binding.reportReasonDescriptipn");
|
|
if (reportReason != null) {
|
|
str = reportReason.a();
|
|
}
|
|
textView2.setText(str);
|
|
}
|
|
}
|