package defpackage;

import android.content.Context;
import android.graphics.PointF;
import android.opengl.Matrix;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;

/* renamed from: ᵔᵕᵠ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class ViewOnTouchListenerC2235 extends GestureDetector.SimpleOnGestureListener implements View.OnTouchListener, InterfaceC3649 {

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final GestureDetector f8764;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final C4819 f8767;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final PointF f8765 = new PointF();

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final PointF f8763 = new PointF();

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final float f8766 = 25.0f;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public volatile float f8762 = 3.1415927f;

    public ViewOnTouchListenerC2235(Context context, C4819 c4819) {
        this.f8767 = c4819;
        this.f8764 = new GestureDetector(context, this);
    }

    @Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnGestureListener
    public final boolean onDown(MotionEvent motionEvent) {
        this.f8765.set(motionEvent.getX(), motionEvent.getY());
        return true;
    }

    @Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnGestureListener
    public final boolean onScroll(MotionEvent motionEvent, MotionEvent motionEvent2, float f, float f2) {
        float x = (motionEvent2.getX() - this.f8765.x) / this.f8766;
        float y = motionEvent2.getY();
        PointF pointF = this.f8765;
        float f3 = (y - pointF.y) / this.f8766;
        pointF.set(motionEvent2.getX(), motionEvent2.getY());
        double d = this.f8762;
        float fCos = (float) Math.cos(d);
        float fSin = (float) Math.sin(d);
        PointF pointF2 = this.f8763;
        pointF2.x -= (fCos * x) - (fSin * f3);
        float f4 = (fCos * f3) + (fSin * x) + pointF2.y;
        pointF2.y = f4;
        pointF2.y = Math.max(-45.0f, Math.min(45.0f, f4));
        C4819 c4819 = this.f8767;
        PointF pointF3 = this.f8763;
        synchronized (c4819) {
            float f5 = pointF3.y;
            c4819.f17880 = f5;
            Matrix.setRotateM(c4819.f17886, 0, -f5, (float) Math.cos(c4819.f17883), (float) Math.sin(c4819.f17883), 0.0f);
            Matrix.setRotateM(c4819.f17884, 0, -pointF3.x, 0.0f, 1.0f, 0.0f);
        }
        return true;
    }

    @Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnGestureListener
    public final boolean onSingleTapUp(MotionEvent motionEvent) {
        return this.f8767.f17888.performClick();
    }

    @Override // android.view.View.OnTouchListener
    public final boolean onTouch(View view, MotionEvent motionEvent) {
        return this.f8764.onTouchEvent(motionEvent);
    }

    @Override // defpackage.InterfaceC3649
    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void mo5887(float[] fArr, float f) {
        this.f8762 = -f;
    }
}
