Skip to content

Commit

Permalink
Merge branch 'develop' into feature/modularize-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Feb 24, 2015
2 parents e3f237e + 3f8bedb commit a2c4b16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/
public class AppLog {
// T for Tag
public enum T {READER, EDITOR, MEDIA, NUX, API, STATS, UTILS, NOTIFS, DB, POSTS, COMMENTS, THEMES, TESTS, PROFILING, SIMPERIUM, SUGGESTION}
public enum T {READER, EDITOR, MEDIA, NUX, API, STATS, UTILS, NOTIFS, DB, POSTS, COMMENTS, THEMES, TESTS, PROFILING,
SIMPERIUM, SUGGESTION}
public static final String TAG = "WordPress";
public static final int HEADER_LINE_COUNT = 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
public class SwipeToRefreshHelper implements OnRefreshListener {
private SwipeRefreshLayout mSwipeRefreshLayout;
private RefreshListener mRefreshListener;
private boolean mRefreshing;

public interface RefreshListener {
public void onRefreshStarted();
Expand All @@ -33,7 +34,20 @@ public void init(Activity activity, SwipeRefreshLayout swipeRefreshLayout, Refre
}

public void setRefreshing(boolean refreshing) {
mSwipeRefreshLayout.setRefreshing(refreshing);
mRefreshing = refreshing;
// Delayed refresh, it fixes https://code.google.com/p/android/issues/detail?id=77712
// 50ms seems a good compromise (always worked during tests) and fast enough so user can't notice the delay
if (refreshing) {
mSwipeRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
// use mRefreshing so if the refresh takes less than 50ms, loading indicator won't show up.
mSwipeRefreshLayout.setRefreshing(mRefreshing);
}
}, 50);
} else {
mSwipeRefreshLayout.setRefreshing(false);
}
}

public boolean isRefreshing() {
Expand Down

0 comments on commit a2c4b16

Please sign in to comment.