51 lines
1.7 KiB
Java
51 lines
1.7 KiB
Java
|
package androidx.transition;
|
||
|
|
||
|
import android.annotation.SuppressLint;
|
||
|
import android.graphics.Matrix;
|
||
|
import android.view.View;
|
||
|
import androidx.annotation.NonNull;
|
||
|
import androidx.annotation.Nullable;
|
||
|
import androidx.annotation.RequiresApi;
|
||
|
@RequiresApi(21)
|
||
|
public class ViewUtilsApi21 extends ViewUtilsApi19 {
|
||
|
private static boolean sTryHiddenSetAnimationMatrix = true;
|
||
|
private static boolean sTryHiddenTransformMatrixToGlobal = true;
|
||
|
private static boolean sTryHiddenTransformMatrixToLocal = true;
|
||
|
|
||
|
@Override // androidx.transition.ViewUtilsBase
|
||
|
@SuppressLint({"NewApi"})
|
||
|
public void setAnimationMatrix(@NonNull View view, @Nullable Matrix matrix) {
|
||
|
if (sTryHiddenSetAnimationMatrix) {
|
||
|
try {
|
||
|
view.setAnimationMatrix(matrix);
|
||
|
} catch (NoSuchMethodError unused) {
|
||
|
sTryHiddenSetAnimationMatrix = false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // androidx.transition.ViewUtilsBase
|
||
|
@SuppressLint({"NewApi"})
|
||
|
public void transformMatrixToGlobal(@NonNull View view, @NonNull Matrix matrix) {
|
||
|
if (sTryHiddenTransformMatrixToGlobal) {
|
||
|
try {
|
||
|
view.transformMatrixToGlobal(matrix);
|
||
|
} catch (NoSuchMethodError unused) {
|
||
|
sTryHiddenTransformMatrixToGlobal = false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // androidx.transition.ViewUtilsBase
|
||
|
@SuppressLint({"NewApi"})
|
||
|
public void transformMatrixToLocal(@NonNull View view, @NonNull Matrix matrix) {
|
||
|
if (sTryHiddenTransformMatrixToLocal) {
|
||
|
try {
|
||
|
view.transformMatrixToLocal(matrix);
|
||
|
} catch (NoSuchMethodError unused) {
|
||
|
sTryHiddenTransformMatrixToLocal = false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|