853 lines
39 KiB
Java
853 lines
39 KiB
Java
package com.discord.views;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.ColorStateList;
|
|
import android.content.res.Resources;
|
|
import android.content.res.TypedArray;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.os.Bundle;
|
|
import android.os.Parcelable;
|
|
import android.text.method.LinkMovementMethod;
|
|
import android.util.AttributeSet;
|
|
import android.util.SparseArray;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.accessibility.AccessibilityEvent;
|
|
import android.widget.Checkable;
|
|
import android.widget.CompoundButton;
|
|
import android.widget.ImageView;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import androidx.annotation.ColorInt;
|
|
import androidx.annotation.StringRes;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
import androidx.core.content.res.ResourcesCompat;
|
|
import androidx.core.view.AccessibilityDelegateCompat;
|
|
import androidx.core.view.ViewCompat;
|
|
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
|
import b.a.i.l3;
|
|
import b.a.i.m3;
|
|
import b.a.i.n3;
|
|
import b.a.i.o3;
|
|
import com.discord.R;
|
|
import com.discord.utilities.view.text.LinkifiedTextView;
|
|
import com.google.android.material.checkbox.MaterialCheckBox;
|
|
import com.google.android.material.radiobutton.MaterialRadioButton;
|
|
import com.google.android.material.switchmaterial.SwitchMaterial;
|
|
import d0.z.d.m;
|
|
import java.util.Objects;
|
|
import kotlin.NoWhenBranchMatchedException;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import rx.functions.Action0;
|
|
import rx.functions.Action1;
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public final class CheckedSetting extends RelativeLayout implements Checkable {
|
|
public static final /* synthetic */ int j = 0;
|
|
public Action1<Boolean> k;
|
|
public b l;
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public enum ViewType {
|
|
CHECK,
|
|
RADIO,
|
|
SWITCH;
|
|
|
|
public static final a Companion = new a(null);
|
|
private static final ViewType[] VALUES = values();
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
public static final /* synthetic */ ViewType[] access$getVALUES$cp() {
|
|
return VALUES;
|
|
}
|
|
}
|
|
|
|
/* compiled from: java-style lambda group */
|
|
/* loaded from: classes2.dex */
|
|
public static final class a implements View.OnClickListener {
|
|
public final /* synthetic */ int j;
|
|
public final /* synthetic */ Object k;
|
|
|
|
public a(int i, Object obj) {
|
|
this.j = i;
|
|
this.k = obj;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
int i = this.j;
|
|
if (i == 0) {
|
|
CheckedSetting.a((CheckedSetting) this.k).c().setChecked(true);
|
|
} else if (i == 1) {
|
|
CheckedSetting.a((CheckedSetting) this.k).c().setChecked(true ^ CheckedSetting.a((CheckedSetting) this.k).c().isChecked());
|
|
} else {
|
|
throw null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public interface b {
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class a extends c {
|
|
public final ConstraintLayout e;
|
|
public final MaterialCheckBox f;
|
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public a(l3 l3Var) {
|
|
super(r0, null, 2);
|
|
m.checkNotNullParameter(l3Var, "binding");
|
|
ConstraintLayout constraintLayout = l3Var.c;
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.settingContainer");
|
|
ConstraintLayout constraintLayout2 = l3Var.c;
|
|
m.checkNotNullExpressionValue(constraintLayout2, "binding.settingContainer");
|
|
this.e = constraintLayout2;
|
|
MaterialCheckBox materialCheckBox = l3Var.f151b;
|
|
m.checkNotNullExpressionValue(materialCheckBox, "binding.settingButton");
|
|
this.f = materialCheckBox;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public View b() {
|
|
return this.e;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public CompoundButton c() {
|
|
return this.f;
|
|
}
|
|
}
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* renamed from: com.discord.views.CheckedSetting$b$b reason: collision with other inner class name */
|
|
/* loaded from: classes2.dex */
|
|
public static final class C0221b extends c {
|
|
public final ConstraintLayout e;
|
|
public final MaterialRadioButton f;
|
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public C0221b(m3 m3Var) {
|
|
super(r0, null, 2);
|
|
m.checkNotNullParameter(m3Var, "binding");
|
|
ConstraintLayout constraintLayout = m3Var.c;
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.settingContainer");
|
|
ConstraintLayout constraintLayout2 = m3Var.c;
|
|
m.checkNotNullExpressionValue(constraintLayout2, "binding.settingContainer");
|
|
this.e = constraintLayout2;
|
|
MaterialRadioButton materialRadioButton = m3Var.f158b;
|
|
m.checkNotNullExpressionValue(materialRadioButton, "binding.settingButton");
|
|
this.f = materialRadioButton;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public View b() {
|
|
return this.e;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public CompoundButton c() {
|
|
return this.f;
|
|
}
|
|
}
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static abstract class c implements b {
|
|
public final TextView a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final TextView f2798b;
|
|
public final LinkifiedTextView c;
|
|
public final ImageView d;
|
|
|
|
public c(ViewGroup viewGroup, n3 n3Var, int i) {
|
|
n3 n3Var2;
|
|
if ((i & 2) != 0) {
|
|
int i2 = R.id.setting_drawable_left;
|
|
ImageView imageView = (ImageView) viewGroup.findViewById(R.id.setting_drawable_left);
|
|
if (imageView != null) {
|
|
i2 = R.id.setting_label;
|
|
TextView textView = (TextView) viewGroup.findViewById(R.id.setting_label);
|
|
if (textView != null) {
|
|
i2 = R.id.setting_subtext;
|
|
LinkifiedTextView linkifiedTextView = (LinkifiedTextView) viewGroup.findViewById(R.id.setting_subtext);
|
|
if (linkifiedTextView != null) {
|
|
i2 = R.id.setting_tag;
|
|
TextView textView2 = (TextView) viewGroup.findViewById(R.id.setting_tag);
|
|
if (textView2 != null) {
|
|
n3Var2 = new n3(viewGroup, imageView, textView, linkifiedTextView, textView2);
|
|
m.checkNotNullExpressionValue(n3Var2, "ViewSettingSharedBinding.bind(container)");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(viewGroup.getResources().getResourceName(i2)));
|
|
}
|
|
n3Var2 = null;
|
|
m.checkNotNullParameter(viewGroup, "container");
|
|
m.checkNotNullParameter(n3Var2, "binding");
|
|
TextView textView3 = n3Var2.c;
|
|
m.checkNotNullExpressionValue(textView3, "binding.settingLabel");
|
|
this.a = textView3;
|
|
TextView textView4 = n3Var2.e;
|
|
m.checkNotNullExpressionValue(textView4, "binding.settingTag");
|
|
this.f2798b = textView4;
|
|
LinkifiedTextView linkifiedTextView2 = n3Var2.d;
|
|
m.checkNotNullExpressionValue(linkifiedTextView2, "binding.settingSubtext");
|
|
this.c = linkifiedTextView2;
|
|
ImageView imageView2 = n3Var2.f163b;
|
|
m.checkNotNullExpressionValue(imageView2, "binding.settingDrawableLeft");
|
|
this.d = imageView2;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public TextView a() {
|
|
return this.a;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public ImageView d() {
|
|
return this.d;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public TextView e() {
|
|
return this.f2798b;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public TextView f() {
|
|
return this.c;
|
|
}
|
|
}
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class d extends c {
|
|
public final ConstraintLayout e;
|
|
public final SwitchMaterial f;
|
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public d(o3 o3Var) {
|
|
super(r0, null, 2);
|
|
m.checkNotNullParameter(o3Var, "binding");
|
|
ConstraintLayout constraintLayout = o3Var.c;
|
|
m.checkNotNullExpressionValue(constraintLayout, "binding.settingContainer");
|
|
ConstraintLayout constraintLayout2 = o3Var.c;
|
|
m.checkNotNullExpressionValue(constraintLayout2, "binding.settingContainer");
|
|
this.e = constraintLayout2;
|
|
SwitchMaterial switchMaterial = o3Var.f169b;
|
|
m.checkNotNullExpressionValue(switchMaterial, "binding.settingButton");
|
|
this.f = switchMaterial;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public View b() {
|
|
return this.e;
|
|
}
|
|
|
|
@Override // com.discord.views.CheckedSetting.b
|
|
public CompoundButton c() {
|
|
return this.f;
|
|
}
|
|
}
|
|
|
|
TextView a();
|
|
|
|
View b();
|
|
|
|
CompoundButton c();
|
|
|
|
ImageView d();
|
|
|
|
TextView e();
|
|
|
|
TextView f();
|
|
}
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class c implements View.OnClickListener {
|
|
public final /* synthetic */ CharSequence k;
|
|
|
|
public c(CharSequence charSequence) {
|
|
this.k = charSequence;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
if (this.k != null) {
|
|
b.a.d.m.h(CheckedSetting.this.getContext(), this.k, 0, null, 12);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class d extends AccessibilityDelegateCompat {
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final /* synthetic */ ViewType f2799b;
|
|
|
|
public d(ViewType viewType) {
|
|
this.f2799b = viewType;
|
|
}
|
|
|
|
@Override // androidx.core.view.AccessibilityDelegateCompat
|
|
public void onInitializeAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
|
|
m.checkNotNullParameter(view, "host");
|
|
m.checkNotNullParameter(accessibilityEvent, "event");
|
|
super.onInitializeAccessibilityEvent(view, accessibilityEvent);
|
|
accessibilityEvent.setChecked(CheckedSetting.this.isChecked());
|
|
}
|
|
|
|
@Override // androidx.core.view.AccessibilityDelegateCompat
|
|
public void onInitializeAccessibilityNodeInfo(View view, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
|
|
int i;
|
|
m.checkNotNullParameter(view, "host");
|
|
m.checkNotNullParameter(accessibilityNodeInfoCompat, "info");
|
|
super.onInitializeAccessibilityNodeInfo(view, accessibilityNodeInfoCompat);
|
|
accessibilityNodeInfoCompat.setCheckable(true);
|
|
accessibilityNodeInfoCompat.setChecked(CheckedSetting.this.isChecked());
|
|
Resources resources = view.getResources();
|
|
int ordinal = this.f2799b.ordinal();
|
|
if (ordinal == 0) {
|
|
i = R.string.a11y_role_checkbox;
|
|
} else if (ordinal == 1) {
|
|
i = R.string.a11y_role_radio_button;
|
|
} else if (ordinal == 2) {
|
|
i = R.string.a11y_role_switch;
|
|
} else {
|
|
throw new NoWhenBranchMatchedException();
|
|
}
|
|
accessibilityNodeInfoCompat.setRoleDescription(resources.getString(i));
|
|
}
|
|
}
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class e implements CompoundButton.OnCheckedChangeListener {
|
|
public final /* synthetic */ Action1 a;
|
|
|
|
public e(Action1 action1) {
|
|
this.a = action1;
|
|
}
|
|
|
|
@Override // android.widget.CompoundButton.OnCheckedChangeListener
|
|
public final void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
|
|
Action1 action1 = this.a;
|
|
if (action1 != null) {
|
|
action1.call(Boolean.valueOf(z2));
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: CheckedSetting.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class f implements View.OnClickListener {
|
|
public final /* synthetic */ Action0 j;
|
|
|
|
public f(Action0 action0) {
|
|
this.j = action0;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
this.j.call();
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
/* JADX WARN: Removed duplicated region for block: B:65:0x012f A[Catch: all -> 0x01b9, TryCatch #0 {all -> 0x01b9, blocks: (B:6:0x0025, B:9:0x0043, B:10:0x0046, B:12:0x0052, B:13:0x0055, B:15:0x006f, B:16:0x0072, B:18:0x0086, B:20:0x008a, B:21:0x008d, B:22:0x0094, B:24:0x009c, B:26:0x00a0, B:27:0x00a3, B:28:0x00aa, B:30:0x00ae, B:31:0x00b1, B:33:0x00be, B:35:0x00c6, B:37:0x00cd, B:38:0x00d0, B:46:0x00e7, B:48:0x00f3, B:49:0x00f6, B:51:0x00ff, B:53:0x0103, B:54:0x0106, B:55:0x0115, B:57:0x011b, B:59:0x0123, B:65:0x012f, B:67:0x0133, B:68:0x0136, B:69:0x013e, B:71:0x0142, B:72:0x0145, B:74:0x0150, B:75:0x0153, B:76:0x015a, B:78:0x0164, B:80:0x0168, B:81:0x016b, B:82:0x0172, B:84:0x017a, B:86:0x017e, B:87:0x0181, B:88:0x0188, B:90:0x018e, B:91:0x0192, B:92:0x0198, B:94:0x019e, B:95:0x01a1, B:97:0x01a7, B:99:0x01ab, B:100:0x01ae), top: B:106:0x0025 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:69:0x013e A[Catch: all -> 0x01b9, TryCatch #0 {all -> 0x01b9, blocks: (B:6:0x0025, B:9:0x0043, B:10:0x0046, B:12:0x0052, B:13:0x0055, B:15:0x006f, B:16:0x0072, B:18:0x0086, B:20:0x008a, B:21:0x008d, B:22:0x0094, B:24:0x009c, B:26:0x00a0, B:27:0x00a3, B:28:0x00aa, B:30:0x00ae, B:31:0x00b1, B:33:0x00be, B:35:0x00c6, B:37:0x00cd, B:38:0x00d0, B:46:0x00e7, B:48:0x00f3, B:49:0x00f6, B:51:0x00ff, B:53:0x0103, B:54:0x0106, B:55:0x0115, B:57:0x011b, B:59:0x0123, B:65:0x012f, B:67:0x0133, B:68:0x0136, B:69:0x013e, B:71:0x0142, B:72:0x0145, B:74:0x0150, B:75:0x0153, B:76:0x015a, B:78:0x0164, B:80:0x0168, B:81:0x016b, B:82:0x0172, B:84:0x017a, B:86:0x017e, B:87:0x0181, B:88:0x0188, B:90:0x018e, B:91:0x0192, B:92:0x0198, B:94:0x019e, B:95:0x01a1, B:97:0x01a7, B:99:0x01ab, B:100:0x01ae), top: B:106:0x0025 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:78:0x0164 A[Catch: all -> 0x01b9, TryCatch #0 {all -> 0x01b9, blocks: (B:6:0x0025, B:9:0x0043, B:10:0x0046, B:12:0x0052, B:13:0x0055, B:15:0x006f, B:16:0x0072, B:18:0x0086, B:20:0x008a, B:21:0x008d, B:22:0x0094, B:24:0x009c, B:26:0x00a0, B:27:0x00a3, B:28:0x00aa, B:30:0x00ae, B:31:0x00b1, B:33:0x00be, B:35:0x00c6, B:37:0x00cd, B:38:0x00d0, B:46:0x00e7, B:48:0x00f3, B:49:0x00f6, B:51:0x00ff, B:53:0x0103, B:54:0x0106, B:55:0x0115, B:57:0x011b, B:59:0x0123, B:65:0x012f, B:67:0x0133, B:68:0x0136, B:69:0x013e, B:71:0x0142, B:72:0x0145, B:74:0x0150, B:75:0x0153, B:76:0x015a, B:78:0x0164, B:80:0x0168, B:81:0x016b, B:82:0x0172, B:84:0x017a, B:86:0x017e, B:87:0x0181, B:88:0x0188, B:90:0x018e, B:91:0x0192, B:92:0x0198, B:94:0x019e, B:95:0x01a1, B:97:0x01a7, B:99:0x01ab, B:100:0x01ae), top: B:106:0x0025 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:84:0x017a A[Catch: all -> 0x01b9, TryCatch #0 {all -> 0x01b9, blocks: (B:6:0x0025, B:9:0x0043, B:10:0x0046, B:12:0x0052, B:13:0x0055, B:15:0x006f, B:16:0x0072, B:18:0x0086, B:20:0x008a, B:21:0x008d, B:22:0x0094, B:24:0x009c, B:26:0x00a0, B:27:0x00a3, B:28:0x00aa, B:30:0x00ae, B:31:0x00b1, B:33:0x00be, B:35:0x00c6, B:37:0x00cd, B:38:0x00d0, B:46:0x00e7, B:48:0x00f3, B:49:0x00f6, B:51:0x00ff, B:53:0x0103, B:54:0x0106, B:55:0x0115, B:57:0x011b, B:59:0x0123, B:65:0x012f, B:67:0x0133, B:68:0x0136, B:69:0x013e, B:71:0x0142, B:72:0x0145, B:74:0x0150, B:75:0x0153, B:76:0x015a, B:78:0x0164, B:80:0x0168, B:81:0x016b, B:82:0x0172, B:84:0x017a, B:86:0x017e, B:87:0x0181, B:88:0x0188, B:90:0x018e, B:91:0x0192, B:92:0x0198, B:94:0x019e, B:95:0x01a1, B:97:0x01a7, B:99:0x01ab, B:100:0x01ae), top: B:106:0x0025 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:90:0x018e A[Catch: all -> 0x01b9, TryCatch #0 {all -> 0x01b9, blocks: (B:6:0x0025, B:9:0x0043, B:10:0x0046, B:12:0x0052, B:13:0x0055, B:15:0x006f, B:16:0x0072, B:18:0x0086, B:20:0x008a, B:21:0x008d, B:22:0x0094, B:24:0x009c, B:26:0x00a0, B:27:0x00a3, B:28:0x00aa, B:30:0x00ae, B:31:0x00b1, B:33:0x00be, B:35:0x00c6, B:37:0x00cd, B:38:0x00d0, B:46:0x00e7, B:48:0x00f3, B:49:0x00f6, B:51:0x00ff, B:53:0x0103, B:54:0x0106, B:55:0x0115, B:57:0x011b, B:59:0x0123, B:65:0x012f, B:67:0x0133, B:68:0x0136, B:69:0x013e, B:71:0x0142, B:72:0x0145, B:74:0x0150, B:75:0x0153, B:76:0x015a, B:78:0x0164, B:80:0x0168, B:81:0x016b, B:82:0x0172, B:84:0x017a, B:86:0x017e, B:87:0x0181, B:88:0x0188, B:90:0x018e, B:91:0x0192, B:92:0x0198, B:94:0x019e, B:95:0x01a1, B:97:0x01a7, B:99:0x01ab, B:100:0x01ae), top: B:106:0x0025 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:91:0x0192 A[Catch: all -> 0x01b9, TryCatch #0 {all -> 0x01b9, blocks: (B:6:0x0025, B:9:0x0043, B:10:0x0046, B:12:0x0052, B:13:0x0055, B:15:0x006f, B:16:0x0072, B:18:0x0086, B:20:0x008a, B:21:0x008d, B:22:0x0094, B:24:0x009c, B:26:0x00a0, B:27:0x00a3, B:28:0x00aa, B:30:0x00ae, B:31:0x00b1, B:33:0x00be, B:35:0x00c6, B:37:0x00cd, B:38:0x00d0, B:46:0x00e7, B:48:0x00f3, B:49:0x00f6, B:51:0x00ff, B:53:0x0103, B:54:0x0106, B:55:0x0115, B:57:0x011b, B:59:0x0123, B:65:0x012f, B:67:0x0133, B:68:0x0136, B:69:0x013e, B:71:0x0142, B:72:0x0145, B:74:0x0150, B:75:0x0153, B:76:0x015a, B:78:0x0164, B:80:0x0168, B:81:0x016b, B:82:0x0172, B:84:0x017a, B:86:0x017e, B:87:0x0181, B:88:0x0188, B:90:0x018e, B:91:0x0192, B:92:0x0198, B:94:0x019e, B:95:0x01a1, B:97:0x01a7, B:99:0x01ab, B:100:0x01ae), top: B:106:0x0025 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:94:0x019e A[Catch: all -> 0x01b9, TryCatch #0 {all -> 0x01b9, blocks: (B:6:0x0025, B:9:0x0043, B:10:0x0046, B:12:0x0052, B:13:0x0055, B:15:0x006f, B:16:0x0072, B:18:0x0086, B:20:0x008a, B:21:0x008d, B:22:0x0094, B:24:0x009c, B:26:0x00a0, B:27:0x00a3, B:28:0x00aa, B:30:0x00ae, B:31:0x00b1, B:33:0x00be, B:35:0x00c6, B:37:0x00cd, B:38:0x00d0, B:46:0x00e7, B:48:0x00f3, B:49:0x00f6, B:51:0x00ff, B:53:0x0103, B:54:0x0106, B:55:0x0115, B:57:0x011b, B:59:0x0123, B:65:0x012f, B:67:0x0133, B:68:0x0136, B:69:0x013e, B:71:0x0142, B:72:0x0145, B:74:0x0150, B:75:0x0153, B:76:0x015a, B:78:0x0164, B:80:0x0168, B:81:0x016b, B:82:0x0172, B:84:0x017a, B:86:0x017e, B:87:0x0181, B:88:0x0188, B:90:0x018e, B:91:0x0192, B:92:0x0198, B:94:0x019e, B:95:0x01a1, B:97:0x01a7, B:99:0x01ab, B:100:0x01ae), top: B:106:0x0025 }] */
|
|
/* JADX WARN: Removed duplicated region for block: B:97:0x01a7 A[Catch: all -> 0x01b9, TryCatch #0 {all -> 0x01b9, blocks: (B:6:0x0025, B:9:0x0043, B:10:0x0046, B:12:0x0052, B:13:0x0055, B:15:0x006f, B:16:0x0072, B:18:0x0086, B:20:0x008a, B:21:0x008d, B:22:0x0094, B:24:0x009c, B:26:0x00a0, B:27:0x00a3, B:28:0x00aa, B:30:0x00ae, B:31:0x00b1, B:33:0x00be, B:35:0x00c6, B:37:0x00cd, B:38:0x00d0, B:46:0x00e7, B:48:0x00f3, B:49:0x00f6, B:51:0x00ff, B:53:0x0103, B:54:0x0106, B:55:0x0115, B:57:0x011b, B:59:0x0123, B:65:0x012f, B:67:0x0133, B:68:0x0136, B:69:0x013e, B:71:0x0142, B:72:0x0145, B:74:0x0150, B:75:0x0153, B:76:0x015a, B:78:0x0164, B:80:0x0168, B:81:0x016b, B:82:0x0172, B:84:0x017a, B:86:0x017e, B:87:0x0181, B:88:0x0188, B:90:0x018e, B:91:0x0192, B:92:0x0198, B:94:0x019e, B:95:0x01a1, B:97:0x01a7, B:99:0x01ab, B:100:0x01ae), top: B:106:0x0025 }] */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public CheckedSetting(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet, 0);
|
|
boolean z2;
|
|
float dimension;
|
|
ColorStateList colorStateList;
|
|
Drawable drawable;
|
|
ColorStateList colorStateList2;
|
|
Drawable drawable2;
|
|
CharSequence charSequence = null;
|
|
m.checkNotNullParameter(context, "context");
|
|
if (attributeSet == null) {
|
|
f(ViewType.CHECK);
|
|
return;
|
|
}
|
|
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, R.a.CheckedSetting, 0, 0);
|
|
m.checkNotNullExpressionValue(obtainStyledAttributes, "context.obtainStyledAttr…ble.CheckedSetting, 0, 0)");
|
|
try {
|
|
int i = obtainStyledAttributes.getInt(15, ViewType.CHECK.ordinal());
|
|
Objects.requireNonNull(ViewType.Companion);
|
|
f(ViewType.access$getVALUES$cp()[i]);
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
int paddingLeft = bVar.b().getPaddingLeft();
|
|
b bVar2 = this.l;
|
|
if (bVar2 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
int paddingTop = bVar2.b().getPaddingTop();
|
|
int dimension2 = (int) obtainStyledAttributes.getDimension(6, paddingLeft);
|
|
int dimension3 = (int) obtainStyledAttributes.getDimension(7, paddingTop);
|
|
b bVar3 = this.l;
|
|
if (bVar3 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar3.b().setPadding(dimension2, dimension3, dimension2, dimension3);
|
|
float dimension4 = obtainStyledAttributes.getDimension(14, -1.0f);
|
|
float f2 = 0;
|
|
if (dimension4 > f2) {
|
|
b bVar4 = this.l;
|
|
if (bVar4 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar4.a().setTextSize(0, dimension4);
|
|
}
|
|
ColorStateList colorStateList3 = obtainStyledAttributes.getColorStateList(12);
|
|
if (colorStateList3 != null) {
|
|
b bVar5 = this.l;
|
|
if (bVar5 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar5.a().setTextColor(colorStateList3);
|
|
}
|
|
b bVar6 = this.l;
|
|
if (bVar6 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
TextView a2 = bVar6.a();
|
|
String string = obtainStyledAttributes.getString(11);
|
|
a2.setText(string != null ? b.a.k.b.l(string, new Object[0], null, 2) : null);
|
|
b bVar7 = this.l;
|
|
if (bVar7 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
ImageView d2 = bVar7.d();
|
|
Drawable drawable3 = obtainStyledAttributes.getDrawable(3);
|
|
d2.setVisibility(drawable3 != null ? 0 : 8);
|
|
d2.setImageDrawable(drawable3);
|
|
ColorStateList colorStateList4 = obtainStyledAttributes.getColorStateList(4);
|
|
if (colorStateList4 != null) {
|
|
d2.setImageTintList(colorStateList4);
|
|
}
|
|
int resourceId = obtainStyledAttributes.getResourceId(13, -1);
|
|
if (resourceId != -1) {
|
|
b bVar8 = this.l;
|
|
if (bVar8 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar8.a().setTypeface(ResourcesCompat.getFont(getContext(), resourceId));
|
|
}
|
|
String string2 = obtainStyledAttributes.getString(8);
|
|
charSequence = string2 != null ? b.a.k.b.l(string2, new Object[0], null, 2) : charSequence;
|
|
if (!(charSequence == null || charSequence.length() == 0)) {
|
|
z2 = false;
|
|
if (!z2) {
|
|
b bVar9 = this.l;
|
|
if (bVar9 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar9.f().setVisibility(8);
|
|
} else {
|
|
b bVar10 = this.l;
|
|
if (bVar10 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar10.f().setText(charSequence);
|
|
b bVar11 = this.l;
|
|
if (bVar11 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar11.f().setVisibility(0);
|
|
}
|
|
dimension = obtainStyledAttributes.getDimension(10, -1.0f);
|
|
if (dimension > f2) {
|
|
b bVar12 = this.l;
|
|
if (bVar12 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar12.f().setTextSize(0, dimension);
|
|
}
|
|
colorStateList = obtainStyledAttributes.getColorStateList(9);
|
|
if (colorStateList != null) {
|
|
b bVar13 = this.l;
|
|
if (bVar13 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar13.f().setTextColor(colorStateList);
|
|
}
|
|
drawable = obtainStyledAttributes.getDrawable(0);
|
|
if (drawable == null) {
|
|
setBackground(drawable);
|
|
} else {
|
|
setBackgroundResource(R.drawable.drawable_bg_settings_item_white);
|
|
}
|
|
colorStateList2 = obtainStyledAttributes.getColorStateList(1);
|
|
if (colorStateList2 != null) {
|
|
setBackgroundTintList(colorStateList2);
|
|
}
|
|
drawable2 = obtainStyledAttributes.getDrawable(2);
|
|
if (drawable2 != null) {
|
|
b bVar14 = this.l;
|
|
if (bVar14 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar14.b().setBackground(drawable2);
|
|
}
|
|
}
|
|
z2 = true;
|
|
if (!z2) {
|
|
}
|
|
dimension = obtainStyledAttributes.getDimension(10, -1.0f);
|
|
if (dimension > f2) {
|
|
}
|
|
colorStateList = obtainStyledAttributes.getColorStateList(9);
|
|
if (colorStateList != null) {
|
|
}
|
|
drawable = obtainStyledAttributes.getDrawable(0);
|
|
if (drawable == null) {
|
|
}
|
|
colorStateList2 = obtainStyledAttributes.getColorStateList(1);
|
|
if (colorStateList2 != null) {
|
|
}
|
|
drawable2 = obtainStyledAttributes.getDrawable(2);
|
|
if (drawable2 != null) {
|
|
}
|
|
} finally {
|
|
obtainStyledAttributes.recycle();
|
|
}
|
|
}
|
|
|
|
public static final /* synthetic */ b a(CheckedSetting checkedSetting) {
|
|
b bVar = checkedSetting.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
return bVar;
|
|
}
|
|
|
|
public static /* synthetic */ void d(CheckedSetting checkedSetting, CharSequence charSequence, int i) {
|
|
int i2 = i & 1;
|
|
checkedSetting.c(null);
|
|
}
|
|
|
|
public static /* synthetic */ void i(CheckedSetting checkedSetting, CharSequence charSequence, boolean z2, int i) {
|
|
if ((i & 2) != 0) {
|
|
z2 = false;
|
|
}
|
|
checkedSetting.h(charSequence, z2);
|
|
}
|
|
|
|
public final void b(@StringRes int i) {
|
|
Context context = getContext();
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
c(b.a.k.b.h(context, i, new Object[0], null, 4));
|
|
}
|
|
|
|
public final void c(CharSequence charSequence) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.b().setOnClickListener(new c(charSequence));
|
|
setAlpha(0.3f);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
public void dispatchRestoreInstanceState(SparseArray<Parcelable> sparseArray) {
|
|
m.checkNotNullParameter(sparseArray, "container");
|
|
dispatchThawSelfOnly(sparseArray);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
public void dispatchSaveInstanceState(SparseArray<Parcelable> sparseArray) {
|
|
m.checkNotNullParameter(sparseArray, "container");
|
|
dispatchFreezeSelfOnly(sparseArray);
|
|
}
|
|
|
|
public final void e(View.OnClickListener onClickListener) {
|
|
m.checkNotNullParameter(onClickListener, "listener");
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.b().setOnClickListener(onClickListener);
|
|
setAlpha(1.0f);
|
|
}
|
|
|
|
public final void f(ViewType viewType) {
|
|
b bVar;
|
|
LayoutInflater from = LayoutInflater.from(getContext());
|
|
int ordinal = viewType.ordinal();
|
|
int i = R.id.setting_button;
|
|
if (ordinal == 0) {
|
|
from.inflate(R.layout.view_setting_check, this);
|
|
MaterialCheckBox materialCheckBox = (MaterialCheckBox) findViewById(R.id.setting_button);
|
|
if (materialCheckBox != null) {
|
|
ConstraintLayout constraintLayout = (ConstraintLayout) findViewById(R.id.setting_container);
|
|
if (constraintLayout != null) {
|
|
l3 l3Var = new l3(this, materialCheckBox, constraintLayout);
|
|
m.checkNotNullExpressionValue(l3Var, "ViewSettingCheckBinding.…ate(layoutInflater, this)");
|
|
m.checkNotNullParameter(l3Var, "binding");
|
|
bVar = new b.a(l3Var);
|
|
} else {
|
|
i = R.id.setting_container;
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(i)));
|
|
} else if (ordinal == 1) {
|
|
from.inflate(R.layout.view_setting_radio, this);
|
|
MaterialRadioButton materialRadioButton = (MaterialRadioButton) findViewById(R.id.setting_button);
|
|
if (materialRadioButton != null) {
|
|
ConstraintLayout constraintLayout2 = (ConstraintLayout) findViewById(R.id.setting_container);
|
|
if (constraintLayout2 != null) {
|
|
m3 m3Var = new m3(this, materialRadioButton, constraintLayout2);
|
|
m.checkNotNullExpressionValue(m3Var, "ViewSettingRadioBinding.…ate(layoutInflater, this)");
|
|
m.checkNotNullParameter(m3Var, "binding");
|
|
bVar = new b.C0221b(m3Var);
|
|
} else {
|
|
i = R.id.setting_container;
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(i)));
|
|
} else if (ordinal == 2) {
|
|
from.inflate(R.layout.view_setting_switch, this);
|
|
SwitchMaterial switchMaterial = (SwitchMaterial) findViewById(R.id.setting_button);
|
|
if (switchMaterial != null) {
|
|
ConstraintLayout constraintLayout3 = (ConstraintLayout) findViewById(R.id.setting_container);
|
|
if (constraintLayout3 != null) {
|
|
o3 o3Var = new o3(this, switchMaterial, constraintLayout3);
|
|
m.checkNotNullExpressionValue(o3Var, "ViewSettingSwitchBinding…ate(layoutInflater, this)");
|
|
m.checkNotNullParameter(o3Var, "binding");
|
|
bVar = new b.d(o3Var);
|
|
} else {
|
|
i = R.id.setting_container;
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(i)));
|
|
} else {
|
|
throw new NoWhenBranchMatchedException();
|
|
}
|
|
this.l = bVar;
|
|
if (viewType == ViewType.RADIO) {
|
|
bVar.b().setOnClickListener(new a(0, this));
|
|
} else {
|
|
bVar.b().setOnClickListener(new a(1, this));
|
|
}
|
|
b bVar2 = this.l;
|
|
if (bVar2 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
ViewCompat.setAccessibilityDelegate(bVar2.b(), new d(viewType));
|
|
}
|
|
|
|
public final void g(boolean z2, boolean z3) {
|
|
if (!z3) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.c().setOnCheckedChangeListener(null);
|
|
b bVar2 = this.l;
|
|
if (bVar2 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar2.c().setChecked(z2);
|
|
setOnCheckedListener(this.k);
|
|
return;
|
|
}
|
|
b bVar3 = this.l;
|
|
if (bVar3 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar3.c().setChecked(z2);
|
|
}
|
|
|
|
public final void h(CharSequence charSequence, boolean z2) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.f().setText(charSequence);
|
|
b bVar2 = this.l;
|
|
if (bVar2 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
TextView f2 = bVar2.f();
|
|
int i = 0;
|
|
if (charSequence == null || charSequence.length() == 0) {
|
|
i = 8;
|
|
}
|
|
f2.setVisibility(i);
|
|
if (z2) {
|
|
b bVar3 = this.l;
|
|
if (bVar3 == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar3.f().setMovementMethod(LinkMovementMethod.getInstance());
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.Checkable
|
|
public boolean isChecked() {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
return bVar.c().isChecked();
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void onRestoreInstanceState(Parcelable parcelable) {
|
|
Parcelable parcelable2;
|
|
m.checkNotNullParameter(parcelable, "state");
|
|
if (parcelable instanceof Bundle) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
Bundle bundle = (Bundle) parcelable;
|
|
bVar.c().setChecked(bundle.getBoolean("STATE_CHECKED"));
|
|
parcelable2 = bundle.getParcelable("STATE_SUPER");
|
|
} else {
|
|
parcelable2 = null;
|
|
}
|
|
if (parcelable2 != null) {
|
|
parcelable = parcelable2;
|
|
}
|
|
super.onRestoreInstanceState(parcelable);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public Parcelable onSaveInstanceState() {
|
|
Bundle bundle = new Bundle();
|
|
bundle.putParcelable("STATE_SUPER", super.onSaveInstanceState());
|
|
bundle.putBoolean("STATE_CHECKED", isChecked());
|
|
return bundle;
|
|
}
|
|
|
|
public final void setButtonAlpha(float f2) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.c().setAlpha(f2);
|
|
}
|
|
|
|
public final void setButtonVisibility(boolean z2) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.c().setVisibility(z2 ? 0 : 8);
|
|
}
|
|
|
|
@Override // android.widget.Checkable
|
|
public void setChecked(boolean z2) {
|
|
g(z2, false);
|
|
}
|
|
|
|
public final void setLabelTagText(@StringRes int i) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.e().setText(i);
|
|
}
|
|
|
|
public final void setLabelTagVisibility(boolean z2) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.e().setVisibility(z2 ? 0 : 8);
|
|
}
|
|
|
|
public final void setOnCheckedListener(Action1<Boolean> action1) {
|
|
this.k = action1;
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.c().setOnCheckedChangeListener(new e(action1));
|
|
}
|
|
|
|
public final void setSubtext(CharSequence charSequence) {
|
|
h(charSequence, false);
|
|
}
|
|
|
|
public final void setSubtextColor(@ColorInt int i) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.f().setTextColor(i);
|
|
}
|
|
|
|
public final void setSubtextOnClickListener(Action0 action0) {
|
|
m.checkNotNullParameter(action0, "listener");
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.f().setOnClickListener(new f(action0));
|
|
}
|
|
|
|
public final void setText(CharSequence charSequence) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.a().setText(charSequence);
|
|
}
|
|
|
|
public final void setTextColor(@ColorInt int i) {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
bVar.a().setTextColor(i);
|
|
}
|
|
|
|
@Override // android.widget.Checkable
|
|
public void toggle() {
|
|
b bVar = this.l;
|
|
if (bVar == null) {
|
|
m.throwUninitializedPropertyAccessException("binding");
|
|
}
|
|
g(!bVar.c().isChecked(), false);
|
|
}
|
|
}
|