package X6FRs_4.JZJr_16;

import android.graphics.Matrix;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* compiled from: GhostViewApi21.java */
/* loaded from: classes.dex */
public class IFxWkV_5 implements IMuAHx_6 {
    public static Class<?> KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public static Method f567KQgRr5e_0;

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public static boolean f3129Mqv2r_3;
    public static boolean PGPF6hQ_2;
    public static Method QxJ9d_1;

    /* renamed from: QxJ9d_1  reason: collision with other field name */
    public static boolean f568QxJ9d_1;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final View f569KQgRr5e_0;

    public IFxWkV_5(View view) {
        this.f569KQgRr5e_0 = view;
    }

    public static IMuAHx_6 KQgRr5e_0(View view, ViewGroup viewGroup, Matrix matrix) {
        KQgRr5e_0();
        Method method = f567KQgRr5e_0;
        if (method != null) {
            try {
                return new IFxWkV_5((View) method.invoke(null, view, viewGroup, matrix));
            } catch (IllegalAccessException unused) {
            } catch (InvocationTargetException e) {
                throw new RuntimeException(e.getCause());
            }
        }
        return null;
    }

    public static void PGPF6hQ_2() {
        if (f3129Mqv2r_3) {
            return;
        }
        try {
            QxJ9d_1();
            Method declaredMethod = KQgRr5e_0.getDeclaredMethod("removeGhost", View.class);
            QxJ9d_1 = declaredMethod;
            declaredMethod.setAccessible(true);
        } catch (NoSuchMethodException e) {
            Log.i("GhostViewApi21", "Failed to retrieve removeGhost method", e);
        }
        f3129Mqv2r_3 = true;
    }

    public static void QxJ9d_1() {
        if (f568QxJ9d_1) {
            return;
        }
        try {
            KQgRr5e_0 = Class.forName("android.view.GhostView");
        } catch (ClassNotFoundException e) {
            Log.i("GhostViewApi21", "Failed to retrieve GhostView class", e);
        }
        f568QxJ9d_1 = true;
    }

    @Override // X6FRs_4.JZJr_16.IMuAHx_6
    public void KQgRr5e_0(ViewGroup viewGroup, View view) {
    }

    @Override // X6FRs_4.JZJr_16.IMuAHx_6
    public void setVisibility(int i) {
        this.f569KQgRr5e_0.setVisibility(i);
    }

    public static void KQgRr5e_0(View view) {
        PGPF6hQ_2();
        Method method = QxJ9d_1;
        if (method != null) {
            try {
                method.invoke(null, view);
            } catch (IllegalAccessException unused) {
            } catch (InvocationTargetException e) {
                throw new RuntimeException(e.getCause());
            }
        }
    }

    public static void KQgRr5e_0() {
        if (PGPF6hQ_2) {
            return;
        }
        try {
            QxJ9d_1();
            Method declaredMethod = KQgRr5e_0.getDeclaredMethod("addGhost", View.class, ViewGroup.class, Matrix.class);
            f567KQgRr5e_0 = declaredMethod;
            declaredMethod.setAccessible(true);
        } catch (NoSuchMethodException e) {
            Log.i("GhostViewApi21", "Failed to retrieve addGhost method", e);
        }
        PGPF6hQ_2 = true;
    }
}
