63 lines
2.8 KiB
Java
63 lines
2.8 KiB
Java
package com.discord.views;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.TypedArray;
|
|
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.a.i.t2;
|
|
import com.discord.R;
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
import d0.z.d.m;
|
|
/* compiled from: ScreenTitleView.kt */
|
|
public final class ScreenTitleView extends LinearLayout {
|
|
public final t2 i;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ScreenTitleView(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet, 0);
|
|
m.checkNotNullParameter(context, "context");
|
|
View inflate = LayoutInflater.from(context).inflate(2131558792, (ViewGroup) this, false);
|
|
addView(inflate);
|
|
int i = 2131364519;
|
|
TextView textView = (TextView) inflate.findViewById(2131364519);
|
|
if (textView != null) {
|
|
i = 2131364520;
|
|
TextView textView2 = (TextView) inflate.findViewById(2131364520);
|
|
if (textView2 != null) {
|
|
t2 t2Var = new t2((LinearLayout) inflate, textView, textView2);
|
|
m.checkNotNullExpressionValue(t2Var, "ViewScreenTitleBinding.i…rom(context), this, true)");
|
|
this.i = t2Var;
|
|
if (attributeSet != null) {
|
|
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, R.a.ScreenTitleView, 0, 0);
|
|
m.checkNotNullExpressionValue(obtainStyledAttributes, "context.obtainStyledAttr…le.ScreenTitleView, 0, 0)");
|
|
CharSequence text = obtainStyledAttributes.getText(1);
|
|
CharSequence text2 = obtainStyledAttributes.getText(0);
|
|
obtainStyledAttributes.recycle();
|
|
m.checkNotNullExpressionValue(text, "titleText");
|
|
setTitle(text);
|
|
setSubtitle(text2);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
|
|
}
|
|
|
|
public final void setSubtitle(CharSequence charSequence) {
|
|
TextView textView = this.i.b;
|
|
m.checkNotNullExpressionValue(textView, "binding.screenTitleSubtitle");
|
|
ViewExtensions.setTextAndVisibilityBy(textView, charSequence);
|
|
}
|
|
|
|
public final void setTitle(CharSequence charSequence) {
|
|
m.checkNotNullParameter(charSequence, "title");
|
|
TextView textView = this.i.f155c;
|
|
m.checkNotNullExpressionValue(textView, "binding.screenTitleTitle");
|
|
textView.setText(charSequence);
|
|
}
|
|
}
|