what-the-bank/sources/com/scb/phone/view/custom/common/CustomDeltaInputLongPressed...

211 lines
7.5 KiB
Java

package com.scb.phone.view.custom.common;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import com.scb.phone.view.custom.common.CustomDeltaInputLongPressed;
import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;
import o.AbstractC13163fSk;
import o.AbstractC14961gcz;
import o.C13417fZt;
import o.C14866gag;
import o.C14957gcv;
import o.InterfaceC14894gbR;
import o.fRR;
import o.fSJ;
import o.fSQ;
/* loaded from: classes5.dex */
public final class CustomDeltaInputLongPressed extends CustomDeltaInput {
private fSJ b;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CustomDeltaInputLongPressed(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
C14957gcv.e(context, "");
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // com.scb.phone.view.custom.common.CustomDeltaInput
public final void b(final double d) {
super.b(d);
this.increaseButton.setOnLongClickListener(new View.OnLongClickListener(this, d) { // from class: o.eBx
private CustomDeltaInputLongPressed c;
private double e;
@Override // android.view.View.OnLongClickListener
public final boolean onLongClick(View view) {
return CustomDeltaInputLongPressed.e(this.c, this.e);
}
{
this.c = this;
this.e = d;
}
});
this.decreaseButton.setOnLongClickListener(new View.OnLongClickListener(this, d) { // from class: o.eBz
private CustomDeltaInputLongPressed a;
private double d;
@Override // android.view.View.OnLongClickListener
public final boolean onLongClick(View view) {
return CustomDeltaInputLongPressed.d(this.a, this.d);
}
{
this.a = this;
this.d = d;
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes5.dex */
public static final class LWm extends AbstractC14961gcz implements InterfaceC14894gbR<Long, C14866gag> {
private CustomDeltaInputLongPressed a;
private double c;
@Override // o.InterfaceC14894gbR
public final /* synthetic */ C14866gag invoke(Long l) {
CustomDeltaInputLongPressed.b(this.a, this.c);
return C14866gag.c;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
LWm(CustomDeltaInputLongPressed customDeltaInputLongPressed, double d) {
super(1);
this.a = customDeltaInputLongPressed;
this.c = d;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes5.dex */
public static final class HBt extends AbstractC14961gcz implements InterfaceC14894gbR<Long, C14866gag> {
private CustomDeltaInputLongPressed b;
private double c;
@Override // o.InterfaceC14894gbR
public final /* synthetic */ C14866gag invoke(Long l) {
CustomDeltaInputLongPressed.c(this.b, this.c);
return C14866gag.c;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
HBt(CustomDeltaInputLongPressed customDeltaInputLongPressed, double d) {
super(1);
this.b = customDeltaInputLongPressed;
this.c = d;
}
}
/* loaded from: classes5.dex */
public static final class Sts {
private Sts() {
}
public /* synthetic */ Sts(byte b) {
this();
}
}
public static /* synthetic */ boolean e(CustomDeltaInputLongPressed customDeltaInputLongPressed, double d) {
C14957gcv.e(customDeltaInputLongPressed, "");
AbstractC13163fSk<Long> observeOn = AbstractC13163fSk.interval(50L, TimeUnit.MILLISECONDS, C13417fZt.c()).observeOn(fRR.e());
final LWm lWm = new LWm(customDeltaInputLongPressed, d);
customDeltaInputLongPressed.b = observeOn.subscribe(new fSQ(lWm) { // from class: o.eBw
private InterfaceC14894gbR c;
@Override // o.fSQ
public final void c(Object obj) {
CustomDeltaInputLongPressed.b(this.c, obj);
}
{
this.c = lWm;
}
});
return false;
}
public static /* synthetic */ void b(InterfaceC14894gbR interfaceC14894gbR, Object obj) {
C14957gcv.e(interfaceC14894gbR, "");
interfaceC14894gbR.invoke(obj);
}
public static /* synthetic */ void e(InterfaceC14894gbR interfaceC14894gbR, Object obj) {
C14957gcv.e(interfaceC14894gbR, "");
interfaceC14894gbR.invoke(obj);
}
public static /* synthetic */ boolean d(CustomDeltaInputLongPressed customDeltaInputLongPressed, double d) {
C14957gcv.e(customDeltaInputLongPressed, "");
AbstractC13163fSk<Long> observeOn = AbstractC13163fSk.interval(50L, TimeUnit.MILLISECONDS, C13417fZt.c()).observeOn(fRR.e());
final HBt hBt = new HBt(customDeltaInputLongPressed, d);
customDeltaInputLongPressed.b = observeOn.subscribe(new fSQ(hBt) { // from class: o.eBy
private InterfaceC14894gbR e;
@Override // o.fSQ
public final void c(Object obj) {
CustomDeltaInputLongPressed.e(this.e, obj);
}
{
this.e = hBt;
}
});
return false;
}
public static final /* synthetic */ void c(CustomDeltaInputLongPressed customDeltaInputLongPressed, double d) {
double doubleValue;
if (!customDeltaInputLongPressed.decreaseButton.isPressed()) {
fSJ fsj = customDeltaInputLongPressed.b;
if (fsj == null || fsj.isDisposed()) {
return;
}
fsj.dispose();
return;
}
customDeltaInputLongPressed.errorMessage.setVisibility(8);
if (customDeltaInputLongPressed.c > customDeltaInputLongPressed.b()) {
doubleValue = customDeltaInputLongPressed.b();
} else {
doubleValue = BigDecimal.valueOf(customDeltaInputLongPressed.c).subtract(BigDecimal.valueOf(d)).doubleValue();
}
customDeltaInputLongPressed.e(doubleValue);
if (customDeltaInputLongPressed.e != null) {
customDeltaInputLongPressed.e.h();
}
customDeltaInputLongPressed.inputValue.requestFocus();
}
public static final /* synthetic */ void b(CustomDeltaInputLongPressed customDeltaInputLongPressed, double d) {
double doubleValue;
if (!customDeltaInputLongPressed.increaseButton.isPressed()) {
fSJ fsj = customDeltaInputLongPressed.b;
if (fsj == null || fsj.isDisposed()) {
return;
}
fsj.dispose();
return;
}
customDeltaInputLongPressed.errorMessage.setVisibility(8);
if (customDeltaInputLongPressed.c < customDeltaInputLongPressed.d()) {
doubleValue = customDeltaInputLongPressed.d();
} else {
doubleValue = BigDecimal.valueOf(customDeltaInputLongPressed.c).add(BigDecimal.valueOf(d)).doubleValue();
}
customDeltaInputLongPressed.e(doubleValue);
if (customDeltaInputLongPressed.e != null) {
customDeltaInputLongPressed.e.j();
}
customDeltaInputLongPressed.inputValue.requestFocus();
}
static {
new Sts((byte) 0);
}
}