得物.apk(点击下载) / CommunityExSlidingTab.java
package com.shizhuang.duapp.modules.community.attention.view;
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.util.AttributeSet;
import android.view.View;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
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 java.util.ArrayList;
import java.util.List;
import o5.i;
import uy.a;
import uy.b;
public class CommunityExSlidingTab 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 int M;
public boolean N;
public final List<b> O;
public a P;
public OnTabSelectListener Q;
public ViewPager.OnPageChangeListener R;
public OnScrollChanged S;
public float T;
public Context b;
/* renamed from: c reason: collision with root package name */
public ViewPager f11588c;
public LinearLayout d;
public int e;
public float f;
/* renamed from: g reason: collision with root package name */
public int f11589g;
/* renamed from: h reason: collision with root package name */
public Rect f11590h;
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 f11591q;
public float r;
public int s;
public float t;
/* renamed from: u reason: collision with root package name */
public float f11592u;
/* renamed from: v reason: collision with root package name */
public float f11593v;
public float w;
public float x;
public float y;
public float z;
public interface OnScrollChanged {
void onScroll(int i, int i3, int i12, int i13);
}
public CommunityExSlidingTab(Context context) {
this(context, null, 0);
}
public final void a() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 77991, 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) {
a aVar = this.P;
this.T = ((right - left) - (aVar != null ? (float) aVar.a(this.O.get(this.e)) : i.f36333a)) / 2.0f;
}
int i3 = this.e;
if (i3 < this.f11589g - 1) {
View childAt2 = this.d.getChildAt(i3 + 1);
float left2 = (float) childAt2.getLeft();
float right2 = (float) childAt2.getRight();
float f12 = this.f;
left = a1.a.b(left2, left, f12, left);
right = a1.a.b(right2, right, f12, right);
if (this.o == 0 && this.B) {
a aVar2 = this.P;
float a5 = aVar2 != null ? (float) aVar2.a(this.O.get(this.e)) : i.f36333a;
float f13 = this.T;
this.T = a1.a.b(((right2 - left2) - a5) / 2.0f, f13, this.f, f13);
}
}
Rect rect = this.f11590h;
int i12 = (int) left;
rect.left = i12;
int i13 = (int) right;
rect.right = i13;
if (this.o == 0 && this.B) {
float f14 = this.T;
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.f11592u >= i.f36333a) {
float a12 = h.a.a((float) childAt.getWidth(), this.f11592u, 2.0f, (float) childAt.getLeft());
int i14 = this.e;
if (i14 < this.f11589g - 1) {
a12 += this.f * ((float) ((this.d.getChildAt(i14 + 1).getWidth() / 2) + (childAt.getWidth() / 2)));
}
Rect rect3 = this.f11590h;
int i15 = (int) a12;
rect3.left = i15;
rect3.right = (int) (((float) i15) + this.f11592u);
}
}
}
public int b(float f12) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 78046, new Class[]{Float.TYPE}, Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : (int) ((f12 * this.b.getResources().getDisplayMetrics().density) + 0.5f);
}
@Nullable
public b c(int i3) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 77981, new Class[]{Integer.TYPE}, b.class);
if (proxy.isSupported) {
return (b) proxy.result;
}
if (i3 >= 0 && !this.O.isEmpty() && i3 < this.O.size()) {
return this.O.get(i3);
}
return null;
}
public void d() {
LinearLayout.LayoutParams layoutParams;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 77984, new Class[0], Void.TYPE).isSupported) {
this.O.clear();
this.d.removeAllViews();
a aVar = this.P;
if (aVar != null) {
this.f11589g = aVar.b();
for (int i3 = 0; i3 < this.f11589g; i3++) {
a aVar2 = this.P;
b e6 = aVar2.e(this.d, aVar2.c(i3));
this.O.add(e6);
View view = e6.f39098a;
if (!PatchProxy.proxy(new Object[]{new Integer(i3), view, e6}, this, changeQuickRedirect, false, 77985, new Class[]{Integer.TYPE, View.class, b.class}, Void.TYPE).isSupported) {
view.setOnClickListener(new View.OnClickListener() {
/* class com.shizhuang.duapp.modules.community.attention.view.CommunityExSlidingTab.AnonymousClass1 */
public static ChangeQuickRedirect changeQuickRedirect;
@SensorsDataInstrumented
public void onClick(View view) {
if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 78048, new Class[]{View.class}, Void.TYPE).isSupported) {
int indexOfChild = CommunityExSlidingTab.this.d.indexOfChild(view);
if (indexOfChild < 0) {
SensorsDataAutoTrackHelper.trackViewOnClick(view);
} else if (indexOfChild == CommunityExSlidingTab.this.f11588c.getCurrentItem()) {
SensorsDataAutoTrackHelper.trackViewOnClick(view);
} else {
OnTabSelectListener onTabSelectListener = CommunityExSlidingTab.this.Q;
if (onTabSelectListener != null) {
onTabSelectListener.onTabSelect(indexOfChild);
}
CommunityExSlidingTab communityExSlidingTab = CommunityExSlidingTab.this;
if (communityExSlidingTab.N) {
communityExSlidingTab.f11588c.setCurrentItem(indexOfChild, false);
} else {
communityExSlidingTab.f11588c.setCurrentItem(indexOfChild);
}
SensorsDataAutoTrackHelper.trackViewOnClick(view);
}
}
}
});
if (this.f11591q) {
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(view, i3, layoutParams);
}
this.P.d(e6, i3);
if (i3 == 0) {
this.P.f(e6, true);
}
}
}
}
}
public void dispatchDraw(Canvas canvas) {
if (!PatchProxy.proxy(new Object[]{canvas}, this, changeQuickRedirect, false, 77992, new Class[]{Canvas.class}, Void.TYPE).isSupported) {
super.dispatchDraw(canvas);
if (!isInEditMode() && this.f11589g > 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.f11589g - 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.f11590h.left + paddingLeft), f14);
Path path = this.n;
Rect rect = this.f11590h;
path.lineTo((float) ((rect.right / 2) + (rect.left / 2) + paddingLeft), f14 - this.t);
this.n.lineTo((float) (paddingLeft + this.f11590h.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.f11593v;
if (f16 < i.f36333a || f16 > f15 / 2.0f) {
this.f11593v = f15 / 2.0f;
}
this.j.setColor(this.s);
GradientDrawable gradientDrawable = this.j;
Rect rect2 = this.f11590h;
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.f11593v);
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.f11590h;
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.f11590h;
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.f11593v);
this.j.draw(canvas);
}
}
}
}
public int e(float f12) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 78047, new Class[]{Float.TYPE}, Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : (int) ((f12 * this.b.getResources().getDisplayMetrics().scaledDensity) + 0.5f);
}
public void f(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 77990, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
int i12 = 0;
while (i12 < this.f11589g) {
boolean z4 = i12 == i3;
a aVar = this.P;
if (aVar != null) {
aVar.f(this.O.get(i12), z4);
}
i12++;
}
}
}
public int getCurrentTab() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 78021, 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, 78036, 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, 78038, 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, 78037, 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, 78026, 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, 78029, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.f11593v;
}
public float getIndicatorHeight() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 78027, 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, 78033, 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, 78030, 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, 78032, 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, 78031, 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, 78022, 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, 78028, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.f11592u;
}
public int getTabCount() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 78020, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.f11589g;
}
public float getTabPadding() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 78023, 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, 78025, 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, 78042, 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, 78040, 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, 78041, 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, 78039, 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, 78034, 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, 78035, new Class[0], Float.TYPE);
return proxy.isSupported ? ((Float) proxy.result).floatValue() : this.D;
}
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
public void onPageScrollStateChanged(int i3) {
ViewPager.OnPageChangeListener onPageChangeListener;
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 77988, new Class[]{Integer.TYPE}, Void.TYPE).isSupported && (onPageChangeListener = this.R) != null) {
onPageChangeListener.onPageScrollStateChanged(i3);
}
}
@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, 77986, new Class[]{cls, Float.TYPE, cls}, Void.TYPE).isSupported) {
this.e = i3;
this.f = f12;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 77989, new Class[0], Void.TYPE).isSupported && this.f11589g > 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.M) {
this.M = left;
scrollTo(left, 0);
}
}
invalidate();
ViewPager.OnPageChangeListener onPageChangeListener = this.R;
if (onPageChangeListener != null) {
onPageChangeListener.onPageScrolled(i3, f12, i12);
}
}
}
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
public void onPageSelected(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 77987, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
f(i3);
ViewPager.OnPageChangeListener onPageChangeListener = this.R;
if (onPageChangeListener != null) {
onPageChangeListener.onPageSelected(i3);
}
}
}
public void onScrollChanged(int i3, int i12, int i13, int i14) {
Object[] objArr = {new Integer(i3), new Integer(i12), new Integer(i13), new Integer(i14)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Integer.TYPE;
if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 77993, new Class[]{cls, cls, cls, cls}, Void.TYPE).isSupported) {
super.onScrollChanged(i3, i12, i13, i14);
OnScrollChanged onScrollChanged = this.S;
if (onScrollChanged != null) {
onScrollChanged.onScroll(i3, i12, i13, i14);
}
}
}
public void setAdapter(a aVar) {
if (!PatchProxy.proxy(new Object[]{aVar}, this, changeQuickRedirect, false, 77982, new Class[]{a.class}, Void.TYPE).isSupported) {
this.P = aVar;
}
}
public void setCurrentTab(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 77995, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.e = i3;
this.f11588c.setCurrentItem(i3);
}
}
public void setDividerColor(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 78011, 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, 78013, 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, 78012, 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, 78001, 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, 78004, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.f11593v = (float) b(f12);
invalidate();
}
}
public void setIndicatorGravity(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 78005, 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, 78002, 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, 77997, 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, 78003, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.f11592u = (float) b(f12);
invalidate();
}
}
public void setIndicatorWidthEqualTitle(boolean z4) {
if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 78007, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
this.B = z4;
invalidate();
}
}
public void setOnPageChangeListener(ViewPager.OnPageChangeListener onPageChangeListener) {
if (!PatchProxy.proxy(new Object[]{onPageChangeListener}, this, changeQuickRedirect, false, 78045, new Class[]{ViewPager.OnPageChangeListener.class}, Void.TYPE).isSupported) {
this.R = onPageChangeListener;
}
}
public void setOnScrollChangedListener(OnScrollChanged onScrollChanged) {
if (!PatchProxy.proxy(new Object[]{onScrollChanged}, this, changeQuickRedirect, false, 77994, new Class[]{OnScrollChanged.class}, Void.TYPE).isSupported) {
this.S = onScrollChanged;
}
}
public void setOnTabSelectListener(OnTabSelectListener onTabSelectListener) {
if (!PatchProxy.proxy(new Object[]{onTabSelectListener}, this, changeQuickRedirect, false, 78044, new Class[]{OnTabSelectListener.class}, Void.TYPE).isSupported) {
this.Q = onTabSelectListener;
}
}
public void setSnapOnTabClick(boolean z4) {
if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 78019, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
this.N = z4;
}
}
public void setTabPadding(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 77998, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.p = (float) b(f12);
}
}
public void setTabSpaceEqual(boolean z4) {
if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 77999, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
this.f11591q = z4;
}
}
public void setTabWidth(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 78000, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.r = (float) b(f12);
}
}
public void setTextAllCaps(boolean z4) {
boolean z5 = PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 78018, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported;
}
public void setTextBold(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 78017, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.L = i3;
}
}
public void setTextSelectColor(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 78015, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.J = i3;
}
}
public void setTextUnselectColor(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 78016, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.K = i3;
}
}
public void setTextsize(float f12) {
if (!PatchProxy.proxy(new Object[]{new Float(f12)}, this, changeQuickRedirect, false, 78014, new Class[]{Float.TYPE}, Void.TYPE).isSupported) {
this.I = (float) e(f12);
}
}
public void setUnderlineColor(int i3) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 78008, 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, 78010, 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, 78009, 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, 77983, 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.f11588c = viewPager;
viewPager.removeOnPageChangeListener(this);
this.f11588c.addOnPageChangeListener(this);
d();
}
}
public CommunityExSlidingTab(Context context, AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public CommunityExSlidingTab(Context context, AttributeSet attributeSet, int i3) {
super(context, attributeSet, i3);
float f12;
this.f11590h = 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.O = new ArrayList();
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, 77980, 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.f11592u = obtainStyledAttributes.getDimension(18, (float) b(this.o == 1 ? 10.0f : -1.0f));
this.f11593v = 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);
obtainStyledAttributes.getBoolean(23, false);
this.f11591q = obtainStyledAttributes.getBoolean(21, false);
float dimension = obtainStyledAttributes.getDimension(22, (float) b(-1.0f));
this.r = dimension;
this.p = obtainStyledAttributes.getDimension(20, (float) ((this.f11591q || 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();
}
}
}