uk.co.senab.actionbarpulltorefresh.library.Options Java Examples

The following examples show how to use uk.co.senab.actionbarpulltorefresh.library.Options. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KlyphFakeHeaderListFragment.java    From Klyph with MIT License 5 votes vote down vote up
@Override
protected Options getPullToRefreshOptions()
{
	if (!(getActivity() instanceof MainActivity))
		return Options.create().headerLayout(R.layout.ptr_profile_header).build();
	
	return super.getPullToRefreshOptions();
}
 
Example #2
Source File: FragmentFeeds.java    From rss with GNU General Public License v3.0 5 votes vote down vote up
@Override
public
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    super.onCreateView(inflater, container, savedInstanceState);

    FeedsActivity activity = (FeedsActivity) getActivity();
    PullToRefreshLayout layout = (PullToRefreshLayout) inflater.inflate(R.layout.viewpager, container, false);

    // Find and configure the ViewPager.
    s_viewPager = (ViewPager) layout.findViewById(R.id.viewpager);
    s_viewPager.setOffscreenPageLimit(128);
    s_viewPager.setOnPageChangeListener(new OnPageChangeListener());

    // Create the Options object for the ActionBarPullToRefresh SetupWizard.
    Options.Builder optionsBuilder = Options.create();
    optionsBuilder.scrollDistance(PULL_DISTANCE);
    Options options = optionsBuilder.build();

    // Create the ActionBarPullToRefresh object using its SetupWizard.
    ActionBarPullToRefresh.SetupWizard setup = ActionBarPullToRefresh.from(activity);
    setup.allChildrenArePullable();
    setup.options(options);
    setup.useViewDelegate(ViewPager.class, new ViewPagerDelegate());
    setup.listener(new RefreshListener(activity));
    setup.setup(layout);

    return layout;
}
 
Example #3
Source File: ThreadListFragment.java    From something.apk with MIT License 4 votes vote down vote up
@Override
protected Options generatePullToRefreshOptions() {
    return Options.create().scrollDistance(getScrollDistance()).build();
}
 
Example #4
Source File: ThreadViewFragment.java    From something.apk with MIT License 4 votes vote down vote up
@Override
protected Options generatePullToRefreshOptions() {
    return Options.create().scrollDistance(getScrollDistance()).headerTransformer(header).refreshOnUp(true).build();
}
 
Example #5
Source File: KlyphFragment.java    From Klyph with MIT License 4 votes vote down vote up
protected Options getPullToRefreshOptions()
{
	return Options.create().build();
}