Loading api/current.xml +11 −0 Original line number Diff line number Diff line Loading @@ -30614,6 +30614,17 @@ visibility="public" > </method> <method name="isDetached" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > </method> <method name="isHidden" return="boolean" abstract="false" core/java/android/app/Activity.java +3 −1 Original line number Diff line number Diff line Loading @@ -4413,7 +4413,9 @@ public class Activity extends ContextThemeWrapper mFragments.dispatchStart(); if (mAllLoaderManagers != null) { for (int i=mAllLoaderManagers.size()-1; i>=0; i--) { mAllLoaderManagers.valueAt(i).finishRetain(); LoaderManagerImpl lm = mAllLoaderManagers.valueAt(i); lm.finishRetain(); lm.doReportStart(); } } } Loading core/java/android/app/Fragment.java +52 −5 Original line number Diff line number Diff line Loading @@ -587,11 +587,6 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener mWho = "android:fragment:" + mIndex; } final void clearIndex() { mIndex = -1; mWho = null; } final boolean isInBackStack() { return mBackStackNesting > 0; } Loading Loading @@ -782,6 +777,15 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener return mActivity != null && mAdded; } /** * Return true if the fragment has been explicitly detached from the UI. * That is, {@link FragmentTransaction#detach(Fragment) * FragmentTransaction.detach(Fragment)} has been used on it. */ final public boolean isDetached() { return mDetached; } /** * Return true if this fragment is currently being removed from its * activity. This is <em>not</em> whether its activity is finishing, but Loading Loading @@ -1202,6 +1206,35 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener } } /** * Called by the fragment manager once this fragment has been removed, * so that we don't have any left-over state if the application decides * to re-use the instance. This only clears state that the framework * internally manages, not things the application sets. */ void initState() { mIndex = -1; mWho = null; mAdded = false; mRemoving = false; mResumed = false; mFromLayout = false; mInLayout = false; mRestored = false; mBackStackNesting = 0; mFragmentManager = null; mActivity = mImmediateActivity = null; mFragmentId = 0; mContainerId = 0; mTag = null; mHidden = false; mDetached = false; mRetaining = false; mLoaderManager = null; mLoadersStarted = false; mCheckedForLoaderManager = false; } /** * Called when the fragment is no longer attached to its activity. This * is called after {@link #onDestroy()}. Loading Loading @@ -1429,6 +1462,13 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener } } void performStart() { onStart(); if (mLoaderManager != null) { mLoaderManager.doReportStart(); } } void performStop() { onStop(); Loading @@ -1447,4 +1487,11 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener } } } void performDestroyView() { onDestroyView(); if (mLoaderManager != null) { mLoaderManager.doReportNextStart(); } } } core/java/android/app/FragmentManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -803,7 +803,7 @@ final class FragmentManagerImpl extends FragmentManager { if (newState > Fragment.STOPPED) { if (DEBUG) Log.v(TAG, "moveto STARTED: " + f); f.mCalled = false; f.onStart(); f.performStart(); if (!f.mCalled) { throw new SuperNotCalledException("Fragment " + f + " did not call through to super.onStart()"); Loading Loading @@ -856,7 +856,7 @@ final class FragmentManagerImpl extends FragmentManager { } } f.mCalled = false; f.onDestroyView(); f.performDestroyView(); if (!f.mCalled) { throw new SuperNotCalledException("Fragment " + f + " did not call through to super.onDestroyView()"); Loading Loading @@ -1006,7 +1006,7 @@ final class FragmentManagerImpl extends FragmentManager { } mAvailIndices.add(f.mIndex); mActivity.invalidateFragmentIndex(f.mIndex); f.clearIndex(); f.initState(); } public void addFragment(Fragment fragment, boolean moveToStateNow) { Loading core/java/android/app/ListFragment.java +20 −4 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ public class ListFragment extends Fragment { TextView mStandardEmptyView; View mProgressContainer; View mListContainer; boolean mSetEmptyText; CharSequence mEmptyText; boolean mListShown; public ListFragment() { Loading Loading @@ -210,6 +210,9 @@ public class ListFragment extends Fragment { public void onDestroyView() { mHandler.removeCallbacks(mRequestFocus); mList = null; mListShown = false; mEmptyView = mProgressContainer = mListContainer = null; mStandardEmptyView = null; super.onDestroyView(); } Loading Loading @@ -289,10 +292,10 @@ public class ListFragment extends Fragment { throw new IllegalStateException("Can't be used with a custom content view"); } mStandardEmptyView.setText(text); if (!mSetEmptyText) { if (mEmptyText == null) { mList.setEmptyView(mStandardEmptyView); mSetEmptyText = true; } mEmptyText = text; } /** Loading Loading @@ -346,6 +349,9 @@ public class ListFragment extends Fragment { getActivity(), android.R.anim.fade_out)); mListContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_in)); } else { mProgressContainer.clearAnimation(); mListContainer.clearAnimation(); } mProgressContainer.setVisibility(View.GONE); mListContainer.setVisibility(View.VISIBLE); Loading @@ -355,6 +361,9 @@ public class ListFragment extends Fragment { getActivity(), android.R.anim.fade_in)); mListContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_out)); } else { mProgressContainer.clearAnimation(); mListContainer.clearAnimation(); } mProgressContainer.setVisibility(View.VISIBLE); mListContainer.setVisibility(View.GONE); Loading Loading @@ -383,6 +392,8 @@ public class ListFragment extends Fragment { com.android.internal.R.id.internalEmpty); if (mStandardEmptyView == null) { mEmptyView = root.findViewById(android.R.id.empty); } else { mStandardEmptyView.setVisibility(View.GONE); } mProgressContainer = root.findViewById(com.android.internal.R.id.progressContainer); mListContainer = root.findViewById(com.android.internal.R.id.listContainer); Loading @@ -400,12 +411,17 @@ public class ListFragment extends Fragment { } if (mEmptyView != null) { mList.setEmptyView(mEmptyView); } else if (mEmptyText != null) { mStandardEmptyView.setText(mEmptyText); mList.setEmptyView(mStandardEmptyView); } } mListShown = true; mList.setOnItemClickListener(mOnClickListener); if (mAdapter != null) { setListAdapter(mAdapter); ListAdapter adapter = mAdapter; mAdapter = null; setListAdapter(adapter); } else { // We are starting without an adapter, so assume we won't // have our data right away and start with the progress indicator. Loading Loading
api/current.xml +11 −0 Original line number Diff line number Diff line Loading @@ -30614,6 +30614,17 @@ visibility="public" > </method> <method name="isDetached" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public" > </method> <method name="isHidden" return="boolean" abstract="false"
core/java/android/app/Activity.java +3 −1 Original line number Diff line number Diff line Loading @@ -4413,7 +4413,9 @@ public class Activity extends ContextThemeWrapper mFragments.dispatchStart(); if (mAllLoaderManagers != null) { for (int i=mAllLoaderManagers.size()-1; i>=0; i--) { mAllLoaderManagers.valueAt(i).finishRetain(); LoaderManagerImpl lm = mAllLoaderManagers.valueAt(i); lm.finishRetain(); lm.doReportStart(); } } } Loading
core/java/android/app/Fragment.java +52 −5 Original line number Diff line number Diff line Loading @@ -587,11 +587,6 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener mWho = "android:fragment:" + mIndex; } final void clearIndex() { mIndex = -1; mWho = null; } final boolean isInBackStack() { return mBackStackNesting > 0; } Loading Loading @@ -782,6 +777,15 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener return mActivity != null && mAdded; } /** * Return true if the fragment has been explicitly detached from the UI. * That is, {@link FragmentTransaction#detach(Fragment) * FragmentTransaction.detach(Fragment)} has been used on it. */ final public boolean isDetached() { return mDetached; } /** * Return true if this fragment is currently being removed from its * activity. This is <em>not</em> whether its activity is finishing, but Loading Loading @@ -1202,6 +1206,35 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener } } /** * Called by the fragment manager once this fragment has been removed, * so that we don't have any left-over state if the application decides * to re-use the instance. This only clears state that the framework * internally manages, not things the application sets. */ void initState() { mIndex = -1; mWho = null; mAdded = false; mRemoving = false; mResumed = false; mFromLayout = false; mInLayout = false; mRestored = false; mBackStackNesting = 0; mFragmentManager = null; mActivity = mImmediateActivity = null; mFragmentId = 0; mContainerId = 0; mTag = null; mHidden = false; mDetached = false; mRetaining = false; mLoaderManager = null; mLoadersStarted = false; mCheckedForLoaderManager = false; } /** * Called when the fragment is no longer attached to its activity. This * is called after {@link #onDestroy()}. Loading Loading @@ -1429,6 +1462,13 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener } } void performStart() { onStart(); if (mLoaderManager != null) { mLoaderManager.doReportStart(); } } void performStop() { onStop(); Loading @@ -1447,4 +1487,11 @@ public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener } } } void performDestroyView() { onDestroyView(); if (mLoaderManager != null) { mLoaderManager.doReportNextStart(); } } }
core/java/android/app/FragmentManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -803,7 +803,7 @@ final class FragmentManagerImpl extends FragmentManager { if (newState > Fragment.STOPPED) { if (DEBUG) Log.v(TAG, "moveto STARTED: " + f); f.mCalled = false; f.onStart(); f.performStart(); if (!f.mCalled) { throw new SuperNotCalledException("Fragment " + f + " did not call through to super.onStart()"); Loading Loading @@ -856,7 +856,7 @@ final class FragmentManagerImpl extends FragmentManager { } } f.mCalled = false; f.onDestroyView(); f.performDestroyView(); if (!f.mCalled) { throw new SuperNotCalledException("Fragment " + f + " did not call through to super.onDestroyView()"); Loading Loading @@ -1006,7 +1006,7 @@ final class FragmentManagerImpl extends FragmentManager { } mAvailIndices.add(f.mIndex); mActivity.invalidateFragmentIndex(f.mIndex); f.clearIndex(); f.initState(); } public void addFragment(Fragment fragment, boolean moveToStateNow) { Loading
core/java/android/app/ListFragment.java +20 −4 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ public class ListFragment extends Fragment { TextView mStandardEmptyView; View mProgressContainer; View mListContainer; boolean mSetEmptyText; CharSequence mEmptyText; boolean mListShown; public ListFragment() { Loading Loading @@ -210,6 +210,9 @@ public class ListFragment extends Fragment { public void onDestroyView() { mHandler.removeCallbacks(mRequestFocus); mList = null; mListShown = false; mEmptyView = mProgressContainer = mListContainer = null; mStandardEmptyView = null; super.onDestroyView(); } Loading Loading @@ -289,10 +292,10 @@ public class ListFragment extends Fragment { throw new IllegalStateException("Can't be used with a custom content view"); } mStandardEmptyView.setText(text); if (!mSetEmptyText) { if (mEmptyText == null) { mList.setEmptyView(mStandardEmptyView); mSetEmptyText = true; } mEmptyText = text; } /** Loading Loading @@ -346,6 +349,9 @@ public class ListFragment extends Fragment { getActivity(), android.R.anim.fade_out)); mListContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_in)); } else { mProgressContainer.clearAnimation(); mListContainer.clearAnimation(); } mProgressContainer.setVisibility(View.GONE); mListContainer.setVisibility(View.VISIBLE); Loading @@ -355,6 +361,9 @@ public class ListFragment extends Fragment { getActivity(), android.R.anim.fade_in)); mListContainer.startAnimation(AnimationUtils.loadAnimation( getActivity(), android.R.anim.fade_out)); } else { mProgressContainer.clearAnimation(); mListContainer.clearAnimation(); } mProgressContainer.setVisibility(View.VISIBLE); mListContainer.setVisibility(View.GONE); Loading Loading @@ -383,6 +392,8 @@ public class ListFragment extends Fragment { com.android.internal.R.id.internalEmpty); if (mStandardEmptyView == null) { mEmptyView = root.findViewById(android.R.id.empty); } else { mStandardEmptyView.setVisibility(View.GONE); } mProgressContainer = root.findViewById(com.android.internal.R.id.progressContainer); mListContainer = root.findViewById(com.android.internal.R.id.listContainer); Loading @@ -400,12 +411,17 @@ public class ListFragment extends Fragment { } if (mEmptyView != null) { mList.setEmptyView(mEmptyView); } else if (mEmptyText != null) { mStandardEmptyView.setText(mEmptyText); mList.setEmptyView(mStandardEmptyView); } } mListShown = true; mList.setOnItemClickListener(mOnClickListener); if (mAdapter != null) { setListAdapter(mAdapter); ListAdapter adapter = mAdapter; mAdapter = null; setListAdapter(adapter); } else { // We are starting without an adapter, so assume we won't // have our data right away and start with the progress indicator. Loading