本文整理汇总了Java中uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh.SetupWizard方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBarPullToRefresh.SetupWizard方法的具体用法?Java ActionBarPullToRefresh.SetupWizard怎么用?Java ActionBarPullToRefresh.SetupWizard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh
的用法示例。
在下文中一共展示了ActionBarPullToRefresh.SetupWizard方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入方法依赖的package包/类
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, boolean refresh) {
View layout = inflater.inflate(getLayoutRes(), container, false);
pullToRefreshLayout = (PullToRefreshLayout) layout.findViewById(R.id.ptr_layout);
ActionBarPullToRefresh.SetupWizard setupWizard = ActionBarPullToRefresh.from(getActivity());
setupWizard.allChildrenArePullable();
setupWizard.listener(new OnRefreshListener() {
@Override
public void onRefreshStarted(View view) {
refresh();
}
});
setupWizard.setup(pullToRefreshLayout);
setupWizard.options(Options.create().scrollDistance(0.75f).build());
if (refresh) {
refresh();
}
return layout;
}
示例2: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View layout = inflater.inflate(getLayoutRes(), container, false);
pullToRefreshLayout = (PullToRefreshLayout) layout.findViewById(R.id.ptr_layout);
ActionBarPullToRefresh.SetupWizard setupWizard = ActionBarPullToRefresh.from(getActivity());
setupWizard.allChildrenArePullable();
setupWizard.listener(new OnRefreshListener() {
@Override
public void onRefreshStarted(View view) {
refresh();
}
});
setupWizard.setup(pullToRefreshLayout);
setupWizard.options(Options.create().scrollDistance(0.75f).build());
refresh();
return layout;
}
示例3: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入方法依赖的package包/类
@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;
}
示例4: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_photo_stream, container, false);
mPullToRefreshLayout = (PullToRefreshLayout) rootView.findViewById(R.id.ptr_layout);
ActionBarPullToRefresh.SetupWizard setupWizard = ActionBarPullToRefresh.from(getActivity())
.allChildrenArePullable()
.listener(this);
if (mSeries.getType() >= 0) {
setupWizard.allChildrenArePullable();
} else if (mSeries.getType() == -1) {
setupWizard.theseChildrenArePullable(0);
List<Belle> list = loadCollectedBelles();
if (list != null) {
mBelles.addAll(list);
}
}
setupWizard.setup(mPullToRefreshLayout);
mGridView = (GridView) rootView.findViewById(R.id.grid_view);
mPhotoStreamAdapter = new PhotoStreamAdapter(getActivity(), mBelles);
mGridView.setAdapter(mPhotoStreamAdapter);
mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
ArrayList<String> uriList = new ArrayList<String>();
for (Belle belle : mBelles) {
uriList.add(belle.url);
}
GalleryActivity.startViewLarge(getActivity(), mSeries.getTitle(), uriList, i);
}
});
if (mSeries.getType() >= 0) {
mBelleHelper.getBelleListFromLocal(mSeries.getType());
}
return rootView;
}