147 lines
4.5 KiB
Java
147 lines
4.5 KiB
Java
package com.scb.phone.view.custom.hml;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.TypedArray;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import androidx.cardview.widget.CardView;
|
|
import butterknife.BindView;
|
|
import butterknife.ButterKnife;
|
|
import butterknife.OnClick;
|
|
import com.scb.phone.R;
|
|
import o.C14957gcv;
|
|
import o.C15715hv;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public final class CustomCollapsibleText extends CardView {
|
|
|
|
@BindView
|
|
public ImageView arrowImage;
|
|
|
|
@BindView
|
|
public TextView contentText;
|
|
|
|
@BindView
|
|
public TextView titleText;
|
|
|
|
@OnClick
|
|
public final void onExpandClicked() {
|
|
TextView textView = this.contentText;
|
|
TextView textView2 = null;
|
|
if (textView == null) {
|
|
C14957gcv.a("");
|
|
textView = null;
|
|
}
|
|
TextView textView3 = this.contentText;
|
|
if (textView3 != null) {
|
|
textView2 = textView3;
|
|
} else {
|
|
C14957gcv.a("");
|
|
}
|
|
textView.setVisibility(textView2.getVisibility() == 0 ? 8 : 0);
|
|
j();
|
|
}
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public CustomCollapsibleText(Context context) {
|
|
super(context);
|
|
C14957gcv.e(context, "");
|
|
apH_(null);
|
|
}
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public CustomCollapsibleText(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
C14957gcv.e(context, "");
|
|
apH_(attributeSet);
|
|
}
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public CustomCollapsibleText(Context context, AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
C14957gcv.e(context, "");
|
|
apH_(attributeSet);
|
|
}
|
|
|
|
private void apH_(AttributeSet attributeSet) {
|
|
ButterKnife.c(this, LayoutInflater.from(getContext()).inflate(R.layout.2131558954, (ViewGroup) this, true));
|
|
if (attributeSet != null) {
|
|
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, C15715hv.jbe.CustomCollapsibleText);
|
|
C14957gcv.c(obtainStyledAttributes, "");
|
|
String string = obtainStyledAttributes.getString(0);
|
|
if (string != null) {
|
|
C14957gcv.c((Object) string, "");
|
|
setText(string);
|
|
}
|
|
String string2 = obtainStyledAttributes.getString(2);
|
|
if (string2 != null) {
|
|
C14957gcv.c((Object) string2, "");
|
|
setTitle(string2);
|
|
}
|
|
boolean z = obtainStyledAttributes.getBoolean(1, false);
|
|
TextView textView = this.contentText;
|
|
if (textView == null) {
|
|
C14957gcv.a("");
|
|
textView = null;
|
|
}
|
|
textView.setVisibility(z ? 0 : 8);
|
|
j();
|
|
obtainStyledAttributes.recycle();
|
|
}
|
|
}
|
|
|
|
private final void j() {
|
|
ImageView imageView = this.arrowImage;
|
|
TextView textView = null;
|
|
if (imageView == null) {
|
|
C14957gcv.a("");
|
|
imageView = null;
|
|
}
|
|
TextView textView2 = this.contentText;
|
|
if (textView2 != null) {
|
|
textView = textView2;
|
|
} else {
|
|
C14957gcv.a("");
|
|
}
|
|
imageView.setImageResource(textView.getVisibility() == 0 ? R.drawable.arrow_up : R.drawable.arrow_down);
|
|
}
|
|
|
|
public final void setText(String str) {
|
|
C14957gcv.e(str, "");
|
|
TextView textView = this.contentText;
|
|
if (textView == null) {
|
|
C14957gcv.a("");
|
|
textView = null;
|
|
}
|
|
textView.setText(str);
|
|
}
|
|
|
|
public final void setTitle(String str) {
|
|
C14957gcv.e(str, "");
|
|
TextView textView = this.titleText;
|
|
if (textView == null) {
|
|
C14957gcv.a("");
|
|
textView = null;
|
|
}
|
|
textView.setText(str);
|
|
}
|
|
|
|
public final void setTitleText(TextView textView) {
|
|
C14957gcv.e(textView, "");
|
|
this.titleText = textView;
|
|
}
|
|
|
|
public final void setContentText(TextView textView) {
|
|
C14957gcv.e(textView, "");
|
|
this.contentText = textView;
|
|
}
|
|
|
|
public final void setArrowImage(ImageView imageView) {
|
|
C14957gcv.e(imageView, "");
|
|
this.arrowImage = imageView;
|
|
}
|
|
}
|