private Drawable getErrorDrawable() { if (errorDrawable == null) { errorDrawable = requestOptions.getErrorPlaceholder(); if (errorDrawable == null && requestOptions.getErrorId() > 0) { errorDrawable = loadDrawable(requestOptions.getErrorId()); } } return errorDrawable; }
private Drawable getPlaceholderDrawable() { if (placeholderDrawable == null) { placeholderDrawable = requestOptions.getPlaceholderDrawable(); if (placeholderDrawable == null && requestOptions.getPlaceholderId() > 0) { placeholderDrawable = loadDrawable(requestOptions.getPlaceholderId()); } } return placeholderDrawable; }
/** * Returns true if the full request is still running. */ @Override public boolean isRunning() { return full.isRunning(); }
private boolean isSkipMemoryCacheWithCompletePreviousRequest( BaseRequestOptions<?> options, Request previous) { return !options.isMemoryCacheable() && previous.isComplete(); }
private void notifyLoadSuccess() { if (requestCoordinator != null) { requestCoordinator.onRequestSuccess(this); } }
private Drawable getFallbackDrawable() { if (fallbackDrawable == null) { fallbackDrawable = requestOptions.getFallbackDrawable(); if (fallbackDrawable == null && requestOptions.getFallbackId() > 0) { fallbackDrawable = loadDrawable(requestOptions.getFallbackId()); } } return fallbackDrawable; }
/** * Returns true if the full request is complete. */ @Override public boolean isComplete() { return full.isComplete() || thumb.isComplete(); }
/** * Returns true if the full request has failed. */ @Override public boolean isFailed() { return full.isFailed(); }
/** A callback method that should never be invoked directly. */ @Override public synchronized void onLoadFailed(GlideException e) { onLoadFailed(e, Log.WARN); }
@Override public Object answer(InvocationOnMock invocation) { request.onResourceReady(builder.resource, DataSource.MEMORY_CACHE); return null; } });
private void notifyLoadFailed() { if (requestCoordinator != null) { requestCoordinator.onRequestFailed(this); } }
@Override public Void answer(InvocationOnMock invocationOnMock) { future.cancel(false); return null; } })
@Override public Void answer(InvocationOnMock invocationOnMock) { future.onLoadFailed( /*e=*/ null, /*model=*/ null, future, /*isFirstResource=*/ true); return null; } })
@Override public Void answer(InvocationOnMock invocation) throws Throwable { coordinator.clear(); return null; } }).when(thumb).begin();
@Override public void onRequestSuccess(Request request) { if (parent != null) { parent.onRequestSuccess(this); } }