本文整理汇总了Java中uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh类的典型用法代码示例。如果您正苦于以下问题:Java ActionBarPullToRefresh类的具体用法?Java ActionBarPullToRefresh怎么用?Java ActionBarPullToRefresh使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActionBarPullToRefresh类属于uk.co.senab.actionbarpulltorefresh.library包,在下文中一共展示了ActionBarPullToRefresh类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
albums = new Albums();
View rootView = inflater.inflate(R.layout.fragment_top_albums, container, false);
gridView = (GridView) rootView.findViewById(R.id.gridview);
networkRequest = new AlbumListNetworkAdapter(getActivity());
networkRequest.execute(this.getString(R.string.albums_collection));
pullToRefreshLayout = (PullToRefreshLayout) rootView.findViewById(R.id.ptr_layout);
ActionBarPullToRefresh.from(getActivity())
.listener(this)
.allChildrenArePullable()
.setup(pullToRefreshLayout);
innerFrame.addView(rootView);
return innerFrame;
}
示例2: initPullToRefreshLayout
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
private void initPullToRefreshLayout() {
Options.Builder ptrOptions = Options.create();
ptrOptions.refreshOnUp(true);
ptrOptions.scrollDistance(0.4f);
ActionBarPullToRefresh.from(getActivity()).theseChildrenArePullable(R.id.timeline_list, R.id.loading_layout).options(ptrOptions.build()).
listener(new OnRefreshListener() {
@Override
public void onRefreshStarted(View view) {
initPageFromCache();
mIsLastPage = false;
if (mIsInFavArticle) {
pullFavArticles(false);
} else {
pullTimeline();
}
}
}).setup(mPullToRefreshLayout);
}
示例3: onActivityCreated
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_actionbarpulltorefresh);
initCard();
// Retrieve the PullToRefreshLayout from the content view
mPullToRefreshLayout = (PullToRefreshLayout) getActivity().findViewById(R.id.carddemo_extra_ptr_layout);
// Now setup the PullToRefreshLayout
ActionBarPullToRefresh.from(this.getActivity())
// Mark All Children as pullable
.allChildrenArePullable()
// Set the OnRefreshListener
.listener(this)
// Finally commit the setup to our PullToRefreshLayout
.setup(mPullToRefreshLayout);
}
示例4: onCreate
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
ActionBarPullToRefresh.from(this)
.options(Options.create()
.scrollDistance(0.5f)
.headerLayout(R.layout.pong_header)
.headerTransformer(new PongHeaderTransformer())
.build())
.allChildrenArePullable()
.listener(this)
.setup(mPullToRefreshLayout);
}
示例5: onViewCreated
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view,savedInstanceState);
ViewGroup viewGroup = (ViewGroup) view;
// As we're using a ListFragment we create a PullToRefreshLayout manually
mPullToRefreshLayout = new PullToRefreshLayout(viewGroup.getContext());
// We can now setup the PullToRefreshLayout
ActionBarPullToRefresh.from(getActivity())
// We need to insert the PullToRefreshLayout into the Fragment's ViewGroup
.insertLayoutInto(viewGroup)
// Here we mark just the ListView and it's Empty View as pullable
.theseChildrenArePullable(android.R.id.list, android.R.id.empty)
.listener(this)
.setup(mPullToRefreshLayout);
}
示例6: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout
View view = inflater.inflate(R.layout.layout_fragment, container, false);
// Now give the find the PullToRefreshLayout and set it up
mPullToRefreshLayout = (PullToRefreshLayout) view.findViewById(R.id.ptr_layout);
ActionBarPullToRefresh.from(getActivity())
.allChildrenArePullable()
.listener(this)
.setup(mPullToRefreshLayout);
// Set title in Fragment for display purposes.
TextView title = (TextView) view.findViewById(R.id.tv_title);
Bundle b = getArguments();
if (b != null) {
title.setText(b.getString(EXTRA_TITLE));
}
return view;
}
示例7: onCreate
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview);
// Find WebView and get it ready to display pages
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new SampleWebViewClient());
// Now find the PullToRefreshLayout and set it up
mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
ActionBarPullToRefresh.from(this)
.allChildrenArePullable()
.listener(this)
.setup(mPullToRefreshLayout);
// Finally make the WebView load something...
mWebView.loadUrl("http://www.google.com");
}
示例8: onActivityCreated
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ActionBarPullToRefresh.from(getActivity())
.allChildrenArePullable()
.listener(this)
.setup(mPullToRefreshLayout);
if(getArguments().containsKey("model")){
mTopicModel = getArguments().getParcelable("model");
mTopicId = mTopicModel.id;
mHeaderView = new TopicView(getActivity());
mHeaderView.setViewDetail();
mHeaderView.parse(mTopicModel);
mListView.addHeaderView(mHeaderView, mTopicModel, false);
mListView.setAdapter(new LoadingAdapter(getActivity()));
getReplyData();
}else if(getArguments().containsKey("topic_id")){
mTopicId = getArguments().getInt("topic_id");
getTopicData();
}
}
示例9: onActivityCreated
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ActionBarPullToRefresh.from(getActivity())
.allChildrenArePullable()
.listener(this)
.setup(mPullToRefreshLayout);
if((mNodeId = getArguments().getInt("node_id", 0)) != 0){
getData(false);
}else{
getActivity().finish();
}
NodeModel nodeModel = mAllNodesDataHelper.select(mNodeId);
if(getActivity() instanceof NodeActivity && !nodeModel.isCollected){
setHasOptionsMenu(true);
}
}
示例10: onCreate
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
movieList = (ListView)findViewById(R.id.movieList);
getMovieRatings();
movieList.addFooterView(new View(this), null, false);
movieList.addHeaderView(new View(this), null, false);
// Now find the PullToRefreshLayout to setup
mPullToRefreshLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
// Now setup the PullToRefreshLayout
ActionBarPullToRefresh.from(this)
// Mark All Children as pullable
.allChildrenArePullable()
// Set the OnRefreshListener
.listener(this)
// Finally commit the setup to our PullToRefreshLayout
.setup(mPullToRefreshLayout);
}
示例11: 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_subreddit, container, false);
mPullToRefreshLayout = (PullToRefreshLayout) rootView.findViewById(R.id.ptr_layout);
ListView postList = (ListView) rootView.findViewById(R.id.Subreddit_post_list);
postList.setOnScrollListener(new PostsScrollListener());
postList.setAdapter(mAdapter);
postList.setOnItemClickListener(this);
postList.setOnTouchListener(new ListSwipeInteraction(postList, null));
// Now setup the PullToRefreshLayout
ActionBarPullToRefresh.from(getActivity())
// Mark All Children as pullable
.allChildrenArePullable()
// Set the OnRefreshListener
.listener(this)
// Finally commit the setup to our PullToRefreshLayout
.setup(mPullToRefreshLayout);
return rootView;
}
示例12: initializeRefreshOnDrag
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
private void initializeRefreshOnDrag(View rootView) {
// Now find the PullToRefreshLayout to setup
mPullToRefreshLayout = (PullToRefreshLayout) rootView.findViewById(R.id.ptr_layout);
// Now setup the PullToRefreshLayout
ActionBarPullToRefresh.from(getActivity()).options(Options.create().refreshOnUp(true).build())
// Mark All Children as pullable
.allChildrenArePullable()
// Set a OnRefreshListener
.listener(new OnRefreshListener() {
@Override
public void onRefreshStarted(View view) {
fetchAll();
}
})
// Finally commit the setup to our PullToRefreshLayout
.setup(mPullToRefreshLayout);
}
示例13: 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;
}
示例14: 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;
}
示例15: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.ActionBarPullToRefresh; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.pull_to_refresh_list, container, false);
if (v == null) {
return null;
}
ButterKnife.bind(this, v);
/**
* PullToRefreshの初期化処理
*/
ActionBarPullToRefresh.from(getActivity())
.theseChildrenArePullable(mListView)
.listener(this)
.setup(mPullToRefreshLayout);
mListView.setOnItemClickListener(new StatusClickListener(getActivity()));
mListView.setOnItemLongClickListener(new StatusLongClickListener(getActivity()));
mListView.setOnScrollListener(mOnScrollListener);
mFooter.setVisibility(View.GONE);
mListView.setFastScrollEnabled(BasicSettings.getFastScrollOn());
return v;
}