alexandroid/decompiled/jadx/sources/androidx/appcompat/widget/ViewUtils.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

63 lines
2.4 KiB
Java

package androidx.appcompat.widget;
import android.annotation.SuppressLint;
import android.graphics.Insets;
import android.graphics.Rect;
import android.view.View;
import android.view.WindowInsets;
import androidx.annotation.ChecksSdkIntAtLeast;
import androidx.annotation.DoNotInline;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public class ViewUtils {
@ChecksSdkIntAtLeast(api = 27)
@RestrictTo({RestrictTo.Scope.LIBRARY})
static final boolean SDK_LEVEL_SUPPORTS_AUTOSIZE = true;
private static final String TAG = "ViewUtils";
private static Method sComputeFitSystemWindowsMethod;
private static boolean sInitComputeFitSystemWindowsMethod;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@RequiresApi(29)
public static class Api29Impl {
private Api29Impl() {
}
@DoNotInline
public static void computeFitSystemWindows(@NonNull View view, @NonNull Rect rect, @NonNull Rect rect2) {
Insets systemWindowInsets = view.computeSystemWindowInsets(new WindowInsets.Builder().setSystemWindowInsets(Insets.of(rect)).build(), rect2).getSystemWindowInsets();
rect.set(systemWindowInsets.left, systemWindowInsets.top, systemWindowInsets.right, systemWindowInsets.bottom);
}
}
private ViewUtils() {
}
public static void computeFitSystemWindows(@NonNull View view, @NonNull Rect rect, @NonNull Rect rect2) {
Api29Impl.computeFitSystemWindows(view, rect, rect2);
}
public static boolean isLayoutRtl(View view) {
return view.getLayoutDirection() == 1;
}
@SuppressLint({"BanUncheckedReflection"})
public static void makeOptionalFitsSystemWindows(View view) {
try {
Method method = view.getClass().getMethod("makeOptionalFitsSystemWindows", null);
if (!method.isAccessible()) {
method.setAccessible(true);
}
method.invoke(view, null);
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException unused) {
}
}
}