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

The following examples show how to use uk.co.senab.actionbarpulltorefresh.library.Options. These examples are extracted from open source projects. 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 Project: Klyph   Source File: KlyphFakeHeaderListFragment.java    License: 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 Project: rss   Source File: FragmentFeeds.java    License: 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 Project: something.apk   Source File: ThreadListFragment.java    License: MIT License 4 votes vote down vote up
@Override
protected Options generatePullToRefreshOptions() {
    return Options.create().scrollDistance(getScrollDistance()).build();
}
 
Example 4
Source Project: something.apk   Source File: ThreadViewFragment.java    License: 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 Project: Klyph   Source File: KlyphFragment.java    License: MIT License 4 votes vote down vote up
protected Options getPullToRefreshOptions()
{
	return Options.create().build();
}