mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-19 12:23:19 +01:00
240 lines
16 KiB
Java
240 lines
16 KiB
Java
package androidx.camera.view.impl;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.content.Context;
|
|
import android.view.GestureDetector;
|
|
import android.view.MotionEvent;
|
|
import android.view.ViewConfiguration;
|
|
import androidx.annotation.FloatRange;
|
|
import androidx.annotation.IntRange;
|
|
import androidx.annotation.Px;
|
|
import androidx.annotation.UiThread;
|
|
import com.google.android.gms.common.internal.ServiceSpecificExtraArgs;
|
|
import kotlin.Metadata;
|
|
import kotlin.jvm.JvmOverloads;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000F\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0007\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0013\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u0000 -2\u00020\u0001:\u0003-./B+\b\u0007\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\b\b\u0003\u0010\u0004\u001a\u00020\u0005\u0012\b\b\u0003\u0010\u0006\u001a\u00020\u0005\u0012\u0006\u0010\u0007\u001a\u00020\b¢\u0006\u0002\u0010\tJ\b\u0010(\u001a\u00020\fH\u0002J\b\u0010)\u001a\u00020\u0012H\u0002J\u0010\u0010*\u001a\u00020\u00122\u0006\u0010+\u001a\u00020,H\u0007R\u000e\u0010\n\u001a\u00020\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0012X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0013\u001a\u00020\u0014X\u0082\u000e¢\u0006\u0002\n\u0000R\u0012\u0010\u0015\u001a\u00020\u00058\u0002@\u0002X\u0083\u000e¢\u0006\u0002\n\u0000R\u0012\u0010\u0016\u001a\u00020\u00058\u0002@\u0002X\u0083\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0017\u001a\u00020\u0018X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0019\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001a\u001a\u00020\u0012X\u0082\u000e¢\u0006\u0002\n\u0000R\u001a\u0010\u001b\u001a\u00020\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001b\u0010\u001c\"\u0004\b\u001d\u0010\u001eR\u001a\u0010\u001f\u001a\u00020\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001f\u0010\u001c\"\u0004\b \u0010\u001eR\u000e\u0010\u0007\u001a\u00020\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010!\u001a\u00020\u0014X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\"\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010#\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010$\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u0011\u0010%\u001a\u00020\u00148F¢\u0006\u0006\u001a\u0004\b&\u0010'¨\u00060"}, d2 = {"Landroidx/camera/view/impl/ZoomGestureDetector;", "", "context", "Landroid/content/Context;", "spanSlop", "", "minSpan", ServiceSpecificExtraArgs.CastExtraArgs.LISTENER, "Landroidx/camera/view/impl/ZoomGestureDetector$OnZoomGestureListener;", "(Landroid/content/Context;IILandroidx/camera/view/impl/ZoomGestureDetector$OnZoomGestureListener;)V", "anchoredZoomMode", "anchoredZoomStartX", "", "anchoredZoomStartY", "currentSpan", "currentSpanX", "currentSpanY", "eventBeforeOrAboveStartingGestureEvent", "", "eventTime", "", "focusX", "focusY", "gestureDetector", "Landroid/view/GestureDetector;", "initialSpan", "isInProgress", "isQuickZoomEnabled", "()Z", "setQuickZoomEnabled", "(Z)V", "isStylusZoomEnabled", "setStylusZoomEnabled", "prevTime", "previousSpan", "previousSpanX", "previousSpanY", "timeDelta", "getTimeDelta", "()J", "getIncrementalScaleFactor", "inAnchoredZoomMode", "onTouchEvent", "event", "Landroid/view/MotionEvent;", "Companion", "OnZoomGestureListener", "ZoomEvent", "camera-view_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
/* loaded from: classes.dex */
|
|
public final class ZoomGestureDetector {
|
|
private static final int ANCHORED_ZOOM_MODE_DOUBLE_TAP = 1;
|
|
private static final int ANCHORED_ZOOM_MODE_NONE = 0;
|
|
private static final int ANCHORED_ZOOM_MODE_STYLUS = 2;
|
|
private static final int DEFAULT_MIN_SPAN = 0;
|
|
private static final float SCALE_FACTOR = 0.5f;
|
|
private int anchoredZoomMode;
|
|
private float anchoredZoomStartX;
|
|
private float anchoredZoomStartY;
|
|
|
|
@NotNull
|
|
private final Context context;
|
|
private float currentSpan;
|
|
private float currentSpanX;
|
|
private float currentSpanY;
|
|
private boolean eventBeforeOrAboveStartingGestureEvent;
|
|
private long eventTime;
|
|
|
|
@Px
|
|
private int focusX;
|
|
|
|
@Px
|
|
private int focusY;
|
|
|
|
@NotNull
|
|
private GestureDetector gestureDetector;
|
|
private float initialSpan;
|
|
private boolean isInProgress;
|
|
private boolean isQuickZoomEnabled;
|
|
private boolean isStylusZoomEnabled;
|
|
|
|
@NotNull
|
|
private final OnZoomGestureListener listener;
|
|
private final int minSpan;
|
|
private long prevTime;
|
|
private float previousSpan;
|
|
private float previousSpanX;
|
|
private float previousSpanY;
|
|
private final int spanSlop;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\bæ\u0080\u0001\u0018\u00002\u00020\u0001J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H'ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u0006À\u0006\u0001"}, d2 = {"Landroidx/camera/view/impl/ZoomGestureDetector$OnZoomGestureListener;", "", "onZoomEvent", "", "zoomEvent", "Landroidx/camera/view/impl/ZoomGestureDetector$ZoomEvent;", "camera-view_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
public interface OnZoomGestureListener {
|
|
@UiThread
|
|
boolean onZoomEvent(@NotNull ZoomEvent zoomEvent);
|
|
}
|
|
|
|
@JvmOverloads
|
|
@SuppressLint({"ExecutorRegistration"})
|
|
public ZoomGestureDetector(@NotNull Context context, @Px int i, @Px int i2, @NotNull OnZoomGestureListener onZoomGestureListener) {
|
|
context.getClass();
|
|
onZoomGestureListener.getClass();
|
|
this.context = context;
|
|
this.spanSlop = i;
|
|
this.minSpan = i2;
|
|
this.listener = onZoomGestureListener;
|
|
this.isQuickZoomEnabled = true;
|
|
this.isStylusZoomEnabled = true;
|
|
this.gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { // from class: androidx.camera.view.impl.ZoomGestureDetector$gestureDetector$1
|
|
@Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnDoubleTapListener
|
|
public boolean onDoubleTap(MotionEvent e) {
|
|
e.getClass();
|
|
ZoomGestureDetector.this.anchoredZoomStartX = e.getX();
|
|
ZoomGestureDetector.this.anchoredZoomStartY = e.getY();
|
|
ZoomGestureDetector.this.anchoredZoomMode = 1;
|
|
return true;
|
|
}
|
|
});
|
|
}
|
|
|
|
private final float getIncrementalScaleFactor() {
|
|
if (!inAnchoredZoomMode()) {
|
|
float f = this.previousSpan;
|
|
if (f > 0.0f) {
|
|
return this.currentSpan / f;
|
|
}
|
|
return 1.0f;
|
|
}
|
|
boolean z = this.eventBeforeOrAboveStartingGestureEvent;
|
|
boolean z2 = (z && this.currentSpan < this.previousSpan) || (!z && this.currentSpan > this.previousSpan);
|
|
float abs = Math.abs(1 - (this.currentSpan / this.previousSpan)) * 0.5f;
|
|
if (this.previousSpan <= this.spanSlop) {
|
|
return 1.0f;
|
|
}
|
|
return z2 ? abs + 1.0f : 1.0f - abs;
|
|
}
|
|
|
|
private final boolean inAnchoredZoomMode() {
|
|
return this.anchoredZoomMode != 0;
|
|
}
|
|
|
|
public final long getTimeDelta() {
|
|
return this.eventTime - this.prevTime;
|
|
}
|
|
|
|
/* renamed from: isQuickZoomEnabled, reason: from getter */
|
|
public final boolean getIsQuickZoomEnabled() {
|
|
return this.isQuickZoomEnabled;
|
|
}
|
|
|
|
/* renamed from: isStylusZoomEnabled, reason: from getter */
|
|
public final boolean getIsStylusZoomEnabled() {
|
|
return this.isStylusZoomEnabled;
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:108:0x007c, code lost:
|
|
|
|
if (r9 != false) goto L113;
|
|
*/
|
|
@androidx.annotation.UiThread
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final boolean onTouchEvent(@org.jetbrains.annotations.NotNull android.view.MotionEvent r27) {
|
|
/*
|
|
Method dump skipped, instructions count: 509
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.camera.view.impl.ZoomGestureDetector.onTouchEvent(android.view.MotionEvent):boolean");
|
|
}
|
|
|
|
public final void setQuickZoomEnabled(boolean z) {
|
|
this.isQuickZoomEnabled = z;
|
|
}
|
|
|
|
public final void setStylusZoomEnabled(boolean z) {
|
|
this.isStylusZoomEnabled = z;
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010\b\n\u0002\b\u000b\b&\u0018\u00002\u00020\u0001:\u0003\r\u000e\u000fB%\b\u0002\u0012\b\b\u0001\u0010\u0002\u001a\u00020\u0003\u0012\b\b\u0001\u0010\u0004\u001a\u00020\u0005\u0012\b\b\u0001\u0010\u0006\u001a\u00020\u0005¢\u0006\u0002\u0010\u0007R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\tR\u0011\u0010\u0004\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000bR\u0011\u0010\u0006\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\u000b¨\u0006\u0010"}, d2 = {"Landroidx/camera/view/impl/ZoomGestureDetector$ZoomEvent;", "", "eventTime", "", "focusX", "", "focusY", "(JII)V", "getEventTime", "()J", "getFocusX", "()I", "getFocusY", "Begin", "End", "Move", "camera-view_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
public static abstract class ZoomEvent {
|
|
private final long eventTime;
|
|
private final int focusX;
|
|
private final int focusY;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\u0018\u00002\u00020\u0001B#\u0012\b\b\u0001\u0010\u0002\u001a\u00020\u0003\u0012\b\b\u0001\u0010\u0004\u001a\u00020\u0005\u0012\b\b\u0001\u0010\u0006\u001a\u00020\u0005¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"Landroidx/camera/view/impl/ZoomGestureDetector$ZoomEvent$Begin;", "Landroidx/camera/view/impl/ZoomGestureDetector$ZoomEvent;", "eventTime", "", "focusX", "", "focusY", "(JII)V", "camera-view_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
public static final class Begin extends ZoomEvent {
|
|
public Begin(@IntRange(from = 0) long j, @IntRange(from = 0) @Px int i, @IntRange(from = 0) @Px int i2) {
|
|
super(j, i, i2, null);
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0007\n\u0002\b\u0004\u0018\u00002\u00020\u0001B-\u0012\b\b\u0001\u0010\u0002\u001a\u00020\u0003\u0012\b\b\u0001\u0010\u0004\u001a\u00020\u0005\u0012\b\b\u0001\u0010\u0006\u001a\u00020\u0005\u0012\b\b\u0001\u0010\u0007\u001a\u00020\b¢\u0006\u0002\u0010\tR\u0011\u0010\u0007\u001a\u00020\b¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000b¨\u0006\f"}, d2 = {"Landroidx/camera/view/impl/ZoomGestureDetector$ZoomEvent$End;", "Landroidx/camera/view/impl/ZoomGestureDetector$ZoomEvent;", "eventTime", "", "focusX", "", "focusY", "incrementalScaleFactor", "", "(JIIF)V", "getIncrementalScaleFactor", "()F", "camera-view_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
public static final class End extends ZoomEvent {
|
|
private final float incrementalScaleFactor;
|
|
|
|
public End(@IntRange(from = 0) long j, @IntRange(from = 0) @Px int i, @IntRange(from = 0) @Px int i2, @FloatRange(from = 0.0d, fromInclusive = false) float f) {
|
|
super(j, i, i2, null);
|
|
this.incrementalScaleFactor = f;
|
|
}
|
|
|
|
public final float getIncrementalScaleFactor() {
|
|
return this.incrementalScaleFactor;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0007\n\u0002\b\u0004\u0018\u00002\u00020\u0001B-\u0012\b\b\u0001\u0010\u0002\u001a\u00020\u0003\u0012\b\b\u0001\u0010\u0004\u001a\u00020\u0005\u0012\b\b\u0001\u0010\u0006\u001a\u00020\u0005\u0012\b\b\u0001\u0010\u0007\u001a\u00020\b¢\u0006\u0002\u0010\tR\u0011\u0010\u0007\u001a\u00020\b¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000b¨\u0006\f"}, d2 = {"Landroidx/camera/view/impl/ZoomGestureDetector$ZoomEvent$Move;", "Landroidx/camera/view/impl/ZoomGestureDetector$ZoomEvent;", "eventTime", "", "focusX", "", "focusY", "incrementalScaleFactor", "", "(JIIF)V", "getIncrementalScaleFactor", "()F", "camera-view_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
public static final class Move extends ZoomEvent {
|
|
private final float incrementalScaleFactor;
|
|
|
|
public Move(@IntRange(from = 0) long j, @IntRange(from = 0) @Px int i, @IntRange(from = 0) @Px int i2, @FloatRange(from = 0.0d, fromInclusive = false) float f) {
|
|
super(j, i, i2, null);
|
|
this.incrementalScaleFactor = f;
|
|
}
|
|
|
|
public final float getIncrementalScaleFactor() {
|
|
return this.incrementalScaleFactor;
|
|
}
|
|
}
|
|
|
|
private ZoomEvent(@IntRange(from = 0) long j, @IntRange(from = 0) @Px int i, @IntRange(from = 0) @Px int i2) {
|
|
this.eventTime = j;
|
|
this.focusX = i;
|
|
this.focusY = i2;
|
|
}
|
|
|
|
public final long getEventTime() {
|
|
return this.eventTime;
|
|
}
|
|
|
|
public final int getFocusX() {
|
|
return this.focusX;
|
|
}
|
|
|
|
public final int getFocusY() {
|
|
return this.focusY;
|
|
}
|
|
|
|
public /* synthetic */ ZoomEvent(long j, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(j, i, i2);
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
|
@JvmOverloads
|
|
@SuppressLint({"ExecutorRegistration"})
|
|
public ZoomGestureDetector(@NotNull Context context, @NotNull OnZoomGestureListener onZoomGestureListener) {
|
|
this(context, 0, 0, onZoomGestureListener, 6, null);
|
|
context.getClass();
|
|
onZoomGestureListener.getClass();
|
|
}
|
|
|
|
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
|
@JvmOverloads
|
|
@SuppressLint({"ExecutorRegistration"})
|
|
public ZoomGestureDetector(@NotNull Context context, @Px int i, @NotNull OnZoomGestureListener onZoomGestureListener) {
|
|
this(context, i, 0, onZoomGestureListener, 4, null);
|
|
context.getClass();
|
|
onZoomGestureListener.getClass();
|
|
}
|
|
|
|
public /* synthetic */ ZoomGestureDetector(Context context, int i, int i2, OnZoomGestureListener onZoomGestureListener, int i3, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(context, (i3 & 2) != 0 ? ViewConfiguration.get(context).getScaledTouchSlop() * 2 : i, (i3 & 4) != 0 ? 0 : i2, onZoomGestureListener);
|
|
}
|
|
}
|