Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8727a731 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "A little cleanup." into jb-mr1-dev

parents 47b2efc7 1b8ecc50
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3353,6 +3353,7 @@ package android.app {
    method public final android.app.FragmentManager getFragmentManager();
    method public final int getId();
    method public android.app.LoaderManager getLoaderManager();
    method public final android.app.Fragment getParentFragment();
    method public final android.content.res.Resources getResources();
    method public final boolean getRetainInstance();
    method public final java.lang.String getString(int);
+43 −24
Original line number Diff line number Diff line
@@ -831,6 +831,14 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
        return mChildFragmentManager;
    }

    /**
     * Returns the parent Fragment containing this Fragment.  If this Fragment
     * is attached directly to an Activity, returns null.
     */
    final public Fragment getParentFragment() {
        return mParentFragment;
    }

    /**
     * Return true if the fragment is currently added to its activity.
     */
@@ -1181,19 +1189,6 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
        mCalled = true;
    }

    /**
     * Called immediately after {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}
     * has returned, but before any saved state has been restored in to the view.
     * This gives subclasses a chance to initialize themselves once
     * they know their view hierarchy has been completely created.  The fragment's
     * view hierarchy is not however attached to its parent at this point.
     * @param view The View returned by {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}.
     * @param savedInstanceState If non-null, this fragment is being re-constructed
     * from a previous saved state as given here.
     */
    public void onViewCreated(View view, Bundle savedInstanceState) {
    }
    
    /**
     * Called to have the fragment instantiate its user interface view.
     * This is optional, and non-graphical fragments can return null (which
@@ -1218,6 +1213,19 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
        return null;
    }

    /**
     * Called immediately after {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}
     * has returned, but before any saved state has been restored in to the view.
     * This gives subclasses a chance to initialize themselves once
     * they know their view hierarchy has been completely created.  The fragment's
     * view hierarchy is not however attached to its parent at this point.
     * @param view The View returned by {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}.
     * @param savedInstanceState If non-null, this fragment is being re-constructed
     * from a previous saved state as given here.
     */
    public void onViewCreated(View view, Bundle savedInstanceState) {
    }
    
    /**
     * Get the root view for the fragment's layout (the one returned by {@link #onCreateView}),
     * if provided.
@@ -1590,10 +1598,6 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
            writer.print(prefix); writer.print("mActivity=");
                    writer.println(mActivity);
        }
        if (mChildFragmentManager != null) {
            writer.print(prefix); writer.print("mChildFragmentManager=");
                    writer.println(mChildFragmentManager);
        }
        if (mParentFragment != null) {
            writer.print(prefix); writer.print("mParentFragment=");
                    writer.println(mParentFragment);
@@ -1633,7 +1637,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
            mLoaderManager.dump(prefix + "  ", fd, writer, args);
        }
        if (mChildFragmentManager != null) {
            writer.print(prefix); writer.println("Child Fragment Manager:");
            writer.print(prefix); writer.println("Child " + mChildFragmentManager + ":");
            mChildFragmentManager.dump(prefix + "  ", fd, writer, args);
        }
    }
@@ -1662,6 +1666,9 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
    }

    void performCreate(Bundle savedInstanceState) {
        if (mChildFragmentManager != null) {
            mChildFragmentManager.noteStateNotSaved();
        }
        mCalled = false;
        onCreate(savedInstanceState);
        if (!mCalled) {
@@ -1680,7 +1687,18 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
        }
    }

    View performCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        if (mChildFragmentManager != null) {
            mChildFragmentManager.noteStateNotSaved();
        }
        return onCreateView(inflater, container, savedInstanceState);
    }

    void performActivityCreated(Bundle savedInstanceState) {
        if (mChildFragmentManager != null) {
            mChildFragmentManager.noteStateNotSaved();
        }
        mCalled = false;
        onActivityCreated(savedInstanceState);
        if (!mCalled) {
@@ -1713,6 +1731,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene

    void performResume() {
        if (mChildFragmentManager != null) {
            mChildFragmentManager.noteStateNotSaved();
            mChildFragmentManager.execPendingActions();
        }
        mCalled = false;
+9 −7
Original line number Diff line number Diff line
@@ -834,7 +834,9 @@ final class FragmentManagerImpl extends FragmentManager {
                        throw new SuperNotCalledException("Fragment " + f
                                + " did not call through to super.onAttach()");
                    }
                    if (f.mParentFragment == null) {
                        mActivity.onAttachFragment(f);
                    }

                    if (!f.mRetaining) {
                        f.performCreate(f.mSavedFragmentState);
@@ -844,8 +846,8 @@ final class FragmentManagerImpl extends FragmentManager {
                        // For fragments that are part of the content view
                        // layout, we need to instantiate the view immediately
                        // and the inflater will take care of adding it.
                        f.mView = f.onCreateView(f.getLayoutInflater(f.mSavedFragmentState),
                                null, f.mSavedFragmentState);
                        f.mView = f.performCreateView(f.getLayoutInflater(
                                f.mSavedFragmentState), null, f.mSavedFragmentState);
                        if (f.mView != null) {
                            f.mView.setSaveFromParentEnabled(false);
                            if (f.mHidden) f.mView.setVisibility(View.GONE);
@@ -868,8 +870,8 @@ final class FragmentManagerImpl extends FragmentManager {
                                }
                            }
                            f.mContainer = container;
                            f.mView = f.onCreateView(f.getLayoutInflater(f.mSavedFragmentState),
                                    container, f.mSavedFragmentState);
                            f.mView = f.performCreateView(f.getLayoutInflater(
                                    f.mSavedFragmentState), container, f.mSavedFragmentState);
                            if (f.mView != null) {
                                f.mView.setSaveFromParentEnabled(false);
                                if (container != null) {