/** * Lifecycle callback that registers for connectivity events (if the * android.permission.ACCESS_NETWORK_STATE permission is present) and restarts failed or paused * requests. */ @Override public synchronized void onStart() { resumeRequests(); targetTracker.onStart(); }
@Override public void runTest() { manager.resumeRequests(); } });
/** * Performs {@link #resumeRequests()} recursively for all managers that are contextually * descendant to this manager based on the Activity/Fragment hierarchy. The hierarchical semantics * are identical as for {@link #pauseRequestsRecursive()}. */ // Public API. @SuppressWarnings("unused") public synchronized void resumeRequestsRecursive() { Util.assertMainThread(); resumeRequests(); for (RequestManager requestManager : treeNode.getDescendants()) { requestManager.resumeRequests(); } }
private void resumeRequestsIfNotDestroyed() { if (!AndroidLifecycleUtils.canLoadImage(this)) { return; } mGlideRequestManager.resumeRequests(); } }
@Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); if(newState == RecyclerView.SCROLL_STATE_IDLE){ Glide.with(MainActivity.this).resumeRequests(); }else{ Glide.with(MainActivity.this).pauseRequests(); } } });
@Test public void testResumeRequestsResumesRequests() { manager.resumeRequests(); verify(requestTracker).resumeRequests(); }
requestManager.resumeRequests();
/** * Lifecycle callback that registers for connectivity events (if the android.permission.ACCESS_NETWORK_STATE * permission is present) and restarts failed or paused requests. */ @Override public void onStart() { // onStart might not be called because this object may be created after the fragment/activity's onStart method. resumeRequests(); }
/** * Performs {@link #resumeRequests()} recursively for all managers that are contextually descendant * to this manager based on the Activity/Fragment hierarchy. The hierarchical semantics are identical as for * {@link #pauseRequestsRecursive()}. */ public void resumeRequestsRecursive() { Util.assertMainThread(); resumeRequests(); for (RequestManager requestManager : treeNode.getDescendants()) { requestManager.resumeRequests(); } }
@Override public void resume(Context context) { getRequestManager(context).resumeRequests(); }
/** * 恢复请求,一般在停止滚动的时候调用 * * @param context */ public void resumeRequests(Context context) { Glide.with(context).resumeRequests(); }
/** * 恢复所有任务 */ public static void resumeAllTasks(Context context) { Glide.with(context).resumeRequests(); }
/** * 恢复请求,一般在停止滚动的时候 * * @param context */ public void resumeRequests(Context context) { Glide.with(context).resumeRequests(); }
/** * Performs {@link #resumeRequests()} recursively for all managers that are contextually * descendant to this manager based on the Activity/Fragment hierarchy. The hierarchical semantics * are identical as for {@link #pauseRequestsRecursive()}. */ public void resumeRequestsRecursive() { Util.assertMainThread(); resumeRequests(); for (RequestManager requestManager : treeNode.getDescendants()) { requestManager.resumeRequests(); } }
@Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); if (newState == RecyclerView.SCROLL_STATE_DRAGGING || newState == RecyclerView.SCROLL_STATE_SETTLING) { Glide.with(context).pauseRequests(); } else if (newState == RecyclerView.SCROLL_STATE_IDLE) { Glide.with(context).resumeRequests(); } } }
@Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); if (newState == RecyclerView.SCROLL_STATE_IDLE) { Glide.with(MainActivity.this).resumeRequests(); } else { Glide.with(MainActivity.this).pauseRequests(); } }
/** * Lifecycle callback that registers for connectivity events (if the * android.permission.ACCESS_NETWORK_STATE permission is present) and restarts failed or paused * requests. */ @Override public void onStart() { resumeRequests(); targetTracker.onStart(); }
@Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); EdgeEffectUtil.forRecyclerView(recyclerView, edgeColor); if (newState == RecyclerView.SCROLL_STATE_IDLE) { Glide.with(mApp).resumeRequests(); } else { // dragging or settling Glide.with(mApp).pauseRequests(); } } });
@Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); if (newState == RecyclerView.SCROLL_STATE_IDLE) { Glide.with(getActivity()).resumeRequests(); } if (newState == RecyclerView.SCROLL_STATE_IDLE && (lastVisibleItem + 1 == recycleViewAdapter.getItemCount()) && hasMore) { swipeRefreshLayout.setRefreshing(true); presenter.getData(mOffset, SIZE); } }
@Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); if (newState == RecyclerView.SCROLL_STATE_IDLE) { Glide.with(getActivity()).resumeRequests(); } if (newState == RecyclerView.SCROLL_STATE_IDLE && (lastVisibleItem + 1 == recycleViewAdapter.getItemCount()) && hasMore) { presenter.getData(mOffset + 1, SIZE,areaCode); } }