本文整理汇总了Java中uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout类的典型用法代码示例。如果您正苦于以下问题:Java PullToRefreshLayout类的具体用法?Java PullToRefreshLayout怎么用?Java PullToRefreshLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PullToRefreshLayout类属于uk.co.senab.actionbarpulltorefresh.library包,在下文中一共展示了PullToRefreshLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
mTimelineView = inflater.inflate(R.layout.fragment_timeline, container, false);
mTimelineList = (ListView) mTimelineView.findViewById(R.id.timeline_list);
mLoadingProgress = (ProgressBar) mTimelineView.findViewById(R.id.loading_progress);
mPullToRefreshLayout = (PullToRefreshLayout) mTimelineView.findViewById(R.id.ptr_layout);
initPullToRefreshLayout();
initTimelineList();
((MainActivity)getActivity()).setActionbarTitleDoubleClickListener(new Runnable() {
@Override
public void run() {
mTimelineList.smoothScrollToPosition(0);
}
});
return mTimelineView;
}
示例3: onActivityCreated
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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.PullToRefreshLayout; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_listview_empty);
/**
* Get ListView and give it an adapter to display the sample items
*/
ListView listView = (ListView) findViewById(R.id.ptr_listview);
mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
new ArrayList<String>());
listView.setEmptyView(findViewById(android.R.id.empty));
listView.setAdapter(mAdapter);
/**
* Here we create a PullToRefreshAttacher manually without an Options instance.
* PullToRefreshAttacher will manually create one using default values.
*/
mPullToRefreshAttacher = PullToRefreshAttacher.get(this);
// Set the Refreshable View to be the ListView and the refresh listener to be this.
PullToRefreshLayout ptrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
ptrLayout.setPullToRefreshAttacher(mPullToRefreshAttacher, this);
}
示例5: onCreate
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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);
}
示例6: onViewCreated
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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);
}
示例7: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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;
}
示例8: onCreate
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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");
}
示例9: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
page = 1;
mPullToRefreshLayout = (PullToRefreshLayout) inflater.inflate(R.layout.fragment_orders, container, false);
mListView = (ListView) mPullToRefreshLayout.findViewById(R.id.list_view_fragment_order);
mListView.setEmptyView(mPullToRefreshLayout.findViewById(R.id.progress_bar_fragment_order));
mListView.setOnItemClickListener(this);
mListView.setOnScrollListener(this);
mOrderAdapter = new OrderAdapter();
mListView.setAdapter(mOrderAdapter);
return mPullToRefreshLayout;
}
示例10: onCreate
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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: initializeRefreshOnDrag
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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);
}
示例12: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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;
}
示例13: onCreateView
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的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;
}
示例14: initView
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的package包/类
private void initView() {
mPtrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
mTimelineList = (ListView) findViewById(R.id.timeline_list);
mProgressBar = (ProgressBar) findViewById(R.id.loading_progress);
initPtrLayout();
initTimelineList();
}
示例15: onCreate
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scrollview);
// Create new PullToRefreshAttacher
mPullToRefreshAttacher = PullToRefreshAttacher.get(this);
// Retrieve the PullToRefreshLayout from the content view
PullToRefreshLayout ptrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
// Give the PullToRefreshAttacher to the PullToRefreshLayout, along with the refresh
// listener (this).
ptrLayout.setPullToRefreshAttacher(mPullToRefreshAttacher, this);
}