package com.google.android.material.bottomsheet; import android.R; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; import android.util.Base64; import android.util.SparseIntArray; import android.util.TypedValue; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.ViewParent; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.view.ViewCompat; import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; import androidx.core.view.accessibility.AccessibilityViewCommand; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import java.lang.ref.WeakReference; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import o.C14739fyr; import o.C17052tZT; import o.C17525xWe; import o.C4363bXv; import o.FLD; import o.Lot; import o.OSb; import o.Tur; import o.XgG; import org.bouncycastle.asn1.cmp.PKIFailureInfo; /* loaded from: classes2.dex */ public class BottomSheetBehavior extends CoordinatorLayout.Sts { private static final int C; private static int ai = 0; private static byte aj = 0; private static int ak = 1; private WeakReference A; OSb B; private ColorStateList D; private int E; private SparseIntArray F; private float G; private final OSb.IeS H; private boolean I; private float J; private boolean K; private int L; private boolean M; private float N; private ValueAnimator O; private int P; private int Q; private Map R; private int S; private boolean T; private float U; private int V; private boolean W; private int X; private int Y; private int Z; boolean a; private boolean aa; private int ab; private int ac; private FLD ad; private boolean ae; private final BottomSheetBehavior.IeS af; private VelocityTracker ag; private boolean ah; public final ArrayList b; int c; boolean d; int e; int f; boolean g; int h; int i; int j; boolean k; boolean l; int m; boolean n; /* renamed from: o, reason: collision with root package name */ public C4363bXv f6468o; boolean p; boolean q; int r; WeakReference s; boolean t; boolean u; boolean v; int w; int x; public int y; WeakReference z; /* loaded from: classes2.dex */ public static abstract class LWm { public abstract void a(View view, int i); protected void b(View view) { } public abstract void d(View view); } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final void a(CoordinatorLayout coordinatorLayout, V v, View view, int i, int i2, int i3, int i4, int i5, int[] iArr) { } private void al(String str, Object[] objArr) { byte[] decode = Base64.decode(str, 0); byte[] bArr = new byte[decode.length]; for (int i = 0; i < decode.length; i++) { bArr[i] = (byte) (decode[(decode.length - i) - 1] ^ aj); } objArr[0] = new String(bArr, StandardCharsets.UTF_8); } static { c(); C = C17052tZT.NHB.Widget_Design_BottomSheet_Modal; } public BottomSheetBehavior() { this.ab = 0; this.d = true; this.ah = false; this.X = -1; this.V = -1; this.af = new IeS(this, (byte) 0); this.J = 0.5f; this.G = -1.0f; this.a = true; this.y = 4; this.Q = 4; this.N = 0.1f; this.b = new ArrayList<>(); this.F = new SparseIntArray(); this.H = new OSb.IeS(this) { // from class: com.google.android.material.bottomsheet.BottomSheetBehavior.1 private long d; private BottomSheetBehavior e; { this.e = this; } @Override // o.OSb.IeS public final boolean c(View view, int i) { if (this.e.y == 1 || this.e.u) { return false; } if (this.e.y == 3 && this.e.c == i) { View view2 = this.e.s != null ? this.e.s.get() : null; if (view2 != null && view2.canScrollVertically(-1)) { return false; } } this.d = System.currentTimeMillis(); return this.e.z != null && this.e.z.get() == view; } @Override // o.OSb.IeS public final void c(View view, int i, int i2) { this.e.c(i2); } @Override // o.OSb.IeS public final int e(View view, int i) { int i2; int a = this.e.a(); if (this.e.g) { i2 = this.e.r; } else { i2 = this.e.e; } return i < a ? a : i > i2 ? i2 : i; } @Override // o.OSb.IeS public final int b(View view, int i) { return view.getLeft(); } @Override // o.OSb.IeS public final int d() { if (this.e.g) { return this.e.r; } return this.e.e; } @Override // o.OSb.IeS public final void b(int i) { if (i == 1 && this.e.a) { this.e.e(1); } } /* JADX WARN: Code restructure failed: missing block: B:26:0x0074, code lost: if (java.lang.Math.abs(r3.getTop() - r2.e.a()) >= java.lang.Math.abs(r3.getTop() - r2.e.j)) goto L49; */ /* JADX WARN: Code restructure failed: missing block: B:34:0x00a5, code lost: if (java.lang.Math.abs(r4 - r2.e.j) < java.lang.Math.abs(r4 - r2.e.e)) goto L49; */ /* JADX WARN: Code restructure failed: missing block: B:39:0x00c5, code lost: if (java.lang.Math.abs(r4 - r2.e.f) < java.lang.Math.abs(r4 - r2.e.e)) goto L46; */ /* JADX WARN: Code restructure failed: missing block: B:43:0x00d8, code lost: if (r4 >= java.lang.Math.abs(r4 - r2.e.e)) goto L49; */ /* JADX WARN: Code restructure failed: missing block: B:45:0x00f0, code lost: if (java.lang.Math.abs(r4 - r2.e.j) < java.lang.Math.abs(r4 - r2.e.e)) goto L49; */ /* JADX WARN: Code restructure failed: missing block: B:6:0x0015, code lost: if (r3.getTop() <= r2.e.j) goto L46; */ @Override // o.OSb.IeS /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void c(android.view.View r3, float r4, float r5) { /* Method dump skipped, instructions count: 252 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.bottomsheet.BottomSheetBehavior.AnonymousClass1.c(android.view.View, float, float):void"); } }; } public BottomSheetBehavior(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.ab = 0; this.d = true; this.ah = false; this.X = -1; this.V = -1; this.af = new IeS(this, (byte) 0); this.J = 0.5f; this.G = -1.0f; this.a = true; this.y = 4; this.Q = 4; this.N = 0.1f; this.b = new ArrayList<>(); this.F = new SparseIntArray(); this.H = new OSb.IeS(this) { // from class: com.google.android.material.bottomsheet.BottomSheetBehavior.1 private long d; private BottomSheetBehavior e; { this.e = this; } @Override // o.OSb.IeS public final boolean c(View view, int i) { if (this.e.y == 1 || this.e.u) { return false; } if (this.e.y == 3 && this.e.c == i) { View view2 = this.e.s != null ? this.e.s.get() : null; if (view2 != null && view2.canScrollVertically(-1)) { return false; } } this.d = System.currentTimeMillis(); return this.e.z != null && this.e.z.get() == view; } @Override // o.OSb.IeS public final void c(View view, int i, int i2) { this.e.c(i2); } @Override // o.OSb.IeS public final int e(View view, int i) { int i2; int a = this.e.a(); if (this.e.g) { i2 = this.e.r; } else { i2 = this.e.e; } return i < a ? a : i > i2 ? i2 : i; } @Override // o.OSb.IeS public final int b(View view, int i) { return view.getLeft(); } @Override // o.OSb.IeS public final int d() { if (this.e.g) { return this.e.r; } return this.e.e; } @Override // o.OSb.IeS public final void b(int i) { if (i == 1 && this.e.a) { this.e.e(1); } } @Override // o.OSb.IeS public final void c(View view, float f, float f2) { /* JADX ERROR: Method code generation error java.lang.NullPointerException: Cannot invoke "jadx.core.dex.nodes.IContainer.get(jadx.api.plugins.input.data.attributes.IJadxAttrType)" because "cont" is null at jadx.core.codegen.RegionGen.declareVars(RegionGen.java:70) at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65) at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:297) at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:276) at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:406) at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:335) at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$3(ClassGen.java:301) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.base/java.util.ArrayList.forEach(ArrayList.java:1597) at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395) at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261) */ /* Method dump skipped, instructions count: 252 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.bottomsheet.BottomSheetBehavior.AnonymousClass1.c(android.view.View, float, float):void"); } }; this.ac = context.getResources().getDimensionPixelSize(C17052tZT.HBt.mtrl_min_touch_target_size); TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C17052tZT.jNh.BottomSheetBehavior_Layout); if (obtainStyledAttributes.hasValue(C17052tZT.jNh.BottomSheetBehavior_Layout_backgroundTint)) { this.D = C14739fyr.Ku_(context, obtainStyledAttributes, C17052tZT.jNh.BottomSheetBehavior_Layout_backgroundTint); } if (obtainStyledAttributes.hasValue(C17052tZT.jNh.BottomSheetBehavior_Layout_shapeAppearance)) { this.ad = new FLD(FLD.Ll_(context, attributeSet, C17052tZT.IeS.bottomSheetStyle, C, new C17525xWe(BitmapDescriptorFactory.HUE_RED)), (byte) 0); } if (this.ad != null) { C4363bXv c4363bXv = new C4363bXv(this.ad); this.f6468o = c4363bXv; c4363bXv.d(context); ColorStateList colorStateList = this.D; if (colorStateList != null) { C4363bXv c4363bXv2 = this.f6468o; if (c4363bXv2.B.d != colorStateList) { c4363bXv2.B.d = colorStateList; c4363bXv2.onStateChange(c4363bXv2.getState()); } } else { TypedValue typedValue = new TypedValue(); context.getTheme().resolveAttribute(R.attr.colorBackground, typedValue, true); this.f6468o.setTint(typedValue.data); } } ValueAnimator ofFloat = ValueAnimator.ofFloat(BitmapDescriptorFactory.HUE_RED, 1.0f); this.O = ofFloat; ofFloat.setDuration(500L); this.O.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(this) { // from class: com.google.android.material.bottomsheet.BottomSheetBehavior.3 private BottomSheetBehavior e; { this.e = this; } @Override // android.animation.ValueAnimator.AnimatorUpdateListener public final void onAnimationUpdate(ValueAnimator valueAnimator) { float floatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue(); if (this.e.f6468o != null) { C4363bXv c4363bXv3 = this.e.f6468o; if (c4363bXv3.B.h != floatValue) { c4363bXv3.B.h = floatValue; c4363bXv3.H = true; c4363bXv3.invalidateSelf(); } } } }); this.G = obtainStyledAttributes.getDimension(C17052tZT.jNh.BottomSheetBehavior_Layout_android_elevation, -1.0f); if (obtainStyledAttributes.hasValue(C17052tZT.jNh.BottomSheetBehavior_Layout_android_maxWidth)) { this.X = obtainStyledAttributes.getDimensionPixelSize(C17052tZT.jNh.BottomSheetBehavior_Layout_android_maxWidth, -1); } if (obtainStyledAttributes.hasValue(C17052tZT.jNh.BottomSheetBehavior_Layout_android_maxHeight)) { this.V = obtainStyledAttributes.getDimensionPixelSize(C17052tZT.jNh.BottomSheetBehavior_Layout_android_maxHeight, -1); } TypedValue peekValue = obtainStyledAttributes.peekValue(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_peekHeight); if (peekValue != null && peekValue.data == -1) { b(peekValue.data); } else { b(obtainStyledAttributes.getDimensionPixelSize(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_peekHeight, -1)); } a(obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_hideable, false)); this.K = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_gestureInsetBottomIgnored, false); boolean z = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_fitToContents, true); if (this.d != z) { this.d = z; if (this.z != null) { b(); } e((this.d && this.y == 6) ? 3 : this.y); a(this.y, true); WeakReference weakReference = this.z; if (weakReference != null) { d(weakReference.get()); } } this.v = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_skipCollapsed, false); this.a = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_draggable, true); this.ab = obtainStyledAttributes.getInt(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_saveFlags, 0); float f = obtainStyledAttributes.getFloat(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_halfExpandedRatio, 0.5f); if (f > BitmapDescriptorFactory.HUE_RED && f < 1.0f) { this.J = f; if (this.z != null) { this.j = (int) (this.r * (1.0f - f)); } TypedValue peekValue2 = obtainStyledAttributes.peekValue(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_expandedOffset); if (peekValue2 != null && peekValue2.type == 16) { int i = peekValue2.data; if (i < 0) { throw new IllegalArgumentException("offset must be greater than or equal to 0"); } this.L = i; a(this.y, true); } else { int dimensionPixelOffset = obtainStyledAttributes.getDimensionPixelOffset(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_expandedOffset, 0); if (dimensionPixelOffset >= 0) { this.L = dimensionPixelOffset; a(this.y, true); } else { throw new IllegalArgumentException("offset must be greater than or equal to 0"); } } this.x = obtainStyledAttributes.getInt(C17052tZT.jNh.BottomSheetBehavior_Layout_behavior_significantVelocityThreshold, 500); this.t = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_paddingBottomSystemWindowInsets, false); this.q = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_paddingLeftSystemWindowInsets, false); this.p = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_paddingRightSystemWindowInsets, false); this.T = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_paddingTopSystemWindowInsets, true); this.n = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_marginLeftSystemWindowInsets, false); this.k = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_marginRightSystemWindowInsets, false); this.l = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_marginTopSystemWindowInsets, false); this.ae = obtainStyledAttributes.getBoolean(C17052tZT.jNh.BottomSheetBehavior_Layout_shouldRemoveExpandedCorners, true); obtainStyledAttributes.recycle(); this.U = ViewConfiguration.get(context).getScaledMaximumFlingVelocity(); return; } throw new IllegalArgumentException("ratio must be a float value between 0 and 1"); } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final Parcelable LH_(CoordinatorLayout coordinatorLayout, V v) { return new RVV(super.LH_(coordinatorLayout, v), (BottomSheetBehavior) this); } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final void LG_(CoordinatorLayout coordinatorLayout, V v, Parcelable parcelable) { RVV rvv = (RVV) parcelable; super.LG_(coordinatorLayout, v, rvv.b); int i = this.ab; if (i != 0) { if (i == -1 || (i & 1) == 1) { this.w = rvv.e; } int i2 = this.ab; if (i2 == -1 || (i2 & 2) == 2) { this.d = rvv.c; } int i3 = this.ab; if (i3 == -1 || (i3 & 4) == 4) { this.g = rvv.d; } int i4 = this.ab; if (i4 == -1 || (i4 & 8) == 8) { this.v = rvv.g; } } if (rvv.f == 1 || rvv.f == 2) { this.y = 4; this.Q = 4; } else { int i5 = rvv.f; this.y = i5; this.Q = i5; } } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final void a(CoordinatorLayout.RVV rvv) { super.a(rvv); this.z = null; this.B = null; } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final void d() { super.d(); this.z = null; this.B = null; } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final boolean a(CoordinatorLayout coordinatorLayout, V v, int i, int i2, int i3, int i4) { ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) v.getLayoutParams(); int paddingLeft = coordinatorLayout.getPaddingLeft(); int paddingRight = coordinatorLayout.getPaddingRight(); int i5 = marginLayoutParams.leftMargin; int e = e(i, paddingLeft + paddingRight + i5 + marginLayoutParams.rightMargin + i2, this.X, ((ViewGroup.LayoutParams) marginLayoutParams).width); int paddingTop = coordinatorLayout.getPaddingTop(); int paddingBottom = coordinatorLayout.getPaddingBottom(); int i6 = marginLayoutParams.topMargin; v.measure(e, e(i3, paddingTop + paddingBottom + i6 + marginLayoutParams.bottomMargin + i4, this.V, ((ViewGroup.LayoutParams) marginLayoutParams).height)); return true; } private static int e(int i, int i2, int i3, int i4) { int childMeasureSpec = ViewGroup.getChildMeasureSpec(i, i2, i4); if (i3 == -1) { return childMeasureSpec; } int mode = View.MeasureSpec.getMode(childMeasureSpec); int size = View.MeasureSpec.getSize(childMeasureSpec); if (mode == 1073741824) { return View.MeasureSpec.makeMeasureSpec(Math.min(size, i3), 1073741824); } if (size != 0) { i3 = Math.min(size, i3); } return View.MeasureSpec.makeMeasureSpec(i3, PKIFailureInfo.systemUnavail); } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final boolean c(CoordinatorLayout coordinatorLayout, V v, int i) { if (ViewCompat.l(coordinatorLayout) && !ViewCompat.l(v)) { v.setFitsSystemWindows(true); } if (this.z == null) { this.Y = coordinatorLayout.getResources().getDimensionPixelSize(C17052tZT.HBt.design_bottom_sheet_peek_height_min); boolean z = (Build.VERSION.SDK_INT < 29 || this.K || this.aa) ? false : true; if (this.t || this.q || this.p || this.n || this.k || this.l || z) { Lot.c(v, new Lot.IeS(this, z) { // from class: com.google.android.material.bottomsheet.BottomSheetBehavior.5 private boolean b; private BottomSheetBehavior e; { this.e = this; this.b = z; } /* JADX WARN: Code restructure failed: missing block: B:45:0x009d, code lost: if (r4 != false) goto L38; */ @Override // o.Lot.IeS /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final androidx.core.view.WindowInsetsCompat b(android.view.View r10, androidx.core.view.WindowInsetsCompat r11, o.Lot.RVV r12) { /* r9 = this; int r0 = androidx.core.view.WindowInsetsCompat.jbe.b() o.Rmc r0 = r11.c(r0) int r1 = androidx.core.view.WindowInsetsCompat.jbe.d() o.Rmc r1 = r11.c(r1) com.google.android.material.bottomsheet.BottomSheetBehavior r2 = r9.e int r3 = r0.b r2.m = r3 int r2 = androidx.core.view.ViewCompat.m(r10) r3 = 0 r4 = 1 if (r2 == r4) goto L20 r2 = r3 goto L21 L20: r2 = r4 L21: int r5 = r10.getPaddingBottom() int r6 = r10.getPaddingLeft() int r7 = r10.getPaddingRight() com.google.android.material.bottomsheet.BottomSheetBehavior r8 = r9.e boolean r8 = r8.t if (r8 == 0) goto L42 com.google.android.material.bottomsheet.BottomSheetBehavior r5 = r9.e int r8 = r11.f() r5.h = r8 int r5 = r12.d com.google.android.material.bottomsheet.BottomSheetBehavior r8 = r9.e int r8 = r8.h int r5 = r5 + r8 L42: com.google.android.material.bottomsheet.BottomSheetBehavior r8 = r9.e boolean r8 = r8.q if (r8 == 0) goto L52 if (r2 == 0) goto L4d int r6 = r12.c goto L4f L4d: int r6 = r12.a L4f: int r8 = r0.a int r6 = r6 + r8 L52: com.google.android.material.bottomsheet.BottomSheetBehavior r8 = r9.e boolean r8 = r8.p if (r8 == 0) goto L63 if (r2 == 0) goto L5d int r12 = r12.a goto L5f L5d: int r12 = r12.c L5f: int r2 = r0.d int r7 = r12 + r2 L63: android.view.ViewGroup$LayoutParams r12 = r10.getLayoutParams() android.view.ViewGroup$MarginLayoutParams r12 = (android.view.ViewGroup.MarginLayoutParams) r12 com.google.android.material.bottomsheet.BottomSheetBehavior r2 = r9.e boolean r2 = r2.n if (r2 == 0) goto L7a int r2 = r12.leftMargin int r8 = r0.a if (r2 == r8) goto L7a int r2 = r0.a r12.leftMargin = r2 r3 = r4 L7a: com.google.android.material.bottomsheet.BottomSheetBehavior r2 = r9.e boolean r2 = r2.k if (r2 == 0) goto L8b int r2 = r12.rightMargin int r8 = r0.d if (r2 == r8) goto L8b int r2 = r0.d r12.rightMargin = r2 goto L8c L8b: r4 = r3 L8c: com.google.android.material.bottomsheet.BottomSheetBehavior r2 = r9.e boolean r2 = r2.l if (r2 == 0) goto L9d int r2 = r12.topMargin int r3 = r0.b if (r2 == r3) goto L9d int r0 = r0.b r12.topMargin = r0 goto L9f L9d: if (r4 == 0) goto La2 L9f: r10.setLayoutParams(r12) La2: int r12 = r10.getPaddingTop() r10.setPadding(r6, r12, r7, r5) boolean r10 = r9.b if (r10 == 0) goto Lb3 com.google.android.material.bottomsheet.BottomSheetBehavior r10 = r9.e int r12 = r1.e r10.i = r12 Lb3: com.google.android.material.bottomsheet.BottomSheetBehavior r10 = r9.e boolean r10 = r10.t if (r10 != 0) goto Lbd boolean r10 = r9.b if (r10 == 0) goto Lc2 Lbd: com.google.android.material.bottomsheet.BottomSheetBehavior r10 = r9.e r10.e() Lc2: return r11 */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.bottomsheet.BottomSheetBehavior.AnonymousClass5.b(android.view.View, androidx.core.view.WindowInsetsCompat, o.Lot$RVV):androidx.core.view.WindowInsetsCompat"); } }); } ViewCompat.d(v, new Tur(v)); this.z = new WeakReference<>(v); C4363bXv c4363bXv = this.f6468o; if (c4363bXv != null) { ViewCompat.sn_(v, c4363bXv); C4363bXv c4363bXv2 = this.f6468o; float f = this.G; if (f == -1.0f) { f = ViewCompat.i(v); } c4363bXv2.n(f); } else { ColorStateList colorStateList = this.D; if (colorStateList != null) { ViewCompat.so_(v, colorStateList); } } WeakReference weakReference = this.z; if (weakReference != null) { d(weakReference.get()); } if (ViewCompat.n(v) == 0) { ViewCompat.g(v, 1); } } if (this.B == null) { this.B = OSb.xm_(coordinatorLayout, this.H); } int top = v.getTop(); coordinatorLayout.c(v, i); this.Z = coordinatorLayout.getWidth(); this.r = coordinatorLayout.getHeight(); int height = v.getHeight(); this.E = height; int i2 = this.r; int i3 = this.m; if (i2 - height < i3) { if (this.T) { this.E = i2; } else { this.E = i2 - i3; } } this.f = Math.max(0, i2 - this.E); this.j = (int) (this.r * (1.0f - this.J)); b(); int i4 = this.y; if (i4 == 3) { ViewCompat.d(v, a()); } else if (i4 == 6) { ViewCompat.d(v, this.j); } else if (this.g && i4 == 5) { ViewCompat.d(v, this.r); } else if (i4 == 4) { ViewCompat.d(v, this.e); } else if (i4 == 1 || i4 == 2) { ViewCompat.d(v, top - v.getTop()); } a(this.y, false); this.s = new WeakReference<>(e(v)); for (int i5 = 0; i5 < this.b.size(); i5++) { this.b.get(i5).b(v); } return true; } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final boolean LJ_(CoordinatorLayout coordinatorLayout, V v, MotionEvent motionEvent) { OSb oSb; if (v.isShown() && this.a) { int actionMasked = motionEvent.getActionMasked(); if (actionMasked == 0) { this.c = -1; VelocityTracker velocityTracker = this.ag; if (velocityTracker != null) { velocityTracker.recycle(); this.ag = null; } } if (this.ag == null) { this.ag = VelocityTracker.obtain(); } this.ag.addMovement(motionEvent); if (actionMasked == 0) { int x = (int) motionEvent.getX(); this.S = (int) motionEvent.getY(); if (this.y != 2) { WeakReference weakReference = this.s; View view = weakReference != null ? weakReference.get() : null; if (view != null && coordinatorLayout.e(view, x, this.S)) { this.c = motionEvent.getPointerId(motionEvent.getActionIndex()); this.u = true; } } this.M = this.c == -1 && !coordinatorLayout.e(v, x, this.S); } else if (actionMasked == 1 || actionMasked == 3) { this.u = false; this.c = -1; if (this.M) { this.M = false; return false; } } if (!this.M && (oSb = this.B) != null && oSb.xp_(motionEvent)) { return true; } WeakReference weakReference2 = this.s; View view2 = weakReference2 != null ? weakReference2.get() : null; return (actionMasked != 2 || view2 == null || this.M || this.y == 1 || coordinatorLayout.e(view2, (int) motionEvent.getX(), (int) motionEvent.getY()) || this.B == null || Math.abs(((float) this.S) - motionEvent.getY()) <= ((float) this.B.d)) ? false : true; } this.M = true; return false; } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final boolean MY_(CoordinatorLayout coordinatorLayout, V v, MotionEvent motionEvent) { if (!v.isShown()) { return false; } int actionMasked = motionEvent.getActionMasked(); if (this.y == 1 && actionMasked == 0) { return true; } if (i()) { this.B.xo_(motionEvent); } if (actionMasked == 0) { this.c = -1; VelocityTracker velocityTracker = this.ag; if (velocityTracker != null) { velocityTracker.recycle(); this.ag = null; } } if (this.ag == null) { this.ag = VelocityTracker.obtain(); } this.ag.addMovement(motionEvent); if (i() && actionMasked == 2 && !this.M && Math.abs(this.S - motionEvent.getY()) > this.B.d) { this.B.a(v, motionEvent.getPointerId(motionEvent.getActionIndex())); } return !this.M; } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final void e(CoordinatorLayout coordinatorLayout, V v, View view, int i, int i2, int[] iArr, int i3) { if (i3 == 1) { return; } WeakReference weakReference = this.s; if (view != (weakReference != null ? weakReference.get() : null)) { return; } int top = v.getTop(); int i4 = top - i2; if (i2 > 0) { if (i4 < a()) { int a = top - a(); iArr[1] = a; ViewCompat.d(v, -a); e(3); } else { if (!this.a) { return; } iArr[1] = i2; ViewCompat.d(v, -i2); e(1); } } else if (i2 < 0 && !view.canScrollVertically(-1)) { int i5 = this.e; if (i4 > i5 && !this.g) { int i6 = top - i5; iArr[1] = i6; ViewCompat.d(v, -i6); e(4); } else { if (!this.a) { return; } iArr[1] = i2; ViewCompat.d(v, -i2); e(1); } } c(v.getTop()); this.P = i2; this.W = true; } /* JADX WARN: Code restructure failed: missing block: B:17:0x002d, code lost: if (r3.getTop() > r1.j) goto L49; */ /* JADX WARN: Code restructure failed: missing block: B:35:0x006d, code lost: if (java.lang.Math.abs(r2 - r1.f) < java.lang.Math.abs(r2 - r1.e)) goto L51; */ /* JADX WARN: Code restructure failed: missing block: B:40:0x007c, code lost: if (r2 >= java.lang.Math.abs(r2 - r1.e)) goto L49; */ /* JADX WARN: Code restructure failed: missing block: B:42:0x008c, code lost: if (java.lang.Math.abs(r2 - r4) < java.lang.Math.abs(r2 - r1.e)) goto L49; */ /* JADX WARN: Code restructure failed: missing block: B:46:0x00a7, code lost: if (java.lang.Math.abs(r2 - r1.j) < java.lang.Math.abs(r2 - r1.e)) goto L49; */ @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void a(androidx.coordinatorlayout.widget.CoordinatorLayout r2, V r3, android.view.View r4, int r5) { /* r1 = this; int r2 = r3.getTop() int r5 = r1.a() r0 = 3 if (r2 != r5) goto Lf r1.e(r0) return Lf: java.lang.ref.WeakReference r2 = r1.s if (r2 == 0) goto Lb2 java.lang.Object r2 = r2.get() if (r4 != r2) goto Lb2 boolean r2 = r1.W if (r2 != 0) goto L1f goto Lb2 L1f: int r2 = r1.P if (r2 <= 0) goto L31 boolean r2 = r1.d if (r2 != 0) goto Lac int r2 = r3.getTop() int r4 = r1.j if (r2 <= r4) goto Lac goto La9 L31: boolean r2 = r1.g if (r2 == 0) goto L52 android.view.VelocityTracker r2 = r1.ag if (r2 != 0) goto L3b r2 = 0 goto L4a L3b: float r4 = r1.U r5 = 1000(0x3e8, float:1.401E-42) r2.computeCurrentVelocity(r5, r4) android.view.VelocityTracker r2 = r1.ag int r4 = r1.c float r2 = r2.getYVelocity(r4) L4a: boolean r2 = r1.a(r3, r2) if (r2 == 0) goto L52 r0 = 5 goto Lac L52: int r2 = r1.P if (r2 != 0) goto L8f int r2 = r3.getTop() boolean r4 = r1.d if (r4 == 0) goto L70 int r4 = r1.f int r4 = r2 - r4 int r4 = java.lang.Math.abs(r4) int r5 = r1.e int r2 = r2 - r5 int r2 = java.lang.Math.abs(r2) if (r4 >= r2) goto Lab goto Lac L70: int r4 = r1.j if (r2 >= r4) goto L7f int r4 = r1.e int r4 = r2 - r4 int r4 = java.lang.Math.abs(r4) if (r2 < r4) goto Lac goto La9 L7f: int r4 = r2 - r4 int r4 = java.lang.Math.abs(r4) int r5 = r1.e int r2 = r2 - r5 int r2 = java.lang.Math.abs(r2) if (r4 >= r2) goto Lab goto La9 L8f: boolean r2 = r1.d if (r2 == 0) goto L94 goto Lab L94: int r2 = r3.getTop() int r4 = r1.j int r4 = r2 - r4 int r4 = java.lang.Math.abs(r4) int r5 = r1.e int r2 = r2 - r5 int r2 = java.lang.Math.abs(r2) if (r4 >= r2) goto Lab La9: r0 = 6 goto Lac Lab: r0 = 4 Lac: r2 = 0 r1.e(r3, r0, r2) r1.W = r2 Lb2: return */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.bottomsheet.BottomSheetBehavior.a(androidx.coordinatorlayout.widget.CoordinatorLayout, android.view.View, android.view.View, int):void"); } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final boolean c(CoordinatorLayout coordinatorLayout, V v, View view, float f, float f2) { WeakReference weakReference = this.s; if (weakReference == null || view != weakReference.get()) { return false; } return this.y != 3 || super.c(coordinatorLayout, v, view, f, f2); } private void b(int i) { if (i == -1) { if (this.aa) { return; } else { this.aa = true; } } else { if (!this.aa && this.w == i) { return; } this.aa = false; this.w = Math.max(0, i); } e(); } final void e() { V v; if (this.z != null) { b(); if (this.y != 4 || (v = this.z.get()) == null) { return; } v.requestLayout(); } } public final int a() { if (this.d) { return this.f; } return Math.max(this.L, this.T ? 0 : this.m); } public final void a(boolean z) { if (this.g != z) { this.g = z; if (!z && this.y == 5) { a(4); } WeakReference weakReference = this.z; if (weakReference != null) { d(weakReference.get()); } } } public final void a(int i) { if (i == 1 || i == 2) { StringBuilder sb = new StringBuilder("STATE_"); sb.append(i == 1 ? "DRAGGING" : "SETTLING"); sb.append(" should not be set externally."); throw new IllegalArgumentException(sb.toString()); } if (this.g || i != 5) { int i2 = (i == 6 && this.d && d(i) <= this.f) ? 3 : i; WeakReference weakReference = this.z; if (weakReference == null || weakReference.get() == null) { e(i); } else { V v = this.z.get(); b(v, new Runnable(this, v, i2) { // from class: com.google.android.material.bottomsheet.BottomSheetBehavior.4 private View b; private BottomSheetBehavior c; private int e; { this.c = this; this.b = v; this.e = i2; } @Override // java.lang.Runnable public final void run() { this.c.e(this.b, this.e, false); } }); } } } final void e(int i) { V v; if (this.y == i) { return; } this.y = i; if (i == 4 || i == 3 || i == 6 || (this.g && i == 5)) { this.Q = i; } WeakReference weakReference = this.z; if (weakReference == null || (v = weakReference.get()) == null) { return; } if (i == 3) { e(true); } else if (i == 6 || i == 5 || i == 4) { e(false); } a(i, true); for (int i2 = 0; i2 < this.b.size(); i2++) { this.b.get(i2).a(v, i); } WeakReference weakReference2 = this.z; if (weakReference2 != null) { d(weakReference2.get()); } } private void a(int i, boolean z) { ValueAnimator valueAnimator; if (i == 2) { return; } boolean z2 = this.y == 3 && (this.ae || a() == 0); if (this.I == z2 || this.f6468o == null) { return; } this.I = z2; float f = BitmapDescriptorFactory.HUE_RED; if (z && (valueAnimator = this.O) != null) { if (valueAnimator.isRunning()) { this.O.reverse(); return; } if (!z2) { f = 1.0f; } this.O.setFloatValues(1.0f - f, f); this.O.start(); return; } ValueAnimator valueAnimator2 = this.O; if (valueAnimator2 != null && valueAnimator2.isRunning()) { this.O.cancel(); } C4363bXv c4363bXv = this.f6468o; if (!this.I) { f = 1.0f; } if (c4363bXv.B.h != f) { c4363bXv.B.h = f; c4363bXv.H = true; c4363bXv.invalidateSelf(); } } private int h() { int i; if (this.aa) { return Math.min(Math.max(this.Y, this.r - ((this.Z * 9) / 16)), this.E) + this.h; } return (this.K || this.t || (i = this.i) <= 0) ? this.w + this.h : Math.max(this.w, i + this.ac); } private void b() { int h = h(); if (!this.d) { this.e = this.r - h; return; } this.e = Math.max(this.r - h, this.f); } final boolean a(View view, float f) { if (this.v) { return true; } if (view.getTop() < this.e) { return false; } return Math.abs((((float) view.getTop()) + (f * this.N)) - ((float) this.e)) / ((float) h()) > 0.5f; } private View e(View view) { if (view.getVisibility() != 0) { return null; } if (ViewCompat.I(view)) { return view; } if (view instanceof ViewGroup) { ViewGroup viewGroup = (ViewGroup) view; int childCount = viewGroup.getChildCount(); for (int i = 0; i < childCount; i++) { View e = e(viewGroup.getChildAt(i)); if (e != null) { return e; } } } return null; } final void e(View view, int i, boolean z) { int d = d(i); OSb oSb = this.B; if (oSb != null && (!z ? oSb.a(view, view.getLeft(), d) : oSb.c(view.getLeft(), d))) { e(2); a(i, true); this.af.a(i); return; } e(i); } private int d(int i) { if (i == 3) { return a(); } if (i == 4) { return this.e; } if (i == 5) { return this.r; } if (i == 6) { return this.j; } throw new IllegalArgumentException("Invalid state to get top offset: ".concat(String.valueOf(i))); } final void c(int i) { V v = this.z.get(); if (v == null || this.b.isEmpty()) { return; } int i2 = this.e; if (i <= i2 && i2 != a()) { a(); } for (int i3 = 0; i3 < this.b.size(); i3++) { this.b.get(i3).d(v); } } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public class IeS { boolean a; final BottomSheetBehavior b; int c; private final Runnable d; private IeS(BottomSheetBehavior bottomSheetBehavior) { this.b = bottomSheetBehavior; this.d = new Runnable(this) { // from class: com.google.android.material.bottomsheet.BottomSheetBehavior.IeS.5 private IeS b; { this.b = this; } @Override // java.lang.Runnable public final void run() { this.b.a = false; if (this.b.b.B != null && this.b.b.B.c()) { IeS ieS = this.b; ieS.a(ieS.c); } else if (this.b.b.y == 2) { this.b.b.e(this.b.c); } } }; } /* synthetic */ IeS(BottomSheetBehavior bottomSheetBehavior, byte b) { this(bottomSheetBehavior); } final void a(int i) { if (this.b.z == null || this.b.z.get() == null) { return; } this.c = i; if (this.a) { return; } ViewCompat.e(this.b.z.get(), this.d); this.a = true; } } /* loaded from: classes2.dex */ protected static class RVV extends XgG { public static final Parcelable.Creator CREATOR = new Parcelable.ClassLoaderCreator() { // from class: com.google.android.material.bottomsheet.BottomSheetBehavior.RVV.4 @Override // android.os.Parcelable.Creator public final /* synthetic */ Object createFromParcel(Parcel parcel) { return new RVV(parcel, (ClassLoader) null); } @Override // android.os.Parcelable.ClassLoaderCreator public final /* synthetic */ RVV createFromParcel(Parcel parcel, ClassLoader classLoader) { return new RVV(parcel, classLoader); } @Override // android.os.Parcelable.Creator public final /* bridge */ /* synthetic */ Object[] newArray(int i) { return new RVV[i]; } }; boolean c; boolean d; int e; final int f; boolean g; public RVV(Parcel parcel, ClassLoader classLoader) { super(parcel, classLoader); this.f = parcel.readInt(); this.e = parcel.readInt(); this.c = parcel.readInt() == 1; this.d = parcel.readInt() == 1; this.g = parcel.readInt() == 1; } public RVV(Parcelable parcelable, BottomSheetBehavior bottomSheetBehavior) { super(parcelable); this.f = bottomSheetBehavior.y; this.e = bottomSheetBehavior.w; this.c = bottomSheetBehavior.d; this.d = bottomSheetBehavior.g; this.g = bottomSheetBehavior.v; } @Override // o.XgG, android.os.Parcelable public final void writeToParcel(Parcel parcel, int i) { super.writeToParcel(parcel, i); parcel.writeInt(this.f); parcel.writeInt(this.e); parcel.writeInt(this.c ? 1 : 0); parcel.writeInt(this.d ? 1 : 0); parcel.writeInt(this.g ? 1 : 0); } } public static BottomSheetBehavior b(V v) { ViewGroup.LayoutParams layoutParams = v.getLayoutParams(); if (!(layoutParams instanceof CoordinatorLayout.RVV)) { throw new IllegalArgumentException("The view is not a child of CoordinatorLayout"); } CoordinatorLayout.Sts sts = ((CoordinatorLayout.RVV) layoutParams).h; if (!(sts instanceof BottomSheetBehavior)) { throw new IllegalArgumentException("The view is not associated with BottomSheetBehavior"); } return (BottomSheetBehavior) sts; } private void e(boolean z) { WeakReference weakReference = this.z; if (weakReference == null) { return; } ViewParent parent = weakReference.get().getParent(); if (parent instanceof CoordinatorLayout) { CoordinatorLayout coordinatorLayout = (CoordinatorLayout) parent; int childCount = coordinatorLayout.getChildCount(); if (z) { if (this.R != null) { return; } else { this.R = new HashMap(childCount); } } for (int i = 0; i < childCount; i++) { View childAt = coordinatorLayout.getChildAt(i); if (childAt != this.z.get() && z) { this.R.put(childAt, Integer.valueOf(childAt.getImportantForAccessibility())); } } if (z) { return; } this.R = null; } } private void d(View view) { if (view == null) { return; } b(view, 0); if (!this.d && this.y != 6) { this.F.put(0, a(view, C17052tZT.ojQ.bottomsheet_action_expand_halfway)); } if (this.g && this.y != 5) { ViewCompat.a(view, AccessibilityNodeInfoCompat.AccessibilityActionCompat.h, null, new AnonymousClass2(this, 5)); } int i = this.y; if (i == 3) { ViewCompat.a(view, AccessibilityNodeInfoCompat.AccessibilityActionCompat.j, null, new AnonymousClass2(this, this.d ? 4 : 6)); return; } if (i == 4) { ViewCompat.a(view, AccessibilityNodeInfoCompat.AccessibilityActionCompat.f6387o, null, new AnonymousClass2(this, this.d ? 3 : 6)); } else if (i == 6) { ViewCompat.a(view, AccessibilityNodeInfoCompat.AccessibilityActionCompat.j, null, new AnonymousClass2(this, 4)); ViewCompat.a(view, AccessibilityNodeInfoCompat.AccessibilityActionCompat.f6387o, null, new AnonymousClass2(this, 3)); } } private void b(View view, int i) { if (view == null) { return; } ViewCompat.b(view, 524288); ViewCompat.b(view, 262144); ViewCompat.b(view, PKIFailureInfo.badCertTemplate); int i2 = this.F.get(0, -1); if (i2 != -1) { ViewCompat.b(view, i2); this.F.delete(0); } } private int a(View view, int i) { int i2 = 2 % 2; int i3 = ai + 19; ak = i3 % 128; if (i3 % 2 != 0) { String string = view.getResources().getString(i); if (string.startsWith(",*,)")) { Object[] objArr = new Object[1]; al(string.substring(4), objArr); string = ((String) objArr[0]).intern(); int i4 = ai + 111; ak = i4 % 128; int i5 = i4 % 2; } return ViewCompat.a(view, string, new AnonymousClass2(this, 6)); } view.getResources().getString(i).startsWith(",*,)"); Object obj = null; obj.hashCode(); throw null; } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: com.google.android.material.bottomsheet.BottomSheetBehavior$2, reason: invalid class name */ /* loaded from: classes2.dex */ public final class AnonymousClass2 implements AccessibilityViewCommand { private BottomSheetBehavior c; private int d; AnonymousClass2(BottomSheetBehavior bottomSheetBehavior, int i) { this.c = bottomSheetBehavior; this.d = i; } @Override // androidx.core.view.accessibility.AccessibilityViewCommand public final boolean d(View view) { this.c.a(this.d); return true; } } private static void b(V v, Runnable runnable) { ViewParent parent = v.getParent(); if (parent != null && parent.isLayoutRequested() && ViewCompat.H(v)) { v.post(runnable); } else { runnable.run(); } } static void c() { aj = (byte) 6; } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final boolean e(CoordinatorLayout coordinatorLayout, V v, View view, View view2, int i, int i2) { this.P = 0; this.W = false; return (i & 2) != 0; } private boolean i() { return this.B != null && (this.a || this.y == 1); } }