得物.apk(点击下载) / DuExSlidingTabLayout.java
package com.shizhuang.duapp.modules.feed.circle.view;
import a1.a;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.flyco.tablayout.listener.OnTabSelectListener;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.sensorsdata.analytics.android.sdk.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.shizhuang.duapp.R;
import o5.i;
public class DuExSlidingTabLayout extends HorizontalScrollView implements ViewPager.OnPageChangeListener {
public static ChangeQuickRedirect changeQuickRedirect;
public int A;
public boolean B;
public int C;
public float D;
public int E;
public int F;
public float G;
public float H;
public float I;
public int J;
public int K;
public int L;
public boolean M;
public int N;
public boolean O;
public float P;
public Paint Q;
public OnTabSelectListener R;
public Context b;
/* renamed from: c reason: collision with root package name */
public ViewPager f15129c;
public LinearLayout d;
public int e;
public float f;
/* renamed from: g reason: collision with root package name */
public int f15130g;
/* renamed from: h reason: collision with root package name */
public Rect f15131h;
public Rect i;
public GradientDrawable j;
public Paint k;
public Paint l;
public Paint m;
public Path n;
public int o;
public float p;
/* renamed from: q reason: collision with root package name */
public boolean f15132q;
public float r;
public int s;
public float t;
/* renamed from: u reason: collision with root package name */
public float f15133u;
/* renamed from: v reason: collision with root package name */
public float f15134v;
public float w;
public float x;
public float y;
public float z;
public class InnerPagerAdapter extends FragmentPagerAdapter {
public static ChangeQuickRedirect changeQuickRedirect;
@Override // androidx.viewpager.widget.PagerAdapter, androidx.fragment.app.FragmentPagerAdapter
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
boolean z = PatchProxy.proxy(new Object[]{viewGroup, new Integer(i), obj}, this, changeQuickRedirect, false, 144839, new Class[]{ViewGroup.class, Integer.TYPE, Object.class}, Void.TYPE).isSupported;
}
@Override // androidx.viewpager.widget.PagerAdapter
public int getCount() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144836, new Class[0], Integer.TYPE);
if (proxy.isSupported) {
return ((Integer) proxy.result).intValue();
}
throw null;
}
@Override // androidx.fragment.app.FragmentPagerAdapter
public Fragment getItem(int i) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 144838, new Class[]{Integer.TYPE}, Fragment.class);
if (proxy.isSupported) {
return (Fragment) proxy.result;
}
throw null;
}
@Override // androidx.viewpager.widget.PagerAdapter
public int getItemPosition(Object obj) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{obj}, this, changeQuickRedirect, false, 144840, new Class[]{Object.class}, Integer.TYPE);
if (proxy.isSupported) {
return ((Integer) proxy.result).intValue();
}
return -2;
}
@Override // androidx.viewpager.widget.PagerAdapter
public CharSequence getPageTitle(int i) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 144837, new Class[]{Integer.TYPE}, CharSequence.class);
if (proxy.isSupported) {
return (CharSequence) proxy.result;
}
throw null;
}
}
public DuExSlidingTabLayout(Context context) {
this(context, null, 0);
}
public final void a() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144773, new Class[0], Void.TYPE).isSupported) {
View childAt = this.d.getChildAt(this.e);
float left = (float) childAt.getLeft();
float right = (float) childAt.getRight();
if (this.o == 0 && this.B) {
this.Q.setTextSize(this.I);
this.P = ((right - left) - this.Q.measureText(((TextView) childAt.findViewById(R.id.tv_tab_title)).getText().toString())) / 2.0f;
}
int i3 = this.e;
if (i3 < this.f15130g - 1) {
View childAt2 = this.d.getChildAt(i3 + 1);
float left2 = (float) childAt2.getLeft();
float right2 = (float) childAt2.getRight();
float f12 = this.f;
left = a.b(left2, left, f12, left);
right = a.b(right2, right, f12, right);
if (this.o == 0 && this.B) {
this.Q.setTextSize(this.I);
float f13 = this.P;
this.P = a.b(((right2 - left2) - this.Q.measureText(((TextView) childAt2.findViewById(R.id.tv_tab_title)).getText().toString())) / 2.0f, f13, this.f, f13);
}
}
Rect rect = this.f15131h;
int i12 = (int) left;
rect.left = i12;
int i13 = (int) right;
rect.right = i13;
if (this.o == 0 && this.B) {
float f14 = this.P;
rect.left = (int) ((left + f14) - 1.0f);
rect.right = (int) ((right - f14) - 1.0f);
}
Rect rect2 = this.i;
rect2.left = i12;
rect2.right = i13;
if (this.f15133u >= i.f36333a) {
float a5 = h.a.a((float) childAt.getWidth(), this.f15133u, 2.0f, (float) childAt.getLeft());
int i14 = this.e;
if (i14 < this.f15130g - 1) {
View childAt3 = this.d.getChildAt(i14 + 1);
a5 += this.f * ((float) ((childAt3.getWidth() / 2) + (childAt.getWidth() / 2)));
}
Rect rect3 = this.f15131h;
int i15 = (int) a5;
rect3.left = i15;
rect3.right = (int) (((float) i15) + this.f15133u);
}
}
}
public int b(float f12) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144833, new Class[]{Float.TYPE}, Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : (int) ((f12 * this.b.getResources().getDisplayMetrics().density) + 0.5f);
}
public void c() {
LinearLayout.LayoutParams layoutParams;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144764, new Class[0], Void.TYPE).isSupported) {
this.d.removeAllViews();
this.f15130g = this.f15129c.getAdapter().getCount();
for (int i3 = 0; i3 < this.f15130g; i3++) {
View inflate = View.inflate(this.b, R.layout.layout_tab, null);
String charSequence = this.f15129c.getAdapter().getPageTitle(i3).toString();
if (!PatchProxy.proxy(new Object[]{new Integer(i3), charSequence, inflate}, this, changeQuickRedirect, false, 144766, new Class[]{Integer.TYPE, String.class, View.class}, Void.TYPE).isSupported) {
TextView textView = (TextView) inflate.findViewById(R.id.tv_tab_title);
if (!(textView == null || charSequence == null)) {
textView.setText(charSequence);
}
inflate.setOnClickListener(new View.OnClickListener() {
/* class com.shizhuang.duapp.modules.feed.circle.view.DuExSlidingTabLayout.AnonymousClass1 */
public static ChangeQuickRedirect changeQuickRedirect;
@SensorsDataInstrumented
public void onClick(View view) {
if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 144835, new Class[]{View.class}, Void.TYPE).isSupported) {
int indexOfChild = DuExSlidingTabLayout.this.d.indexOfChild(view);
if (indexOfChild != -1) {
if (DuExSlidingTabLayout.this.f15129c.getCurrentItem() != indexOfChild) {
OnTabSelectListener onTabSelectListener = DuExSlidingTabLayout.this.R;
if (onTabSelectListener != null) {
onTabSelectListener.onTabSelect(indexOfChild);
}
DuExSlidingTabLayout duExSlidingTabLayout = DuExSlidingTabLayout.this;
if (duExSlidingTabLayout.O) {
duExSlidingTabLayout.f15129c.setCurrentItem(indexOfChild, false);
} else {
duExSlidingTabLayout.f15129c.setCurrentItem(indexOfChild);
}
} else {
OnTabSelectListener onTabSelectListener2 = DuExSlidingTabLayout.this.R;
if (onTabSelectListener2 != null) {
onTabSelectListener2.onTabReselect(indexOfChild);
}
}
}
SensorsDataAutoTrackHelper.trackViewOnClick(view);
}
}
});
if (this.f15132q) {
layoutParams = new LinearLayout.LayoutParams(0, -1, 1.0f);
} else {
layoutParams = new LinearLayout.LayoutParams(-2, -1);
}
if (this.r > i.f36333a) {
layoutParams = new LinearLayout.LayoutParams((int) this.r, -1);
}
this.d.addView(inflate, i3, layoutParams);
}
}
g();
}
}
public final void d() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144771, new Class[0], Void.TYPE).isSupported && this.f15130g > 0) {
int width = (int) (this.f * ((float) this.d.getChildAt(this.e).getWidth()));
int left = this.d.getChildAt(this.e).getLeft() + width;
if (this.e > 0 || width > 0) {
int width2 = left - ((getWidth() / 2) - getPaddingLeft());
a();
Rect rect = this.i;
left = a2.a.c(rect.right, rect.left, 2, width2);
}
if (left != this.N) {
this.N = left;
scrollTo(left, 0);
}
}
}
public int e(float f12) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144834, new Class[]{Float.TYPE}, Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : (int) ((f12 * this.b.getResources().getDisplayMetrics().scaledDensity) + 0.5f);
}
public final void f(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144772, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
int i12 = 0;
while (i12 < this.f15130g) {
View childAt = this.d.getChildAt(i12);
boolean z4 = i12 == i3;
TextView textView = (TextView) childAt.findViewById(R.id.tv_tab_title);
if (textView != null) {
textView.setTextColor(z4 ? this.J : this.K);
if (this.L == 1) {
textView.getPaint().setFakeBoldText(z4);
}
}
i12++;
}
}
}
public final void g() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144767, new Class[0], Void.TYPE).isSupported) {
int i3 = 0;
while (i3 < this.f15130g) {
TextView textView = (TextView) this.d.getChildAt(i3).findViewById(R.id.tv_tab_title);
if (textView != null) {
textView.setTextColor(i3 == this.e ? this.J : this.K);
textView.setTextSize(0, this.I);
float f12 = this.p;
textView.setPadding((int) f12, 0, (int) f12, 0);
if (this.M) {
textView.setText(textView.getText().toString().toUpperCase());
}
int i12 = this.L;
if (i12 == 2) {
textView.getPaint().setFakeBoldText(true);
} else if (i12 == 0) {
textView.getPaint().setFakeBoldText(false);
}
}
i3++;
}
}
}
public int getCurrentTab() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144801, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.e;
}
public int getDividerColor() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144816, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.F;
}
public float getDividerPadding() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144818, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.H;
}
public float getDividerWidth() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144817, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.G;
}
public int getIndicatorColor() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144806, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.s;
}
public float getIndicatorCornerRadius() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144809, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.f15134v;
}
public float getIndicatorHeight() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144807, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.t;
}
public float getIndicatorMarginBottom() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144813, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.z;
}
public float getIndicatorMarginLeft() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144810, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.w;
}
public float getIndicatorMarginRight() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144812, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.y;
}
public float getIndicatorMarginTop() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144811, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.x;
}
public int getIndicatorStyle() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144802, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.o;
}
public float getIndicatorWidth() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144808, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.f15133u;
}
public int getTabCount() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144800, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.f15130g;
}
public float getTabPadding() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144803, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.p;
}
public float getTabWidth() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144805, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.r;
}
public int getTextBold() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144822, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.L;
}
public int getTextSelectColor() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144820, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.J;
}
public int getTextUnselectColor() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144821, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.K;
}
public float getTextsize() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144819, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.I;
}
public int getUnderlineColor() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144814, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.C;
}
public float getUnderlineHeight() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144815, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.D;
}
public void onDraw(Canvas canvas) {
if (!PatchProxy.proxy(new Object[]{canvas}, this, changeQuickRedirect, false, 144774, new Class[]{Canvas.class}, Void.TYPE).isSupported) {
super.onDraw(canvas);
if (!isInEditMode() && this.f15130g > 0) {
int height = getHeight();
int paddingLeft = getPaddingLeft();
float f12 = this.G;
if (f12 > i.f36333a) {
this.l.setStrokeWidth(f12);
this.l.setColor(this.F);
for (int i3 = 0; i3 < this.f15130g - 1; i3++) {
View childAt = this.d.getChildAt(i3);
canvas.drawLine((float) (childAt.getRight() + paddingLeft), this.H, (float) (childAt.getRight() + paddingLeft), ((float) height) - this.H, this.l);
}
}
if (this.D > i.f36333a) {
this.k.setColor(this.C);
if (this.E == 80) {
float f13 = (float) height;
canvas.drawRect((float) paddingLeft, f13 - this.D, (float) (this.d.getWidth() + paddingLeft), f13, this.k);
} else {
canvas.drawRect((float) paddingLeft, i.f36333a, (float) (this.d.getWidth() + paddingLeft), this.D, this.k);
}
}
a();
int i12 = this.o;
if (i12 == 1) {
if (this.t > i.f36333a) {
this.m.setColor(this.s);
this.n.reset();
float f14 = (float) height;
this.n.moveTo((float) (this.f15131h.left + paddingLeft), f14);
Path path = this.n;
Rect rect = this.f15131h;
path.lineTo((float) ((rect.right / 2) + (rect.left / 2) + paddingLeft), f14 - this.t);
this.n.lineTo((float) (paddingLeft + this.f15131h.right), f14);
this.n.close();
canvas.drawPath(this.n, this.m);
}
} else if (i12 == 2) {
if (this.t < i.f36333a) {
this.t = (((float) height) - this.x) - this.z;
}
float f15 = this.t;
if (f15 > i.f36333a) {
float f16 = this.f15134v;
if (f16 < i.f36333a || f16 > f15 / 2.0f) {
this.f15134v = f15 / 2.0f;
}
this.j.setColor(this.s);
GradientDrawable gradientDrawable = this.j;
Rect rect2 = this.f15131h;
int i13 = ((int) this.w) + paddingLeft + rect2.left;
float f17 = this.x;
gradientDrawable.setBounds(i13, (int) f17, (int) (((float) (paddingLeft + rect2.right)) - this.y), (int) (f17 + this.t));
this.j.setCornerRadius(this.f15134v);
this.j.draw(canvas);
}
} else if (this.t > i.f36333a) {
this.j.setColor(this.s);
if (this.A == 80) {
GradientDrawable gradientDrawable2 = this.j;
Rect rect3 = this.f15131h;
float f18 = this.z;
gradientDrawable2.setBounds(((int) this.w) + paddingLeft + rect3.left, (height - ((int) this.t)) - ((int) f18), (paddingLeft + rect3.right) - ((int) this.y), height - ((int) f18));
} else {
GradientDrawable gradientDrawable3 = this.j;
Rect rect4 = this.f15131h;
int i14 = ((int) this.w) + paddingLeft + rect4.left;
float f19 = this.x;
gradientDrawable3.setBounds(i14, (int) f19, (paddingLeft + rect4.right) - ((int) this.y), ((int) this.t) + ((int) f19));
}
this.j.setCornerRadius(this.f15134v);
this.j.draw(canvas);
}
}
}
}
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
public void onPageScrollStateChanged(int i3) {
boolean z4 = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144770, new Class[]{Integer.TYPE}, Void.TYPE).isSupported;
}
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
public void onPageScrolled(int i3, float f12, int i12) {
Object[] objArr = {new Integer(i3), new Float(f12), new Integer(i12)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Integer.TYPE;
if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 144768, new Class[]{cls, Float.TYPE, cls}, Void.TYPE).isSupported) {
this.e = i3;
this.f = f12;
d();
invalidate();
}
}
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
public void onPageSelected(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144769, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
f(i3);
}
}
public void onRestoreInstanceState(Parcelable parcelable) {
if (!PatchProxy.proxy(new Object[]{parcelable}, this, changeQuickRedirect, false, 144832, new Class[]{Parcelable.class}, Void.TYPE).isSupported) {
if (parcelable instanceof Bundle) {
Bundle bundle = (Bundle) parcelable;
this.e = bundle.getInt("mCurrentTab");
parcelable = bundle.getParcelable("instanceState");
if (this.e != 0 && this.d.getChildCount() > 0) {
f(this.e);
d();
}
}
super.onRestoreInstanceState(parcelable);
}
}
public Parcelable onSaveInstanceState() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 144831, new Class[0], Parcelable.class);
if (proxy.isSupported) {
return (Parcelable) proxy.result;
}
Bundle bundle = new Bundle();
bundle.putParcelable("instanceState", super.onSaveInstanceState());
bundle.putInt("mCurrentTab", this.e);
return bundle;
}
public void setCurrentTab(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144775, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.e = i3;
this.f15129c.setCurrentItem(i3);
}
}
public void setDividerColor(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144791, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.F = i3;
invalidate();
}
}
public void setDividerPadding(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144793, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.H = (float) b(f12);
invalidate();
}
}
public void setDividerWidth(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144792, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.G = (float) b(f12);
invalidate();
}
}
public void setIndicatorColor(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144781, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.s = i3;
invalidate();
}
}
public void setIndicatorCornerRadius(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144784, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.f15134v = (float) b(f12);
invalidate();
}
}
public void setIndicatorGravity(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144785, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.A = i3;
invalidate();
}
}
public void setIndicatorHeight(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144782, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.t = (float) b(f12);
invalidate();
}
}
public void setIndicatorStyle(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144777, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.o = i3;
invalidate();
}
}
public void setIndicatorWidth(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144783, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.f15133u = (float) b(f12);
invalidate();
}
}
public void setIndicatorWidthEqualTitle(boolean z4) {
if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 144787, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
this.B = z4;
invalidate();
}
}
public void setOnTabSelectListener(OnTabSelectListener onTabSelectListener) {
if (!PatchProxy.proxy(new Object[]{onTabSelectListener}, this, changeQuickRedirect, false, 144830, new Class[]{OnTabSelectListener.class}, Void.TYPE).isSupported) {
this.R = onTabSelectListener;
}
}
public void setSnapOnTabClick(boolean z4) {
if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 144799, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
this.O = z4;
}
}
public void setTabPadding(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144778, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.p = (float) b(f12);
g();
}
}
public void setTabSpaceEqual(boolean z4) {
if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 144779, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
this.f15132q = z4;
g();
}
}
public void setTabWidth(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144780, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.r = (float) b(f12);
g();
}
}
public void setTextAllCaps(boolean z4) {
if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 144798, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
this.M = z4;
g();
}
}
public void setTextBold(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144797, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.L = i3;
g();
}
}
public void setTextSelectColor(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144795, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.J = i3;
g();
}
}
public void setTextUnselectColor(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144796, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.K = i3;
g();
}
}
public void setTextsize(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144794, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.I = (float) e(f12);
g();
}
}
public void setUnderlineColor(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144788, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.C = i3;
invalidate();
}
}
public void setUnderlineGravity(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 144790, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.E = i3;
invalidate();
}
}
public void setUnderlineHeight(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 144789, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.D = (float) b(f12);
invalidate();
}
}
public void setViewPager(ViewPager viewPager) {
if (!PatchProxy.proxy(new Object[]{viewPager}, this, changeQuickRedirect, false, 144761, new Class[]{ViewPager.class}, Void.TYPE).isSupported) {
if (viewPager == null || viewPager.getAdapter() == null) {
throw new IllegalStateException("ViewPager or ViewPager adapter can not be NULL !");
}
this.f15129c = viewPager;
viewPager.removeOnPageChangeListener(this);
this.f15129c.addOnPageChangeListener(this);
c();
}
}
public DuExSlidingTabLayout(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public DuExSlidingTabLayout(Context context, AttributeSet attributeSet, int i3) {
super(context, attributeSet, i3);
float f12;
this.f15131h = new Rect();
this.i = new Rect();
this.j = new GradientDrawable();
this.k = new Paint(1);
this.l = new Paint(1);
this.m = new Paint(1);
this.n = new Path();
this.o = 0;
this.Q = new Paint(1);
new SparseArray();
setFillViewport(true);
setWillNotDraw(false);
setClipChildren(false);
setClipToPadding(false);
this.b = context;
LinearLayout linearLayout = new LinearLayout(context);
this.d = linearLayout;
addView(linearLayout);
if (!PatchProxy.proxy(new Object[]{context, attributeSet}, this, changeQuickRedirect, false, 144760, new Class[]{Context.class, AttributeSet.class}, Void.TYPE).isSupported) {
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, new int[]{R.attr.indicatorColor, R.attr.indicatorDrawable, R.attr.indicatorHeight, R.attr.indicatorLeftMargin, R.attr.indicatorRightMargin, R.attr.indicatorWidth, R.attr.tl_divider_color, R.attr.tl_divider_padding, R.attr.tl_divider_width, R.attr.tl_indicator_color, R.attr.tl_indicator_corner_radius, R.attr.tl_indicator_gravity, R.attr.tl_indicator_height, R.attr.tl_indicator_margin_bottom, R.attr.tl_indicator_margin_left, R.attr.tl_indicator_margin_right, R.attr.tl_indicator_margin_top, R.attr.tl_indicator_style, R.attr.tl_indicator_width, R.attr.tl_indicator_width_equal_title, R.attr.tl_tab_padding, R.attr.tl_tab_space_equal, R.attr.tl_tab_width, R.attr.tl_textAllCaps, R.attr.tl_textBold, R.attr.tl_textSelectColor, R.attr.tl_textUnselectColor, R.attr.tl_textsize, R.attr.tl_underline_color, R.attr.tl_underline_gravity, R.attr.tl_underline_height});
int i12 = obtainStyledAttributes.getInt(17, 0);
this.o = i12;
this.s = obtainStyledAttributes.getColor(9, Color.parseColor(i12 == 2 ? "#4B6A87" : "#ffffff"));
int i13 = this.o;
if (i13 == 1) {
f12 = 4.0f;
} else {
f12 = (float) (i13 == 2 ? -1 : 2);
}
this.t = obtainStyledAttributes.getDimension(12, (float) b(f12));
this.f15133u = obtainStyledAttributes.getDimension(18, (float) b(this.o == 1 ? 10.0f : -1.0f));
this.f15134v = obtainStyledAttributes.getDimension(10, (float) b(this.o == 2 ? -1.0f : i.f36333a));
this.w = obtainStyledAttributes.getDimension(14, (float) b(i.f36333a));
float f13 = 7.0f;
this.x = obtainStyledAttributes.getDimension(16, (float) b(this.o == 2 ? 7.0f : i.f36333a));
this.y = obtainStyledAttributes.getDimension(15, (float) b(i.f36333a));
this.z = obtainStyledAttributes.getDimension(13, (float) b(this.o != 2 ? i.f36333a : f13));
this.A = obtainStyledAttributes.getInt(11, 80);
this.B = obtainStyledAttributes.getBoolean(19, false);
this.C = obtainStyledAttributes.getColor(28, Color.parseColor("#ffffff"));
this.D = obtainStyledAttributes.getDimension(30, (float) b(i.f36333a));
this.E = obtainStyledAttributes.getInt(29, 80);
this.F = obtainStyledAttributes.getColor(6, Color.parseColor("#ffffff"));
this.G = obtainStyledAttributes.getDimension(8, (float) b(i.f36333a));
this.H = obtainStyledAttributes.getDimension(7, (float) b(12.0f));
this.I = obtainStyledAttributes.getDimension(27, (float) e(14.0f));
this.J = obtainStyledAttributes.getColor(25, Color.parseColor("#ffffff"));
this.K = obtainStyledAttributes.getColor(26, Color.parseColor("#AAffffff"));
this.L = obtainStyledAttributes.getInt(24, 0);
this.M = obtainStyledAttributes.getBoolean(23, false);
this.f15132q = obtainStyledAttributes.getBoolean(21, false);
float dimension = obtainStyledAttributes.getDimension(22, (float) b(-1.0f));
this.r = dimension;
this.p = obtainStyledAttributes.getDimension(20, (float) ((this.f15132q || dimension > i.f36333a) ? b(i.f36333a) : b(20.0f)));
obtainStyledAttributes.recycle();
}
String attributeValue = attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "layout_height");
if (!attributeValue.equals("-1") && !attributeValue.equals("-2")) {
TypedArray obtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, new int[]{16842997});
obtainStyledAttributes2.getDimensionPixelSize(0, -2);
obtainStyledAttributes2.recycle();
}
}
}