158 lines
5.4 KiB
Java
158 lines
5.4 KiB
Java
|
package o;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.content.res.Resources;
|
||
|
import android.content.res.TypedArray;
|
||
|
import android.graphics.Color;
|
||
|
import android.util.AttributeSet;
|
||
|
import android.util.TypedValue;
|
||
|
import com.google.android.gms.auth.api.proxy.AuthApiStatusCodes;
|
||
|
import o.C17317vkB;
|
||
|
|
||
|
/* loaded from: classes3.dex */
|
||
|
public final class TtJ {
|
||
|
private SLJ b;
|
||
|
|
||
|
public TtJ(SLJ slj) {
|
||
|
this.b = slj;
|
||
|
}
|
||
|
|
||
|
public final void Qc_(Context context, AttributeSet attributeSet) {
|
||
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C17317vkB.Sts.PageIndicatorView, 0, 0);
|
||
|
Qa_(obtainStyledAttributes);
|
||
|
PZ_(obtainStyledAttributes);
|
||
|
PY_(obtainStyledAttributes);
|
||
|
Qb_(obtainStyledAttributes);
|
||
|
obtainStyledAttributes.recycle();
|
||
|
}
|
||
|
|
||
|
private void Qa_(TypedArray typedArray) {
|
||
|
int resourceId = typedArray.getResourceId(C17317vkB.Sts.PageIndicatorView_piv_viewPager, -1);
|
||
|
boolean z = typedArray.getBoolean(C17317vkB.Sts.PageIndicatorView_piv_autoVisibility, true);
|
||
|
int i = 0;
|
||
|
boolean z2 = typedArray.getBoolean(C17317vkB.Sts.PageIndicatorView_piv_dynamicCount, false);
|
||
|
int i2 = typedArray.getInt(C17317vkB.Sts.PageIndicatorView_piv_count, -1);
|
||
|
if (i2 == -1) {
|
||
|
i2 = 3;
|
||
|
}
|
||
|
int i3 = typedArray.getInt(C17317vkB.Sts.PageIndicatorView_piv_select, 0);
|
||
|
if (i3 >= 0 && (i2 <= 0 || i3 <= i2 - 1)) {
|
||
|
i = i3;
|
||
|
}
|
||
|
this.b.w = resourceId;
|
||
|
this.b.a = z;
|
||
|
this.b.c = z2;
|
||
|
this.b.d = i2;
|
||
|
this.b.y = i;
|
||
|
this.b.v = i;
|
||
|
this.b.h = i;
|
||
|
}
|
||
|
|
||
|
private void PZ_(TypedArray typedArray) {
|
||
|
int color = typedArray.getColor(C17317vkB.Sts.PageIndicatorView_piv_unselectedColor, Color.parseColor("#33ffffff"));
|
||
|
int color2 = typedArray.getColor(C17317vkB.Sts.PageIndicatorView_piv_selectedColor, Color.parseColor("#ffffff"));
|
||
|
this.b.x = color;
|
||
|
this.b.q = color2;
|
||
|
}
|
||
|
|
||
|
private void PY_(TypedArray typedArray) {
|
||
|
yPx ypx;
|
||
|
pBJ pbj;
|
||
|
boolean z = typedArray.getBoolean(C17317vkB.Sts.PageIndicatorView_piv_interactiveAnimation, false);
|
||
|
long j = typedArray.getInt(C17317vkB.Sts.PageIndicatorView_piv_animationDuration, 350);
|
||
|
if (j < 0) {
|
||
|
j = 0;
|
||
|
}
|
||
|
switch (typedArray.getInt(C17317vkB.Sts.PageIndicatorView_piv_animationType, yPx.NONE.ordinal())) {
|
||
|
case 0:
|
||
|
ypx = yPx.NONE;
|
||
|
break;
|
||
|
case 1:
|
||
|
ypx = yPx.COLOR;
|
||
|
break;
|
||
|
case 2:
|
||
|
ypx = yPx.SCALE;
|
||
|
break;
|
||
|
case 3:
|
||
|
ypx = yPx.WORM;
|
||
|
break;
|
||
|
case 4:
|
||
|
ypx = yPx.SLIDE;
|
||
|
break;
|
||
|
case 5:
|
||
|
ypx = yPx.FILL;
|
||
|
break;
|
||
|
case 6:
|
||
|
ypx = yPx.THIN_WORM;
|
||
|
break;
|
||
|
case 7:
|
||
|
ypx = yPx.DROP;
|
||
|
break;
|
||
|
case 8:
|
||
|
ypx = yPx.SWAP;
|
||
|
break;
|
||
|
case 9:
|
||
|
ypx = yPx.SCALE_DOWN;
|
||
|
break;
|
||
|
default:
|
||
|
ypx = yPx.NONE;
|
||
|
break;
|
||
|
}
|
||
|
int i = typedArray.getInt(C17317vkB.Sts.PageIndicatorView_piv_rtl_mode, pBJ.Off.ordinal());
|
||
|
if (i == 0) {
|
||
|
pbj = pBJ.On;
|
||
|
} else if (i == 1) {
|
||
|
pbj = pBJ.Off;
|
||
|
} else if (i == 2) {
|
||
|
pbj = pBJ.Auto;
|
||
|
} else {
|
||
|
pbj = pBJ.Auto;
|
||
|
}
|
||
|
boolean z2 = typedArray.getBoolean(C17317vkB.Sts.PageIndicatorView_piv_fadeOnIdle, false);
|
||
|
long j2 = typedArray.getInt(C17317vkB.Sts.PageIndicatorView_piv_idleDuration, AuthApiStatusCodes.AUTH_API_INVALID_CREDENTIALS);
|
||
|
this.b.b = j;
|
||
|
this.b.g = z;
|
||
|
this.b.e = ypx;
|
||
|
this.b.r = pbj;
|
||
|
this.b.i = z2;
|
||
|
this.b.f = j2;
|
||
|
}
|
||
|
|
||
|
private void Qb_(TypedArray typedArray) {
|
||
|
YXR yxr;
|
||
|
if (typedArray.getInt(C17317vkB.Sts.PageIndicatorView_piv_orientation, YXR.HORIZONTAL.ordinal()) == 0) {
|
||
|
yxr = YXR.HORIZONTAL;
|
||
|
} else {
|
||
|
yxr = YXR.VERTICAL;
|
||
|
}
|
||
|
int dimension = (int) typedArray.getDimension(C17317vkB.Sts.PageIndicatorView_piv_radius, (int) TypedValue.applyDimension(1, 6.0f, Resources.getSystem().getDisplayMetrics()));
|
||
|
if (dimension < 0) {
|
||
|
dimension = 0;
|
||
|
}
|
||
|
int dimension2 = (int) typedArray.getDimension(C17317vkB.Sts.PageIndicatorView_piv_padding, (int) TypedValue.applyDimension(1, 8.0f, Resources.getSystem().getDisplayMetrics()));
|
||
|
if (dimension2 < 0) {
|
||
|
dimension2 = 0;
|
||
|
}
|
||
|
float f = typedArray.getFloat(C17317vkB.Sts.PageIndicatorView_piv_scaleFactor, 0.7f);
|
||
|
if (f < 0.3f) {
|
||
|
f = 0.3f;
|
||
|
} else if (f > 1.0f) {
|
||
|
f = 1.0f;
|
||
|
}
|
||
|
int dimension3 = (int) typedArray.getDimension(C17317vkB.Sts.PageIndicatorView_piv_strokeWidth, (int) TypedValue.applyDimension(1, 1.0f, Resources.getSystem().getDisplayMetrics()));
|
||
|
if (dimension3 > dimension) {
|
||
|
dimension3 = dimension;
|
||
|
}
|
||
|
SLJ slj = this.b;
|
||
|
if (slj.e == null) {
|
||
|
slj.e = yPx.NONE;
|
||
|
}
|
||
|
int i = slj.e == yPx.FILL ? dimension3 : 0;
|
||
|
this.b.s = dimension;
|
||
|
this.b.l = yxr;
|
||
|
this.b.f8358o = dimension2;
|
||
|
this.b.p = f;
|
||
|
this.b.u = i;
|
||
|
}
|
||
|
}
|