mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-18 11:57:18 +01:00
63 lines
2 KiB
Java
63 lines
2 KiB
Java
package androidx.transition;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.graphics.Matrix;
|
|
import android.widget.ImageView;
|
|
import androidx.annotation.DoNotInline;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.RequiresApi;
|
|
import java.lang.reflect.Field;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes14.dex */
|
|
class ImageViewUtils {
|
|
private static Field sDrawMatrixField = null;
|
|
private static boolean sDrawMatrixFieldFetched = false;
|
|
private static boolean sTryHiddenAnimateTransform = true;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@RequiresApi(29)
|
|
public static class Api29Impl {
|
|
private Api29Impl() {
|
|
}
|
|
|
|
@DoNotInline
|
|
public static void animateTransform(ImageView imageView, Matrix matrix) {
|
|
imageView.animateTransform(matrix);
|
|
}
|
|
}
|
|
|
|
private ImageViewUtils() {
|
|
}
|
|
|
|
public static void animateTransform(@NonNull ImageView imageView, @Nullable Matrix matrix) {
|
|
Api29Impl.animateTransform(imageView, matrix);
|
|
}
|
|
|
|
@SuppressLint({"SoonBlockedPrivateApi"})
|
|
private static void fetchDrawMatrixField() {
|
|
if (sDrawMatrixFieldFetched) {
|
|
return;
|
|
}
|
|
try {
|
|
Field declaredField = ImageView.class.getDeclaredField("mDrawMatrix");
|
|
sDrawMatrixField = declaredField;
|
|
declaredField.setAccessible(true);
|
|
} catch (NoSuchFieldException unused) {
|
|
}
|
|
sDrawMatrixFieldFetched = true;
|
|
}
|
|
|
|
@RequiresApi(21)
|
|
@SuppressLint({"NewApi"})
|
|
private static void hiddenAnimateTransform(@NonNull ImageView imageView, @Nullable Matrix matrix) {
|
|
if (sTryHiddenAnimateTransform) {
|
|
try {
|
|
Api29Impl.animateTransform(imageView, matrix);
|
|
} catch (NoSuchMethodError unused) {
|
|
sTryHiddenAnimateTransform = false;
|
|
}
|
|
}
|
|
}
|
|
}
|