Skip to content

Instantly share code, notes, and snippets.

@leelei
Last active August 29, 2015 14:09
Show Gist options
  • Save leelei/201df22046e23879dcbb to your computer and use it in GitHub Desktop.
Save leelei/201df22046e23879dcbb to your computer and use it in GitHub Desktop.
mSwipeRefreshLayout.setProgressViewOffset(false, 0,
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 24, getResources().getDisplayMetrics()));
//Another workaround, getting the ActionBar size at run-time:
TypedValue typed_value = new TypedValue();
getTheme().resolveAttribute(android.support.v7.appcompat.R.attr.actionBarSize, typed_value, true);
swipe_refresh_layout.setProgressViewOffset(false, 0, getResources().getDimensionPixelSize(typed_value.resourceId));
//Another workaround might help
handler.postDelayed(new Runnable() {
@Override
public void run() {
initiateRefresh();
}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment