package c.b.f;

import android.graphics.Rect;
import android.os.Build;
import android.util.Log;
import android.view.View;
import c.f.j.a0;
import java.lang.reflect.Method;
import java.util.WeakHashMap;

/* JADX INFO: compiled from: ViewUtils.java */
/* JADX INFO: loaded from: classes.dex */
public class i1 {
    public static Method a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final boolean f864b;

    static {
        f864b = Build.VERSION.SDK_INT >= 27;
        try {
            Method declaredMethod = View.class.getDeclaredMethod("computeFitSystemWindows", Rect.class, Rect.class);
            a = declaredMethod;
            if (declaredMethod.isAccessible()) {
                return;
            }
            a.setAccessible(true);
        } catch (NoSuchMethodException unused) {
            Log.d("ViewUtils", "Could not find method computeFitSystemWindows. Oh well.");
        }
    }

    public static void a(View view, Rect rect, Rect rect2) {
        Method method = a;
        if (method != null) {
            try {
                method.invoke(view, rect, rect2);
            } catch (Exception e2) {
                Log.d("ViewUtils", "Could not invoke computeFitSystemWindows", e2);
            }
        }
    }

    public static boolean b(View view) {
        WeakHashMap<View, c.f.j.i0> weakHashMap = c.f.j.a0.a;
        return a0.e.d(view) == 1;
    }
}
