alexandroid/decompiled/jadx/sources/androidx/constraintlayout/motion/utils/CustomSupport.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

122 lines
6.4 KiB
Java

package androidx.constraintlayout.motion.utils;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;
import androidx.constraintlayout.motion.widget.Debug;
import androidx.constraintlayout.widget.ConstraintAttribute;
import com.amazon.rtcsc.service.deviceconfiguration.util.DeviceConfigConstants;
import com.amazon.whisperjoin.devicesetupserviceandroidclient.Constants;
import defpackage.a$$ExternalSyntheticOutline0;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes13.dex */
public class CustomSupport {
private static final boolean DEBUG = false;
private static final String TAG = "CustomSupport";
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* renamed from: androidx.constraintlayout.motion.utils.CustomSupport$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] $SwitchMap$androidx$constraintlayout$widget$ConstraintAttribute$AttributeType;
static {
int[] iArr = new int[ConstraintAttribute.AttributeType.values().length];
$SwitchMap$androidx$constraintlayout$widget$ConstraintAttribute$AttributeType = iArr;
try {
iArr[ConstraintAttribute.AttributeType.INT_TYPE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$androidx$constraintlayout$widget$ConstraintAttribute$AttributeType[ConstraintAttribute.AttributeType.FLOAT_TYPE.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
$SwitchMap$androidx$constraintlayout$widget$ConstraintAttribute$AttributeType[ConstraintAttribute.AttributeType.COLOR_DRAWABLE_TYPE.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
$SwitchMap$androidx$constraintlayout$widget$ConstraintAttribute$AttributeType[ConstraintAttribute.AttributeType.COLOR_TYPE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
$SwitchMap$androidx$constraintlayout$widget$ConstraintAttribute$AttributeType[ConstraintAttribute.AttributeType.STRING_TYPE.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
$SwitchMap$androidx$constraintlayout$widget$ConstraintAttribute$AttributeType[ConstraintAttribute.AttributeType.BOOLEAN_TYPE.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
$SwitchMap$androidx$constraintlayout$widget$ConstraintAttribute$AttributeType[ConstraintAttribute.AttributeType.DIMENSION_TYPE.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
}
}
private static int clamp(int i) {
int i2 = (i & (~(i >> 31))) + Constants.RSSI_MIN;
return (i2 & (i2 >> 31)) + 255;
}
public static void setInterpolatedValue(ConstraintAttribute constraintAttribute, View view, float[] fArr) {
Class<?> cls = view.getClass();
String str = "set" + constraintAttribute.getName();
try {
int i = AnonymousClass1.$SwitchMap$androidx$constraintlayout$widget$ConstraintAttribute$AttributeType[constraintAttribute.getType().ordinal()];
Class cls2 = Integer.TYPE;
Class cls3 = Float.TYPE;
boolean z = true;
switch (i) {
case 1:
cls.getMethod(str, cls2).invoke(view, Integer.valueOf((int) fArr[0]));
return;
case 2:
cls.getMethod(str, cls3).invoke(view, Float.valueOf(fArr[0]));
return;
case 3:
Method method = cls.getMethod(str, Drawable.class);
int clamp = (clamp((int) (((float) Math.pow(fArr[0], 0.45454545454545453d)) * 255.0f)) << 16) | (clamp((int) (fArr[3] * 255.0f)) << 24) | (clamp((int) (((float) Math.pow(fArr[1], 0.45454545454545453d)) * 255.0f)) << 8) | clamp((int) (((float) Math.pow(fArr[2], 0.45454545454545453d)) * 255.0f));
ColorDrawable colorDrawable = new ColorDrawable();
colorDrawable.setColor(clamp);
method.invoke(view, colorDrawable);
return;
case 4:
cls.getMethod(str, cls2).invoke(view, Integer.valueOf((clamp((int) (((float) Math.pow(fArr[0], 0.45454545454545453d)) * 255.0f)) << 16) | (clamp((int) (fArr[3] * 255.0f)) << 24) | (clamp((int) (((float) Math.pow(fArr[1], 0.45454545454545453d)) * 255.0f)) << 8) | clamp((int) (((float) Math.pow(fArr[2], 0.45454545454545453d)) * 255.0f))));
return;
case 5:
throw new RuntimeException("unable to interpolate strings " + constraintAttribute.getName());
case 6:
Method method2 = cls.getMethod(str, Boolean.TYPE);
if (fArr[0] <= 0.5f) {
z = false;
}
method2.invoke(view, Boolean.valueOf(z));
return;
case 7:
cls.getMethod(str, cls3).invoke(view, Float.valueOf(fArr[0]));
return;
default:
return;
}
} catch (IllegalAccessException e) {
StringBuilder m2m = a$$ExternalSyntheticOutline0.m2m("Cannot access method ", str, " on View \"");
m2m.append(Debug.getName(view));
m2m.append(DeviceConfigConstants.DOUBLE_QUOTE);
Log.e(TAG, m2m.toString(), e);
} catch (NoSuchMethodException e2) {
StringBuilder m2m2 = a$$ExternalSyntheticOutline0.m2m("No method ", str, " on View \"");
m2m2.append(Debug.getName(view));
m2m2.append(DeviceConfigConstants.DOUBLE_QUOTE);
Log.e(TAG, m2m2.toString(), e2);
} catch (InvocationTargetException e3) {
StringBuilder m2m3 = a$$ExternalSyntheticOutline0.m2m("Cannot invoke method ", str, " on View \"");
m2m3.append(Debug.getName(view));
m2m3.append(DeviceConfigConstants.DOUBLE_QUOTE);
Log.e(TAG, m2m3.toString(), e3);
}
}
}