package com.discord.widgets.servers.community; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.view.LayoutInflater; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.discord.R; import com.discord.databinding.ViewServerSettingsCommunitySettingSelectorBinding; import d0.z.d.m; import kotlin.jvm.internal.DefaultConstructorMarker; /* compiled from: CommunitySelectorView.kt */ public final class CommunitySelectorView extends LinearLayout { private final ViewServerSettingsCommunitySettingSelectorBinding binding; public CommunitySelectorView(Context context) { this(context, null, 0, 6, null); } public CommunitySelectorView(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 CommunitySelectorView(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); m.checkNotNullParameter(context, "context"); LayoutInflater.from(context).inflate(2131558805, this); int i2 = 2131364726; TextView textView = (TextView) findViewById(2131364726); if (textView != null) { i2 = 2131364727; ImageView imageView = (ImageView) findViewById(2131364727); if (imageView != null) { i2 = 2131364728; TextView textView2 = (TextView) findViewById(2131364728); if (textView2 != null) { i2 = 2131364729; TextView textView3 = (TextView) findViewById(2131364729); if (textView3 != null) { ViewServerSettingsCommunitySettingSelectorBinding viewServerSettingsCommunitySettingSelectorBinding = new ViewServerSettingsCommunitySettingSelectorBinding(this, textView, imageView, textView2, textView3); m.checkNotNullExpressionValue(viewServerSettingsCommunitySettingSelectorBinding, "ViewServerSettingsCommun…ater.from(context), this)"); this.binding = viewServerSettingsCommunitySettingSelectorBinding; if (attributeSet != null) { initAttrs(attributeSet); return; } return; } } } } throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(i2))); } /* JADX INFO: this call moved to the top of the method (can break code semantics) */ public /* synthetic */ CommunitySelectorView(Context context, AttributeSet attributeSet, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) { this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i); } private final void initAttrs(AttributeSet attributeSet) { int i = 0; TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, R.a.CommunitySelectorView, 0, 0); m.checkNotNullExpressionValue(obtainStyledAttributes, "context.obtainStyledAttr…munitySelectorView, 0, 0)"); CharSequence text = obtainStyledAttributes.getText(3); CharSequence text2 = obtainStyledAttributes.getText(2); CharSequence text3 = obtainStyledAttributes.getText(0); boolean z2 = obtainStyledAttributes.getBoolean(1, true); obtainStyledAttributes.recycle(); TextView textView = this.binding.e; m.checkNotNullExpressionValue(textView, "binding.serverSettingsCo…unitySettingSelectorTitle"); textView.setText(text); TextView textView2 = this.binding.b; m.checkNotNullExpressionValue(textView2, "binding.serverSettingsCo…ettingSelectorDescription"); textView2.setText(text3); TextView textView3 = this.binding.d; m.checkNotNullExpressionValue(textView3, "binding.serverSettingsCo…tySettingSelectorSubtitle"); textView3.setText(text2); TextView textView4 = this.binding.d; m.checkNotNullExpressionValue(textView4, "binding.serverSettingsCo…tySettingSelectorSubtitle"); textView4.setVisibility(z2 ? 0 : 8); ImageView imageView = this.binding.f1665c; m.checkNotNullExpressionValue(imageView, "binding.serverSettingsCo…ttingSelectorDropdownIcon"); if (!z2) { i = 8; } imageView.setVisibility(i); } public final void setSubtitle(CharSequence charSequence) { m.checkNotNullParameter(charSequence, "subtitle"); TextView textView = this.binding.d; m.checkNotNullExpressionValue(textView, "binding.serverSettingsCo…tySettingSelectorSubtitle"); textView.setText(charSequence); } }