Verified
Status Update
Comments
am...@google.com <am...@google.com>
am...@google.com <am...@google.com> #2
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));
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));
yb...@google.com <yb...@google.com>
ta...@gmail.com <ta...@gmail.com> #3
I am experiencing this too...
am...@google.com <am...@google.com> #4
Another workaround might help
handler.postDelayed(new Runnable() {
@Override
public void run() {
initiateRefresh();
}
}, 1000);
handler.postDelayed(new Runnable() {
@Override
public void run() {
initiateRefresh();
}
}, 1000);
go...@gmail.com <go...@gmail.com> #5
same problem here.
go...@gmail.com <go...@gmail.com> #6
Same issue here. I am calling an AsyncTask (that calls setRefreshing) from onResume.
yb...@google.com <yb...@google.com> #7
Same here. android.support.v4 v 21.0.0
ta...@gmail.com <ta...@gmail.com> #8
Problem still exists with android.support.v4:21.0.3.
pr...@gmail.com <pr...@gmail.com> #10
[Comment deleted]
yb...@google.com <yb...@google.com> #11
FWIW: a workaround that seems to work (even without the delay):
final boolean refreshing = true;
swipeToRefreshLayout.post(new Runnable() {
@Override public void run() {
swipeToRefreshLayout.setRefreshing(refreshing);
}
});
final boolean refreshing = true;
swipeToRefreshLayout.post(new Runnable() {
@Override public void run() {
swipeToRefreshLayout.setRefreshing(refreshing);
}
});
jo...@gmail.com <jo...@gmail.com> #12
[Comment deleted]
st...@googlemail.com <st...@googlemail.com> #13
[Comment deleted]
ta...@gmail.com <ta...@gmail.com> #15
The post() workaround works when loading programmatically, but the gesture down is still broken.
sk...@googlemail.com <sk...@googlemail.com> #16
It seems the gesture doesn't work if the view doesn't have a ScrollView widget in its hierarchy.
cc...@android.com <cc...@android.com> #17
My solution is to override SwipeRefreshLayout
private boolean mMeasured = false;
private boolean mPreMeasureRefreshing = false;
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (!mMeasured) {
mMeasured = true;
setRefreshing(mPreMeasureRefreshing);
}
}
@Override
public void setRefreshing(boolean refreshing) {
if (mMeasured) {
super.setRefreshing(refreshing);
} else {
mPreMeasureRefreshing = refreshing;
}
}
private boolean mMeasured = false;
private boolean mPreMeasureRefreshing = false;
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (!mMeasured) {
mMeasured = true;
setRefreshing(mPreMeasureRefreshing);
}
}
@Override
public void setRefreshing(boolean refreshing) {
if (mMeasured) {
super.setRefreshing(refreshing);
} else {
mPreMeasureRefreshing = refreshing;
}
}
[Deleted User] <[Deleted User]> #18
Still broken, v22.2.0
cc...@android.com <cc...@android.com> #19
Fix this already!
bf...@gmail.com <bf...@gmail.com> #20
Please, fix this issue.
yu...@gmail.com <yu...@gmail.com> #21
Still exists with 22.2.1
em...@gmail.com <em...@gmail.com> #22
Still an issue with 23.0.0
xl...@gmail.com <xl...@gmail.com> #23
Still broken in 23.0.1
bf...@gmail.com <bf...@gmail.com> #24
I don't think this is broken in Google's eyes.
"The refresh indicator appears only in conjunction with a refresh gesture or action. Syncing does not display a refresh indicator."
http://www.google.com/design/spec/patterns/swipe-to-refresh.html#swipe-to-refresh-swipe-to-refresh
"The refresh indicator appears only in conjunction with a refresh gesture or action. Syncing does not display a refresh indicator."
xl...@gmail.com <xl...@gmail.com> #25
Note that this almost year old bug has not been triaged yet, meaning they didn't see it, or choose to ignore.
I couldn't find any recommended way to display initial loading. Empty view is for empty list, having a separate loading indicator and a swipe-to-refresh indicator is problematic to code and may confuse the user. In Google's world everything shows up immediately.
Note that even the GMail app shows two indicators sometimes. In the morning when I turn WiFi on, it starts syncing, but it takes a while, and if in the middle of that I swipe to refresh it shows me two spinners, going in opposite directions.
I couldn't find any recommended way to display initial loading. Empty view is for empty list, having a separate loading indicator and a swipe-to-refresh indicator is problematic to code and may confuse the user. In Google's world everything shows up immediately.
Note that even the GMail app shows two indicators sometimes. In the morning when I turn WiFi on, it starts syncing, but it takes a while, and if in the middle of that I swipe to refresh it shows me two spinners, going in opposite directions.
am...@google.com <am...@google.com> #26
Why hasn't this been fixed already??
Description
Version used: 25.1.0
Theme used: Theme.AppCompat.Light.DarkActionBar
Devices/Android versions reproduced on: Android API 23 AVD emulator, Android 5.1 user devices
- Relevant code to trigger the issue.
The important parts of the code:
1. Uses StaggeredGridLayoutManager with multiple columns.
2. Some of the items are full span: `StaggeredGridLayoutManager.LayoutParams.setFullSpan(true)`
3. Call `RecyclerView.Adapter.notifyItemChanged()` on UI thread (e.g. post delayed Handler)
When running the example app, try flinging the RecyclerView up and down several times. It will eventually force close.
- Stack trace:
java.lang.IllegalArgumentException: Pixel distance must be non-negative
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.addPosition(GapWorker.java:110)
at android.support.v7.widget.StaggeredGridLayoutManager.collectAdjacentPrefetchPositions(StaggeredGridLayoutManager.java:2109)
at android.support.v7.widget.GapWorker$LayoutPrefetchRegistryImpl.collectPrefetchPositionsFromView(GapWorker.java:94)
at android.support.v7.widget.GapWorker.buildTaskList(GapWorker.java:213)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:343)
at android.support.v7.widget.GapWorker.run(GapWorker.java:370)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)