98 lines
3.0 KiB
Java
98 lines
3.0 KiB
Java
package androidx.transition;
|
|
|
|
import android.graphics.Matrix;
|
|
import android.graphics.Rect;
|
|
import android.os.Build;
|
|
import android.util.Property;
|
|
import android.view.View;
|
|
import androidx.core.view.ViewCompat;
|
|
|
|
/* loaded from: classes.dex */
|
|
class ViewUtils {
|
|
static final Property<View, Rect> CLIP_BOUNDS;
|
|
private static final ViewUtilsBase IMPL;
|
|
private static final String TAG = "ViewUtils";
|
|
static final Property<View, Float> TRANSITION_ALPHA;
|
|
|
|
static {
|
|
if (Build.VERSION.SDK_INT >= 29) {
|
|
IMPL = new ViewUtilsApi29();
|
|
} else if (Build.VERSION.SDK_INT >= 23) {
|
|
IMPL = new ViewUtilsApi23();
|
|
} else if (Build.VERSION.SDK_INT >= 22) {
|
|
IMPL = new ViewUtilsApi22();
|
|
} else {
|
|
IMPL = new ViewUtilsApi21();
|
|
}
|
|
TRANSITION_ALPHA = new Property<View, Float>(Float.class, "translationAlpha") { // from class: androidx.transition.ViewUtils.1
|
|
@Override // android.util.Property
|
|
public Float get(View view) {
|
|
return Float.valueOf(ViewUtils.getTransitionAlpha(view));
|
|
}
|
|
|
|
@Override // android.util.Property
|
|
public void set(View view, Float f) {
|
|
ViewUtils.setTransitionAlpha(view, f.floatValue());
|
|
}
|
|
};
|
|
CLIP_BOUNDS = new Property<View, Rect>(Rect.class, "clipBounds") { // from class: androidx.transition.ViewUtils.2
|
|
@Override // android.util.Property
|
|
public Rect get(View view) {
|
|
return ViewCompat.getClipBounds(view);
|
|
}
|
|
|
|
@Override // android.util.Property
|
|
public void set(View view, Rect rect) {
|
|
ViewCompat.setClipBounds(view, rect);
|
|
}
|
|
};
|
|
}
|
|
|
|
static ViewOverlayImpl getOverlay(View view) {
|
|
return new ViewOverlayApi18(view);
|
|
}
|
|
|
|
static WindowIdImpl getWindowId(View view) {
|
|
return new WindowIdApi18(view);
|
|
}
|
|
|
|
static void setTransitionAlpha(View view, float f) {
|
|
IMPL.setTransitionAlpha(view, f);
|
|
}
|
|
|
|
static float getTransitionAlpha(View view) {
|
|
return IMPL.getTransitionAlpha(view);
|
|
}
|
|
|
|
static void saveNonTransitionAlpha(View view) {
|
|
IMPL.saveNonTransitionAlpha(view);
|
|
}
|
|
|
|
static void clearNonTransitionAlpha(View view) {
|
|
IMPL.clearNonTransitionAlpha(view);
|
|
}
|
|
|
|
static void setTransitionVisibility(View view, int i) {
|
|
IMPL.setTransitionVisibility(view, i);
|
|
}
|
|
|
|
static void transformMatrixToGlobal(View view, Matrix matrix) {
|
|
IMPL.transformMatrixToGlobal(view, matrix);
|
|
}
|
|
|
|
static void transformMatrixToLocal(View view, Matrix matrix) {
|
|
IMPL.transformMatrixToLocal(view, matrix);
|
|
}
|
|
|
|
static void setAnimationMatrix(View view, Matrix matrix) {
|
|
IMPL.setAnimationMatrix(view, matrix);
|
|
}
|
|
|
|
static void setLeftTopRightBottom(View view, int i, int i2, int i3, int i4) {
|
|
IMPL.setLeftTopRightBottom(view, i, i2, i3, i4);
|
|
}
|
|
|
|
private ViewUtils() {
|
|
}
|
|
}
|