Changed TopicDetailFragment to pull UP to refresh

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-10-14 09:58:46 -04:00
parent 73a98c05a3
commit bf4cb33a6d
3 changed files with 14 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
<manifest package="org.RickBarrette.osj.forum"
android:versionCode="8134"
android:versionCode="9100"
android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
<uses-sdk

View File

@@ -7,6 +7,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
@@ -85,4 +86,14 @@ public abstract class PullToRefreshListFragment extends ListFragment implements
return layout;
}
/**
* Sets the mode of the Pull To Refresh ListView controlled by this fragment
*
* @param mode
* @author ricky barrette
*/
public void setMode(final Mode mode) {
mPullToRefreshListView.setMode(mode);
}
}

View File

@@ -41,6 +41,7 @@ import com.commonsware.cwac.thumbnail.ThumbnailBus;
import com.commonsware.cwac.thumbnail.ThumbnailMessage;
import com.handmark.pulltorefresh.extras.listfragment.PullToRefreshListFragment;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode;
public class TopicDetailFragment extends PullToRefreshListFragment implements DatabaseListener {
@@ -59,6 +60,7 @@ public class TopicDetailFragment extends PullToRefreshListFragment implements Da
@Override
public void onActivityCreated(final Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setMode(Mode.PULL_UP_TO_REFRESH);
mDb = new ForumDatabase(getActivity(), this);
refreshList();