本文整理汇总了Java中uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout.setPullToRefreshAttacher方法的典型用法代码示例。如果您正苦于以下问题:Java PullToRefreshLayout.setPullToRefreshAttacher方法的具体用法?Java PullToRefreshLayout.setPullToRefreshAttacher怎么用?Java PullToRefreshLayout.setPullToRefreshAttacher使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout
的用法示例。
在下文中一共展示了PullToRefreshLayout.setPullToRefreshAttacher方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: onCreate
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview);
/**
* Get ListView and give it an adapter to display the sample items
*/
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new SampleWebViewClient());
/**
* Here we create a PullToRefreshAttacher without an Options instance.
* PullToRefreshAttacher will manually create one using default values.
*/
mPullToRefreshAttacher = PullToRefreshAttacher.get(this);
// Retrieve the PullToRefreshLayout from the content view
PullToRefreshLayout ptrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_webview);
// Give the PullToRefreshAttacher to the PullToRefreshLayout, along with the refresh
// listener (this).
ptrLayout.setPullToRefreshAttacher(mPullToRefreshAttacher, this);
// Finally make the WebView load something...
mWebView.loadUrl("http://www.google.com");
}
示例4: onCreate
import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
super.onCreate(savedInstanceState, true);
setContentView(R.layout.activity_rockets_list);
// Show the Up button in the action bar.
setupActionBar();
mLvRockets = (ListView) findViewById(R.id.lvRockets);
mLvRockets.setEmptyView(findViewById(android.R.id.empty));
mLayoutRockets = (PullToRefreshLayout) findViewById(R.id.layoutRockets);
mPullToRefreshAttacher = PullToRefreshAttacher.get(this);
mLayoutRockets.setPullToRefreshAttacher(mPullToRefreshAttacher, this);
mGestureDetector = new GestureDetector(this, new GestureListener());
mAdapter = new RocketsArrayAdapter(this, mLensRocketService.getLocalRockets());
mLvRockets.setAdapter(mAdapter);
mLvRockets.setOnItemClickListener(rocketClickListener);
mLvRockets.setOnItemLongClickListener(rocketLongClickListener);
mLvRockets.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
mGestureDetector.onTouchEvent(event);
if (event.getAction() == MotionEvent.ACTION_UP) {
if (mIsViewingPicture || mIsViewingVideo) {
mViewingDialog.dismiss();
mIsViewingPicture = false;
mIsViewingVideo = false;
if (mImagePicture != null) {
mImagePicture = null;
} else if (mVideoView != null) {
mVideoView.stopPlayback();
mVideoView = null;
}
}
}
return false;
}
});
}
示例5: 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);
// As we haven't set an explicit HeaderTransformer, we can safely cast the result of
// getHeaderTransformer() to DefaultHeaderTransformer
DefaultHeaderTransformer ht = (DefaultHeaderTransformer) mPullToRefreshAttacher
.getHeaderTransformer();
// As we're using a DefaultHeaderTransformer we can change the text which is displayed.
// You should load these values from localised resources, but we'll just use static strings.
ht.setPullText("Swipe Me!!!");
ht.setRefreshingText("Refreshing :)");
// DefaultHeaderTransformer allows you to change the color of the progress bar. Here
// we set it to a dark holo green, loaded from our resources
ht.setProgressBarColor(getResources().getColor(R.color.holo_dark_green));
}
示例6: 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);
// As we haven't set an explicit HeaderTransformer, we can safely cast the result of
// getHeaderTransformer() to DefaultHeaderTransformer
AbcDefaultHeaderTransformer ht = (AbcDefaultHeaderTransformer) mPullToRefreshAttacher
.getHeaderTransformer();
// As we're using a DefaultHeaderTransformer we can change the text which is displayed.
// You should load these values from localised resources, but we'll just use static strings.
ht.setPullText("Swipe Me!!!");
ht.setRefreshingText("Refreshing :)");
// DefaultHeaderTransformer allows you to change the color of the progress bar. Here
// we set it to a dark holo green, loaded from our resources
ht.setProgressBarColor(getResources().getColor(R.color.holo_dark_green));
}
示例7: 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);
// As we haven't set an explicit HeaderTransformer, we can safely cast the result of
// getHeaderTransformer() to DefaultHeaderTransformer
AbsDefaultHeaderTransformer ht = (AbsDefaultHeaderTransformer) mPullToRefreshAttacher
.getHeaderTransformer();
// As we're using a DefaultHeaderTransformer we can change the text which is displayed.
// You should load these values from localised resources, but we'll just use static strings.
ht.setPullText("Swipe Me!!!");
ht.setRefreshingText("Refreshing :)");
// DefaultHeaderTransformer allows you to change the color of the progress bar. Here
// we set it to a dark holo green, loaded from our resources
ht.setProgressBarColor(getResources().getColor(R.color.holo_dark_green));
}