I use SwipeRefreshLayout
by Google. and I have a few questions.
onRefresh()
?how to make progress on the spinning center of the screen instead of the top, during the update?
swipeLayout = (SwipeRefreshLayout) v.findViewById(R.id.swipe_status_info);
swipeLayout.setColorSchemeColors(Color.RED, Color.GREEN, Color.BLUE, Color.CYAN);
swipeLayout.setOnRefreshListener(this);
@Override
public void onRefresh() {
clearTable(holidayTable);
clearTable(cityayTable);
setData();
}
If you want to block some view (blockedView
) from getting a touch event during the refresh you can consume that event in the OnTouchListener:
@Override
public void onRefresh() {
clearTable(holidayTable);
clearTable(cityayTable);
setData();
refreshing = true;
}
...
blockedView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
//consuming the touch
if (refreshing) return true;
//letting the touch propagate
else return false;
}
});
set the desired offset
in pixels using this method:
swipeLayout.setProgressViewOffset(true, 0, offset);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With