what-the-bank/sources/com/rd/PageIndicatorView.java

1042 lines
30 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.rd;
import android.content.Context;
import android.content.res.Resources;
import android.database.DataSetObserver;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.Pair;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import androidx.viewpager.widget.ViewPager;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import o.C0721NPz;
import o.C11416eet;
import o.C15908jXs;
import o.C16877rxU;
import o.C16959sjm;
import o.DgC;
import o.PLx;
import o.SLJ;
import o.TPn;
import o.UZa;
import o.WYJ;
import o.XKS;
import o.YXR;
import o.pBJ;
import o.yPx;
/* loaded from: classes3.dex */
public class PageIndicatorView extends View implements ViewPager.ojQ, C16877rxU.HBt, ViewPager.LWm, View.OnTouchListener {
private static final Handler c = new Handler(Looper.getMainLooper());
private DataSetObserver a;
private boolean b;
public C16877rxU d;
private Runnable e;
private ViewPager g;
public PageIndicatorView(Context context) {
super(context);
this.e = new Runnable(this) { // from class: com.rd.PageIndicatorView.1
private PageIndicatorView c;
{
this.c = this;
}
@Override // java.lang.Runnable
public final void run() {
C15908jXs c15908jXs = this.c.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
PageIndicatorView.a(this.c);
}
};
if (getId() == -1) {
setId(DgC.d());
}
Pw_(null);
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
if (c15908jXs.c.i) {
c();
}
}
public PageIndicatorView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.e = new Runnable(this) { // from class: com.rd.PageIndicatorView.1
private PageIndicatorView c;
{
this.c = this;
}
@Override // java.lang.Runnable
public final void run() {
C15908jXs c15908jXs = this.c.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
PageIndicatorView.a(this.c);
}
};
if (getId() == -1) {
setId(DgC.d());
}
Pw_(attributeSet);
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
if (c15908jXs.c.i) {
c();
}
}
public PageIndicatorView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.e = new Runnable(this) { // from class: com.rd.PageIndicatorView.1
private PageIndicatorView c;
{
this.c = this;
}
@Override // java.lang.Runnable
public final void run() {
C15908jXs c15908jXs = this.c.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
PageIndicatorView.a(this.c);
}
};
if (getId() == -1) {
setId(DgC.d());
}
Pw_(attributeSet);
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
if (c15908jXs.c.i) {
c();
}
}
@Override // android.view.View
protected void onAttachedToWindow() {
View findViewById;
super.onAttachedToWindow();
for (ViewParent parent = getParent(); parent != null && (parent instanceof ViewGroup); parent = parent.getParent()) {
ViewGroup viewGroup = (ViewGroup) parent;
if (viewGroup.getChildCount() <= 0) {
return;
}
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
ViewPager viewPager = (viewGroup.getChildCount() <= 0 || (findViewById = viewGroup.findViewById(c15908jXs.c.w)) == null || !(findViewById instanceof ViewPager)) ? null : (ViewPager) findViewById;
if (viewPager != null) {
setViewPager(viewPager);
return;
}
}
}
@Override // android.view.View
protected void onDetachedFromWindow() {
g();
super.onDetachedFromWindow();
}
@Override // android.view.View
public Parcelable onSaveInstanceState() {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
UZa uZa = new UZa(super.onSaveInstanceState());
uZa.d = slj.y;
uZa.e = slj.v;
uZa.b = slj.h;
return uZa;
}
@Override // android.view.View
public void onRestoreInstanceState(Parcelable parcelable) {
if (parcelable instanceof UZa) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
UZa uZa = (UZa) parcelable;
slj.y = uZa.d;
slj.v = uZa.e;
slj.h = uZa.b;
super.onRestoreInstanceState(uZa.getSuperState());
return;
}
super.onRestoreInstanceState(parcelable);
}
@Override // android.view.View.OnTouchListener
public boolean onTouch(View view, MotionEvent motionEvent) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
if (!c15908jXs.c.i) {
return false;
}
int action = motionEvent.getAction();
if (action == 0) {
b();
} else if (action == 1) {
c();
}
return false;
}
@Override // o.C16877rxU.HBt
public final void e() {
invalidate();
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public void onPageScrolled(int i, float f, int i2) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
if (slj.e == null) {
slj.e = yPx.NONE;
}
yPx ypx = slj.e;
boolean z = slj.g;
if ((getMeasuredHeight() == 0 && getMeasuredWidth() == 0) || !z || ypx == yPx.NONE) {
return;
}
boolean a = a();
int i3 = slj.d;
int i4 = slj.y;
if (a) {
i = (i3 - 1) - i;
}
boolean z2 = false;
if (i < 0) {
i = 0;
} else {
int i5 = i3 - 1;
if (i > i5) {
i = i5;
}
}
boolean z3 = i > i4;
if (!a ? i + 1 < i4 : i - 1 < i4) {
z2 = true;
}
if (z3 || z2) {
slj.y = i;
i4 = i;
}
float f2 = BitmapDescriptorFactory.HUE_RED;
if (i4 != i || f == BitmapDescriptorFactory.HUE_RED) {
f = 1.0f - f;
} else {
i = a ? i - 1 : i + 1;
}
if (f > 1.0f) {
f2 = 1.0f;
} else if (f >= BitmapDescriptorFactory.HUE_RED) {
f2 = f;
}
Pair pair = new Pair(Integer.valueOf(i), Float.valueOf(f2));
setProgress(((Integer) pair.first).intValue(), ((Float) pair.second).floatValue());
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public void onPageSelected(int i) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
boolean z = (getMeasuredHeight() == 0 && getMeasuredWidth() == 0) ? false : true;
int i2 = slj.d;
if (z) {
if (a()) {
i = (i2 - 1) - i;
}
setSelection(i);
}
}
@Override // androidx.viewpager.widget.ViewPager.ojQ
public void onPageScrollStateChanged(int i) {
if (i == 0) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.g = this.b;
}
}
@Override // androidx.viewpager.widget.ViewPager.LWm
public final void b(ViewPager viewPager, WYJ wyj, WYJ wyj2) {
DataSetObserver dataSetObserver;
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
if (c15908jXs.c.c) {
if (wyj != null && (dataSetObserver = this.a) != null) {
wyj.unregisterDataSetObserver(dataSetObserver);
this.a = null;
}
d();
}
i();
}
public void setCount(int i) {
if (i >= 0) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
if (c15908jXs.c.d != i) {
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
c15908jXs2.c.d = i;
h();
requestLayout();
}
}
}
public void setDynamicCount(boolean z) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.c = z;
if (z) {
d();
} else {
g();
}
}
public void setFadeOnIdle(boolean z) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.i = z;
if (z) {
c();
} else {
b();
}
}
public void setRadius(float f) {
if (f < BitmapDescriptorFactory.HUE_RED) {
f = 0.0f;
}
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.s = (int) f;
invalidate();
}
public void setPadding(float f) {
if (f < BitmapDescriptorFactory.HUE_RED) {
f = 0.0f;
}
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.f8358o = (int) f;
invalidate();
}
/* JADX WARN: Code restructure failed: missing block: B:11:0x000d, code lost:
if (r3 < 0.3f) goto L4;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void setScaleFactor(float r3) {
/*
r2 = this;
r0 = 1065353216(0x3f800000, float:1.0)
int r1 = (r3 > r0 ? 1 : (r3 == r0 ? 0 : -1))
if (r1 <= 0) goto L8
L6:
r3 = r0
goto L10
L8:
r0 = 1050253722(0x3e99999a, float:0.3)
int r1 = (r3 > r0 ? 1 : (r3 == r0 ? 0 : -1))
if (r1 >= 0) goto L10
goto L6
L10:
o.rxU r0 = r2.d
o.jXs r0 = r0.a
o.SLJ r1 = r0.c
if (r1 != 0) goto L1f
o.SLJ r1 = new o.SLJ
r1.<init>()
r0.c = r1
L1f:
o.SLJ r0 = r0.c
r0.p = r3
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.rd.PageIndicatorView.setScaleFactor(float):void");
}
public void setStrokeWidth(float f) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
int i = c15908jXs.c.s;
if (f < BitmapDescriptorFactory.HUE_RED) {
f = 0.0f;
} else {
float f2 = i;
if (f > f2) {
f = f2;
}
}
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
c15908jXs2.c.u = (int) f;
invalidate();
}
public void setSelectedColor(int i) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.q = i;
invalidate();
}
public void setUnselectedColor(int i) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.x = i;
invalidate();
}
public void setAutoVisibility(boolean z) {
if (!z) {
setVisibility(0);
}
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.a = z;
h();
}
public void setOrientation(YXR yxr) {
if (yxr != null) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.l = yxr;
requestLayout();
}
}
public void setAnimationDuration(long j) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.b = j;
}
public void setIdleDuration(long j) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.f = j;
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
if (c15908jXs2.c.i) {
c();
} else {
b();
}
}
public void setAnimationType(yPx ypx) {
C16877rxU c16877rxU = this.d;
c16877rxU.a.d.b = null;
C16877rxU.HBt hBt = c16877rxU.d;
if (hBt != null) {
hBt.e();
}
if (ypx != null) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.e = ypx;
} else {
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
c15908jXs2.c.e = yPx.NONE;
}
invalidate();
}
public void setInteractiveAnimation(boolean z) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.g = z;
this.b = z;
}
public void setViewPager(ViewPager viewPager) {
ViewPager viewPager2 = this.g;
if (viewPager2 != null) {
viewPager2.removeOnPageChangeListener(this);
this.g.removeOnAdapterChangeListener(this);
this.g = null;
}
if (viewPager == null) {
return;
}
this.g = viewPager;
viewPager.addOnPageChangeListener(this);
this.g.addOnAdapterChangeListener(this);
this.g.setOnTouchListener(this);
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.w = this.g.getId();
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
setDynamicCount(c15908jXs2.c.c);
i();
}
public void setRtlMode(pBJ pbj) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
if (pbj == null) {
slj.r = pBJ.Off;
} else {
slj.r = pbj;
}
if (this.g == null) {
return;
}
int i = slj.y;
if (!a()) {
ViewPager viewPager = this.g;
if (viewPager != null) {
i = viewPager.getCurrentItem();
}
} else {
i = (slj.d - 1) - i;
}
slj.h = i;
slj.v = i;
slj.y = i;
invalidate();
}
public void setSelection(int i) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
int i2 = c15908jXs2.c.d - 1;
if (i < 0) {
i = 0;
} else if (i > i2) {
i = i2;
}
if (i == slj.y || i == slj.v) {
return;
}
slj.g = false;
slj.h = slj.y;
slj.v = i;
slj.y = i;
C11416eet c11416eet = this.d.e;
PLx pLx = c11416eet.a;
if (pLx != null) {
XKS xks = pLx.a;
if (xks != null) {
xks.e();
}
PLx pLx2 = c11416eet.a;
pLx2.e = false;
pLx2.b = BitmapDescriptorFactory.HUE_RED;
pLx2.e();
}
}
public void setSelected(int i) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
if (slj.e == null) {
slj.e = yPx.NONE;
}
yPx ypx = slj.e;
slj.e = yPx.NONE;
setSelection(i);
slj.e = ypx;
}
public void setProgress(int i, float f) {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
if (slj.g) {
int i2 = slj.d;
if (i2 <= 0 || i < 0) {
i = 0;
} else {
int i3 = i2 - 1;
if (i > i3) {
i = i3;
}
}
if (f < BitmapDescriptorFactory.HUE_RED) {
f = 0.0f;
} else if (f > 1.0f) {
f = 1.0f;
}
if (f == 1.0f) {
slj.h = slj.y;
slj.y = i;
}
slj.v = i;
PLx pLx = this.d.e.a;
if (pLx != null) {
pLx.e = true;
pLx.b = f;
pLx.e();
}
}
}
private void Pw_(AttributeSet attributeSet) {
C16877rxU c16877rxU = new C16877rxU(this);
this.d = c16877rxU;
C15908jXs c15908jXs = c16877rxU.a;
c15908jXs.b.Qc_(getContext(), attributeSet);
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
SLJ slj = c15908jXs2.c;
slj.n = getPaddingLeft();
slj.t = getPaddingTop();
slj.m = getPaddingRight();
slj.k = getPaddingBottom();
this.b = slj.g;
}
private void d() {
ViewPager viewPager;
if (this.a != null || (viewPager = this.g) == null || viewPager.getAdapter() == null) {
return;
}
this.a = new DataSetObserver(this) { // from class: com.rd.PageIndicatorView.5
private PageIndicatorView e;
{
this.e = this;
}
@Override // android.database.DataSetObserver
public final void onChanged() {
this.e.i();
}
};
try {
this.g.getAdapter().registerDataSetObserver(this.a);
} catch (IllegalStateException unused) {
}
}
private void g() {
ViewPager viewPager;
if (this.a == null || (viewPager = this.g) == null || viewPager.getAdapter() == null) {
return;
}
try {
this.g.getAdapter().unregisterDataSetObserver(this.a);
this.a = null;
} catch (IllegalStateException unused) {
}
}
/* JADX INFO: Access modifiers changed from: private */
public void i() {
XKS xks;
ViewPager viewPager = this.g;
if (viewPager == null || viewPager.getAdapter() == null) {
return;
}
int count = this.g.getAdapter().getCount();
int currentItem = a() ? (count - 1) - this.g.getCurrentItem() : this.g.getCurrentItem();
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.y = currentItem;
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
c15908jXs2.c.v = currentItem;
C15908jXs c15908jXs3 = this.d.a;
if (c15908jXs3.c == null) {
c15908jXs3.c = new SLJ();
}
c15908jXs3.c.h = currentItem;
C15908jXs c15908jXs4 = this.d.a;
if (c15908jXs4.c == null) {
c15908jXs4.c = new SLJ();
}
c15908jXs4.c.d = count;
PLx pLx = this.d.e.a;
if (pLx != null && (xks = pLx.a) != null) {
xks.e();
}
h();
requestLayout();
}
private void h() {
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
if (c15908jXs.c.a) {
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
int i = c15908jXs2.c.d;
int visibility = getVisibility();
if (visibility != 0 && i > 1) {
setVisibility(0);
} else {
if (visibility == 4 || i > 1) {
return;
}
setVisibility(4);
}
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: com.rd.PageIndicatorView$4, reason: invalid class name */
/* loaded from: classes3.dex */
public static /* synthetic */ class AnonymousClass4 {
static final int[] a;
static {
int[] iArr = new int[pBJ.values().length];
a = iArr;
try {
iArr[pBJ.On.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[pBJ.Off.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[pBJ.Auto.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
private boolean a() {
int[] iArr = AnonymousClass4.a;
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
SLJ slj = c15908jXs.c;
if (slj.r == null) {
slj.r = pBJ.Off;
}
int i = iArr[slj.r.ordinal()];
if (i != 1) {
return i == 3 && C16959sjm.b(getContext().getResources().getConfiguration().locale) == 1;
}
return true;
}
private void c() {
Handler handler = c;
handler.removeCallbacks(this.e);
Runnable runnable = this.e;
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
handler.postDelayed(runnable, c15908jXs.c.f);
}
private void b() {
c.removeCallbacks(this.e);
animate().cancel();
animate().alpha(1.0f).setDuration(250L);
}
static /* synthetic */ void a(PageIndicatorView pageIndicatorView) {
pageIndicatorView.animate().cancel();
pageIndicatorView.animate().alpha(BitmapDescriptorFactory.HUE_RED).setDuration(250L);
}
/* JADX WARN: Removed duplicated region for block: B:49:0x011c */
/* JADX WARN: Removed duplicated region for block: B:52:0x0126 */
/* JADX WARN: Removed duplicated region for block: B:54:0x0130 */
@Override // android.view.View
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
protected void onDraw(android.graphics.Canvas r18) {
/*
Method dump skipped, instructions count: 868
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.rd.PageIndicatorView.onDraw(android.graphics.Canvas):void");
}
@Override // android.view.View
protected void onMeasure(int i, int i2) {
int i3;
int i4;
C15908jXs c15908jXs = this.d.a;
TPn tPn = c15908jXs.e;
SLJ slj = c15908jXs.c;
int mode = View.MeasureSpec.getMode(i);
int size = View.MeasureSpec.getSize(i);
int mode2 = View.MeasureSpec.getMode(i2);
int size2 = View.MeasureSpec.getSize(i2);
int i5 = slj.d;
int i6 = slj.s;
int i7 = slj.u;
int i8 = slj.f8358o;
int i9 = slj.n;
int i10 = slj.t;
int i11 = slj.m;
int i12 = slj.k;
int i13 = i6 << 1;
if (slj.l == null) {
slj.l = YXR.HORIZONTAL;
}
YXR yxr = slj.l;
if (i5 != 0) {
i4 = (i13 * i5) + ((i7 << 1) * i5) + (i8 * (i5 - 1));
i3 = i13 + i7;
if (yxr == YXR.HORIZONTAL) {
i4 = i3;
i3 = i4;
}
} else {
i3 = 0;
i4 = 0;
}
if (slj.e == null) {
slj.e = yPx.NONE;
}
if (slj.e == yPx.DROP) {
if (yxr == YXR.HORIZONTAL) {
i4 <<= 1;
} else {
i3 <<= 1;
}
}
YXR yxr2 = YXR.HORIZONTAL;
int i14 = i3 + i9 + i11;
int i15 = i4 + i10 + i12;
if (mode != 1073741824) {
size = mode == Integer.MIN_VALUE ? Math.min(i14, size) : i14;
}
if (mode2 != 1073741824) {
size2 = mode2 == Integer.MIN_VALUE ? Math.min(i15, size2) : i15;
}
if (size < 0) {
size = 0;
}
int i16 = size2 >= 0 ? size2 : 0;
slj.D = size;
slj.j = i16;
Pair pair = new Pair(Integer.valueOf(size), Integer.valueOf(i16));
setMeasuredDimension(((Integer) pair.first).intValue(), ((Integer) pair.second).intValue());
}
@Override // android.view.View
public boolean onTouchEvent(MotionEvent motionEvent) {
SLJ slj;
int i;
C0721NPz c0721NPz = this.d.a.d;
if (motionEvent != null && motionEvent.getAction() == 1) {
float x = motionEvent.getX();
float y = motionEvent.getY();
if (c0721NPz.e != null && (slj = c0721NPz.c) != null) {
if (slj.l == null) {
slj.l = YXR.HORIZONTAL;
}
if (slj.l != YXR.HORIZONTAL) {
y = x;
x = y;
}
int i2 = slj.d;
int i3 = slj.s;
int i4 = slj.u;
int i5 = slj.f8358o;
if (slj.l == null) {
slj.l = YXR.HORIZONTAL;
}
if (slj.l == YXR.HORIZONTAL) {
i = slj.j;
} else {
i = slj.D;
}
int i6 = 0;
int i7 = 0;
while (true) {
if (i6 >= i2) {
break;
}
int i8 = (i3 << 1) + (i4 / 2) + (i6 > 0 ? i5 : i5 / 2) + i7;
boolean z = x >= ((float) i7) && x <= ((float) i8);
boolean z2 = y >= BitmapDescriptorFactory.HUE_RED && y <= ((float) i);
if (!z || !z2) {
i6++;
i7 = i8;
} else if (i6 >= 0) {
C0721NPz.HBt hBt = c0721NPz.e;
}
}
}
}
return true;
}
public void setClickListener(C0721NPz.HBt hBt) {
this.d.a.d.e = hBt;
}
public void setPadding(int i) {
if (i < 0) {
i = 0;
}
int applyDimension = (int) TypedValue.applyDimension(1, i, Resources.getSystem().getDisplayMetrics());
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.f8358o = applyDimension;
invalidate();
}
public void setRadius(int i) {
if (i < 0) {
i = 0;
}
int applyDimension = (int) TypedValue.applyDimension(1, i, Resources.getSystem().getDisplayMetrics());
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
c15908jXs.c.s = applyDimension;
invalidate();
}
public void setStrokeWidth(int i) {
int applyDimension = (int) TypedValue.applyDimension(1, i, Resources.getSystem().getDisplayMetrics());
C15908jXs c15908jXs = this.d.a;
if (c15908jXs.c == null) {
c15908jXs.c = new SLJ();
}
int i2 = c15908jXs.c.s;
if (applyDimension < 0) {
applyDimension = 0;
} else if (applyDimension > i2) {
applyDimension = i2;
}
C15908jXs c15908jXs2 = this.d.a;
if (c15908jXs2.c == null) {
c15908jXs2.c = new SLJ();
}
c15908jXs2.c.u = applyDimension;
invalidate();
}
}