content: package androidx.fragment.app;
  
  import android.os.Parcelable;
  import android.view.View;
  import android.view.ViewGroup;
  import androidx.lifecycle.Lifecycle;
  import androidx.viewpager.widget.PagerAdapter;
  import mt.Log1F380D;
  
  @Deprecated
  /* compiled from: 007A */
  public abstract class FragmentPagerAdapter extends PagerAdapter {
      public static final int BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT = 1;
      @Deprecated
      public static final int BEHAVIOR_SET_USER_VISIBLE_HINT = 0;
      private static final boolean DEBUG = false;
      private static final String TAG = "FragmentPagerAdapter";
      private final int mBehavior;
      private FragmentTransaction mCurTransaction;
      private Fragment mCurrentPrimaryItem;
      private boolean mExecutingFinishUpdate;
      private final FragmentManager mFragmentManager;
  
      @Deprecated
      public FragmentPagerAdapter(FragmentManager fm) {
          this(fm, 0);
      }
  
      public FragmentPagerAdapter(FragmentManager fm, int behavior) {
          this.mCurTransaction = null;
          this.mCurrentPrimaryItem = null;
          this.mFragmentManager = fm;
          this.mBehavior = behavior;
      }
  
      private static String makeFragmentName(int viewId, long id) {
          return "android:switcher:" + viewId + ":" + id;
      }
  
      public void destroyItem(ViewGroup container, int position, Object object) {
          Fragment fragment = (Fragment) object;
          if (this.mCurTransaction == null) {
              this.mCurTransaction = this.mFragmentManager.beginTransaction();
          }
          this.mCurTransaction.detach(fragment);
          if (fragment.equals(this.mCurrentPrimaryItem)) {
              this.mCurrentPrimaryItem = null;
          }
      }
  
      /* JADX INFO: finally extract failed */
      public void finishUpdate(ViewGroup container) {
          FragmentTransaction fragmentTransaction = this.mCurTransaction;
          if (fragmentTransaction != null) {
              if (!this.mExecutingFinishUpdate) {
                  try {
                      this.mExecutingFinishUpdate = true;
                      fragmentTransaction.commitNowAllowingStateLoss();
                      this.mExecutingFinishUpdate = false;
                  } catch (Throwable th) {
                      this.mExecutingFinishUpdate = false;
                      throw th;
                  }
              }
              this.mCurTransaction = null;
          }
      }
  
      public abstract Fragment getItem(int i);
  
      public long getItemId(int position) {
          return (long) position;
      }
  
      public Object instantiateItem(ViewGroup container, int position) {
          if (this.mCurTransaction == null) {
              this.mCurTransaction = this.mFragmentManager.beginTransaction();
          }
          long itemId = getItemId(position);
          String makeFragmentName = makeFragmentName(container.getId(), itemId);
          Log1F380D.a((Object) makeFragmentName);
          Fragment findFragmentByTag = this.mFragmentManager.findFragmentByTag(makeFragmentName);
          if (findFragmentByTag != null) {
              this.mCurTransaction.attach(findFragmentByTag);
          } else {
              findFragmentByTag = getItem(position);
              FragmentTransaction fragmentTransaction = this.mCurTransaction;
              int id = container.getId();
              String makeFragmentName2 = makeFragmentName(container.getId(), itemId);
              Log1F380D.a((Object) makeFragmentName2);
              fragmentTransaction.add(id, findFragmentByTag, makeFragmentName2);
          }
          if (findFragmentByTag != this.mCurrentPrimaryItem) {
              findFragmentByTag.setMenuVisibility(false);
              if (this.mBehavior == 1) {
                  this.mCurTransaction.setMaxLifecycle(findFragmentByTag, Lifecycle.State.STARTED);
              } else {
                  findFragmentByTag.setUserVisibleHint(false);
              }
          }
          return findFragmentByTag;
      }
  
      public boolean isViewFromObject(View view, Object object) {
          return ((Fragment) object).getView() == view;
      }
  
      public void restoreState(Parcelable state, ClassLoader loader) {
      }
  
      public Parcelable saveState() {
          return null;
      }
  
      public void setPrimaryItem(ViewGroup container, int position, Object object) {
          Fragment fragment = (Fragment) object;
          Fragment fragment2 = this.mCurrentPrimaryItem;
          if (fragment != fragment2) {
              if (fragment2 != null) {
                  fragment2.setMenuVisibility(false);
                  if (this.mBehavior == 1) {
                      if (this.mCurTransaction == null) {
                          this.mCurTransaction = this.mFragmentManager.beginTransaction();
                      }
                      this.mCurTransaction.setMaxLifecycle(this.mCurrentPrimaryItem, Lifecycle.State.STARTED);
                  } else {
                      this.mCurrentPrimaryItem.setUserVisibleHint(false);
                  }
              }
              fragment.setMenuVisibility(true);
              if (this.mBehavior == 1) {
                  if (this.mCurTransaction == null) {
                      this.mCurTransaction = this.mFragmentManager.beginTransaction();
                  }
                  this.mCurTransaction.setMaxLifecycle(fragment, Lifecycle.State.RESUMED);
              } else {
                  fragment.setUserVisibleHint(true);
              }
              this.mCurrentPrimaryItem = fragment;
          }
      }
  
      public void startUpdate(ViewGroup container) {
          if (container.getId() == -1) {
              throw new IllegalStateException("ViewPager with adapter " + this + " requires a view id");
          }
      }
  }
  