package androidx.appcompat.widget; import android.content.Context; import android.content.res.Configuration; import android.content.res.TypedArray; import android.util.AttributeSet; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import androidx.core.view.ViewCompat; import androidx.core.view.ViewPropertyAnimatorCompat; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import o.AuZ; import o.InterfaceC15687hkl; import o.SYO; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes.dex */ public abstract class AbsActionBarView extends ViewGroup { protected final RVV a; protected int b; protected ActionMenuPresenter c; protected ActionMenuView d; protected final Context e; protected ViewPropertyAnimatorCompat h; private boolean i; private boolean j; /* JADX INFO: Access modifiers changed from: package-private */ public AbsActionBarView(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); this.a = new RVV(this); TypedValue typedValue = new TypedValue(); if (!context.getTheme().resolveAttribute(SYO.IeS.actionBarPopupTheme, typedValue, true) || typedValue.resourceId == 0) { this.e = context; } else { this.e = new ContextThemeWrapper(context, typedValue.resourceId); } } @Override // android.view.View protected void onConfigurationChanged(Configuration configuration) { super.onConfigurationChanged(configuration); TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(null, SYO.ZqN.ActionBar, SYO.IeS.actionBarStyle, 0); setContentHeight(obtainStyledAttributes.getLayoutDimension(SYO.ZqN.ActionBar_height, 0)); obtainStyledAttributes.recycle(); ActionMenuPresenter actionMenuPresenter = this.c; if (actionMenuPresenter != null) { boolean z = actionMenuPresenter.h; actionMenuPresenter.i = new AuZ(actionMenuPresenter.c).d(); if (actionMenuPresenter.d != null) { actionMenuPresenter.d.c(true); } } } @Override // android.view.View public boolean onTouchEvent(MotionEvent motionEvent) { int actionMasked = motionEvent.getActionMasked(); if (actionMasked == 0) { this.i = false; } if (!this.i) { boolean onTouchEvent = super.onTouchEvent(motionEvent); if (actionMasked == 0 && !onTouchEvent) { this.i = true; } } if (actionMasked == 1 || actionMasked == 3) { this.i = false; } return true; } @Override // android.view.View public boolean onHoverEvent(MotionEvent motionEvent) { int actionMasked = motionEvent.getActionMasked(); if (actionMasked == 9) { this.j = false; } if (!this.j) { boolean onHoverEvent = super.onHoverEvent(motionEvent); if (actionMasked == 9 && !onHoverEvent) { this.j = true; } } if (actionMasked == 10 || actionMasked == 3) { this.j = false; } return true; } public void setContentHeight(int i) { this.b = i; requestLayout(); } public ViewPropertyAnimatorCompat c(int i, long j) { ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = this.h; if (viewPropertyAnimatorCompat != null) { viewPropertyAnimatorCompat.d(); } if (i == 0) { if (getVisibility() != 0) { setAlpha(BitmapDescriptorFactory.HUE_RED); } ViewPropertyAnimatorCompat b = ViewCompat.b(this).b(1.0f); b.b(j); b.b(this.a.b(b, i)); return b; } ViewPropertyAnimatorCompat b2 = ViewCompat.b(this).b(BitmapDescriptorFactory.HUE_RED); b2.b(j); b2.b(this.a.b(b2, i)); return b2; } @Override // android.view.View public void setVisibility(int i) { if (i != getVisibility()) { ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = this.h; if (viewPropertyAnimatorCompat != null) { viewPropertyAnimatorCompat.d(); } super.setVisibility(i); } } public boolean d() { ActionMenuPresenter actionMenuPresenter = this.c; if (actionMenuPresenter != null) { return actionMenuPresenter.b(); } return false; } /* JADX INFO: Access modifiers changed from: protected */ public static int e(View view, int i, int i2, int i3, boolean z) { int measuredWidth = view.getMeasuredWidth(); int measuredHeight = view.getMeasuredHeight(); int i4 = i2 + ((i3 - measuredHeight) / 2); if (z) { view.layout(i - measuredWidth, i4, i, measuredHeight + i4); } else { view.layout(i, i4, i + measuredWidth, measuredHeight + i4); } return z ? -measuredWidth : measuredWidth; } /* loaded from: classes.dex */ protected class RVV implements InterfaceC15687hkl { private int b; private boolean c = false; final AbsActionBarView d; protected RVV(AbsActionBarView absActionBarView) { this.d = absActionBarView; } public final RVV b(ViewPropertyAnimatorCompat viewPropertyAnimatorCompat, int i) { this.d.h = viewPropertyAnimatorCompat; this.b = i; return this; } @Override // o.InterfaceC15687hkl public final void e(View view) { AbsActionBarView.super.setVisibility(0); this.c = false; } @Override // o.InterfaceC15687hkl public final void d(View view) { if (this.c) { return; } this.d.h = null; AbsActionBarView.super.setVisibility(this.b); } @Override // o.InterfaceC15687hkl public final void b(View view) { this.c = true; } } }