what-the-bank/sources/com/scb/phone/view/custom/ccrredemption/ConfirmationThemeSlipLayout...

111 lines
3.7 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.scb.phone.view.custom.ccrredemption;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import java.io.File;
import java.util.Map;
import o.C12891fKc;
import o.C6583cXR;
import o.InterfaceC9006dba;
import o.guQ;
/* loaded from: classes5.dex */
public class ConfirmationThemeSlipLayout extends LinearLayout implements InterfaceC9006dba {
@BindView
ImageView imageSlipBorderLeft;
@BindView
ImageView imageSlipBorderRight;
@BindView
ImageView imageSlipBottom;
@BindView
ImageView imageSlipBottomBorder;
@BindView
ImageView imageSlipHeader;
@BindView
FrameLayout slipContent;
public ConfirmationThemeSlipLayout(Context context) {
super(context);
LayoutInflater.from(getContext()).inflate(R.layout.2131560078, (ViewGroup) this, true);
ButterKnife.c(this, this);
}
public ConfirmationThemeSlipLayout(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
LayoutInflater.from(getContext()).inflate(R.layout.2131560078, (ViewGroup) this, true);
ButterKnife.c(this, this);
}
public ConfirmationThemeSlipLayout(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
LayoutInflater.from(getContext()).inflate(R.layout.2131560078, (ViewGroup) this, true);
ButterKnife.c(this, this);
}
@Override // o.InterfaceC9006dba
public final void e(Map<String, String> map) {
Bitmap ayW_;
if (map == null || map.isEmpty()) {
return;
}
ImageView imageView = this.imageSlipHeader;
String str = map.get("slip_header.png");
if (!TextUtils.isEmpty(str)) {
C12891fKc.azF_(new File(str), imageView);
}
ImageView imageView2 = this.imageSlipBorderLeft;
String str2 = map.get("slip_side.png");
if (!TextUtils.isEmpty(str2)) {
C12891fKc.azF_(new File(str2), imageView2);
}
ImageView imageView3 = this.imageSlipBorderRight;
String str3 = map.get("slip_side.png");
if (!TextUtils.isEmpty(str3)) {
C12891fKc.azF_(new File(str3), imageView3);
}
ImageView imageView4 = this.imageSlipBottom;
String str4 = map.get("slip_bottom.png");
if (!TextUtils.isEmpty(str4)) {
C12891fKc.azF_(new File(str4), imageView4);
}
ImageView imageView5 = this.imageSlipBottomBorder;
String str5 = map.get("slip_zigzag.png");
if (!TextUtils.isEmpty(str5)) {
C12891fKc.azF_(new File(str5), imageView5);
}
FrameLayout frameLayout = this.slipContent;
String str6 = map.get("slip_watermark.png");
if (TextUtils.isEmpty(str6) || (ayW_ = C12891fKc.ayW_(new File(str6))) == null) {
return;
}
int d = C6583cXR.d(84, getContext());
try {
BitmapDrawable bitmapDrawable = new BitmapDrawable(getResources(), Bitmap.createScaledBitmap(ayW_, d, d, false));
Shader.TileMode tileMode = Shader.TileMode.REPEAT;
bitmapDrawable.setTileModeXY(tileMode, tileMode);
bitmapDrawable.setAlpha(204);
frameLayout.setBackground(bitmapDrawable);
} catch (OutOfMemoryError e) {
guQ.e(e, "Tile Image got OOM", new Object[0]);
}
}
}