content: package androidx.transition;
  
  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;
  
  class GhostViewPlatform implements GhostView {
      private static final String TAG = "GhostViewApi21";
      private static Method sAddGhostMethod;
      private static boolean sAddGhostMethodFetched;
      private static Class<?> sGhostViewClass;
      private static boolean sGhostViewClassFetched;
      private static Method sRemoveGhostMethod;
      private static boolean sRemoveGhostMethodFetched;
      private final View mGhostView;
  
      private GhostViewPlatform(View ghostView) {
          this.mGhostView = ghostView;
      }
  
      static GhostView addGhost(View view, ViewGroup viewGroup, Matrix matrix) {
          fetchAddGhostMethod();
          Method method = sAddGhostMethod;
          if (method != null) {
              try {
                  return new GhostViewPlatform((View) method.invoke((Object) null, new Object[]{view, viewGroup, matrix}));
              } catch (IllegalAccessException e) {
              } catch (InvocationTargetException e2) {
                  throw new RuntimeException(e2.getCause());
              }
          }
          return null;
      }
  
      private static void fetchAddGhostMethod() {
          if (!sAddGhostMethodFetched) {
              try {
                  fetchGhostViewClass();
                  Method declaredMethod = sGhostViewClass.getDeclaredMethod("addGhost", new Class[]{View.class, ViewGroup.class, Matrix.class});
                  sAddGhostMethod = declaredMethod;
                  declaredMethod.setAccessible(true);
              } catch (NoSuchMethodException e) {
                  Log.i(TAG, "Failed to retrieve addGhost method", e);
              }
              sAddGhostMethodFetched = true;
          }
      }
  
      private static void fetchGhostViewClass() {
          if (!sGhostViewClassFetched) {
              try {
                  sGhostViewClass = Class.forName("android.view.GhostView");
              } catch (ClassNotFoundException e) {
                  Log.i(TAG, "Failed to retrieve GhostView class", e);
              }
              sGhostViewClassFetched = true;
          }
      }
  
      private static void fetchRemoveGhostMethod() {
          if (!sRemoveGhostMethodFetched) {
              try {
                  fetchGhostViewClass();
                  Method declaredMethod = sGhostViewClass.getDeclaredMethod("removeGhost", new Class[]{View.class});
                  sRemoveGhostMethod = declaredMethod;
                  declaredMethod.setAccessible(true);
              } catch (NoSuchMethodException e) {
                  Log.i(TAG, "Failed to retrieve removeGhost method", e);
              }
              sRemoveGhostMethodFetched = true;
          }
      }
  
      static void removeGhost(View view) {
          fetchRemoveGhostMethod();
          Method method = sRemoveGhostMethod;
          if (method != null) {
              try {
                  method.invoke((Object) null, new Object[]{view});
              } catch (IllegalAccessException e) {
              } catch (InvocationTargetException e2) {
                  throw new RuntimeException(e2.getCause());
              }
          }
      }
  
      public void reserveEndViewTransition(ViewGroup viewGroup, View view) {
      }
  
      public void setVisibility(int visibility) {
          this.mGhostView.setVisibility(visibility);
      }
  }
  