package com.handmark.pulltorefresh.extras.listfragment;

import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.handmark.pulltorefresh.library.PullToRefreshListView;

public class PullToRefreshListFragment extends ListFragment {

	private PullToRefreshListView mPullToRefreshListView;

	@Override
	public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View layout = super.onCreateView(inflater, container, savedInstanceState);

		ListView lv = (ListView) layout.findViewById(android.R.id.list);
		ViewGroup parent = (ViewGroup) lv.getParent();

		// Iterate through parent's children until we find the ListView
		for (int i = 0, z = parent.getChildCount(); i < z; i++) {
			View child = parent.getChildAt(i);

			if (child == lv) {
				// Remove the ListView first
				parent.removeViewAt(i);

				// Now create ListView, and add it in it's place...
				mPullToRefreshListView = onCreatePullToRefreshListView(inflater, savedInstanceState);
				parent.addView(mPullToRefreshListView, i, lv.getLayoutParams());
				break;
			}
		}

		return layout;
	}

	protected PullToRefreshListView onCreatePullToRefreshListView(LayoutInflater inflater, Bundle savedInstanceState) {
		return new PullToRefreshListView(getActivity());
	}

	protected final PullToRefreshListView getPullToRefreshListView() {
		return mPullToRefreshListView;
	}
}
@@ -312,16 +312,571 @@
 tView;%0A%0A
+/**%0A * A sample implementation of how to the PullToRefreshListView with%0A * ListFragment. This implementation simply replaces the ListView that%0A * ListFragment creates with a new PullToRefreshListView. This means that%0A * ListFragment still works 100%25 (e.g. %3Ccode%3EsetListShown(...)%3C/code%3E).%0A * %0A * The new PullToRefreshListView is created in the method%0A * %3Ccode%3EonCreatePullToRefreshListView()%3C/code%3E. If you wish to customise the%0A * PullToRefreshListView then override this method and return your customised%0A * instance.%0A * %0A * @author Chris Banes%0A * %0A */%0A
 public c
@@ -1801,24 +1801,634 @@
 layout;%0A%09%7D%0A%0A
+%09/**%0A%09 * Returns the %7B@link PullToRefreshListView%7D which will replace the ListView%0A%09 * created from ListFragment. You should override this method if you wish to%0A%09 * customise the %7B@link PullToRefreshListView%7D from the default.%0A%09 * %0A%09 * @param inflater%0A%09 *            - LayoutInflater which can be used to inflate from XML.%0A%09 * @param savedInstanceState%0A%09 *            - Bundle passed through from%0A%09 *            %7B@link ListFragment#onCreateView(LayoutInflater, ViewGroup, Bundle)%0A%09 *            onCreateView(...)%7D%0A%09 * @return The %7B@link PullToRefreshListView%7D which will replace the%0A%09 *         ListView.%0A%09 */%0A
 %09protected P
@@ -2587,16 +2587,103 @@
 ));%0A%09%7D%0A%0A
+%09/**%0A%09 * @return The %7B@link PullToRefreshListView%7D attached to this ListFragment.%0A%09 */%0A
 %09protect

Add some doc to the PullToRefreshListFragment extra