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

89 lines
2.7 KiB
Java

package com.scb.phone.view.custom.common;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.appcompat.widget.AppCompatSeekBar;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.scb.phone.R;
import java.lang.ref.WeakReference;
import o.C6583cXR;
/* loaded from: classes5.dex */
public class SetLimitView extends LinearLayout {
private int a;
private Context b;
private int c;
private WeakReference<TextView> d;
private int e;
@BindView
TextView endLimit;
private int i;
@BindView
AppCompatSeekBar seekBarLimiter;
@BindView
TextView startLimit;
public SetLimitView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.c = 0;
this.a = 0;
this.b = context;
((LayoutInflater) context.getSystemService("layout_inflater")).inflate(R.layout.2131559339, (ViewGroup) this, true);
ButterKnife.c(this);
}
public void setTextViewToChange(TextView textView) {
this.d = new WeakReference<>(textView);
}
public void setRangeValues(int i, int i2, int i3) {
this.c = i;
this.a = i2;
this.e = i3;
if (i >= 0 && i2 > 0) {
this.startLimit.setText(C6583cXR.d(i));
this.endLimit.setText(C6583cXR.d(this.a));
this.seekBarLimiter.setMax(this.a - this.c);
}
this.seekBarLimiter.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(this) { // from class: com.scb.phone.view.custom.common.SetLimitView.5
private SetLimitView d;
@Override // android.widget.SeekBar.OnSeekBarChangeListener
public final void onStartTrackingTouch(SeekBar seekBar) {
}
@Override // android.widget.SeekBar.OnSeekBarChangeListener
public final void onStopTrackingTouch(SeekBar seekBar) {
}
{
this.d = this;
}
@Override // android.widget.SeekBar.OnSeekBarChangeListener
public final void onProgressChanged(SeekBar seekBar, int i4, boolean z) {
if (this.d.d == null || this.d.d.get() == null) {
return;
}
SetLimitView setLimitView = this.d;
setLimitView.i = ((setLimitView.c + i4) / this.d.e) * this.d.e;
((TextView) this.d.d.get()).setText(C6583cXR.d(this.d.i));
}
});
}
public void setDefaultValue(int i) {
this.seekBarLimiter.setProgress(i - this.c);
this.i = i;
}
}