this.resource = resource; if (glideContext.getLogLevel() <= Log.DEBUG) { Log.d(GLIDE_TAG, "Finished loading " + result.getClass().getSimpleName() + " from " + dataSource + " for " + model + " with size [" + width + "x" + height + "] in "
private synchronized void onLoadFailed(GlideException e, int maxLogLevel) { stateVerifier.throwIfRecycled(); e.setOrigin(requestOrigin); int logLevel = glideContext.getLogLevel(); if (logLevel <= maxLogLevel) { Log.w(GLIDE_TAG, "Load failed for " + model + " with size [" + width + "x" + height + "]", e);
/** * Internal {@link #onResourceReady(Resource, DataSource)} where arguments are known to be safe. * * @param resource original {@link Resource}, never <code>null</code> * @param result object returned by {@link Resource#get()}, checked for type and never * <code>null</code> */ private void onResourceReady(Resource<R> resource, R result, DataSource dataSource) { // We must call isFirstReadyResource before setting status. boolean isFirstResource = isFirstReadyResource(); status = Status.COMPLETE; this.resource = resource; if (glideContext.getLogLevel() <= Log.DEBUG) { Log.d(GLIDE_TAG, "Finished loading " + result.getClass().getSimpleName() + " from " + dataSource + " for " + model + " with size [" + width + "x" + height + "] in " + LogTime.getElapsedMillis(startTime) + " ms"); } isCallingCallbacks = true; try { if (requestListener == null || !requestListener.onResourceReady(result, model, target, dataSource, isFirstResource)) { Transition<? super R> animation = animationFactory.build(dataSource, isFirstResource); target.onResourceReady(result, animation); } } finally { isCallingCallbacks = false; } notifyLoadSuccess(); }
private void onLoadFailed(GlideException e, int maxLogLevel) { stateVerifier.throwIfRecycled(); int logLevel = glideContext.getLogLevel(); if (logLevel <= maxLogLevel) { Log.w(GLIDE_TAG, "Load failed for " + model + " with size [" + width + "x" + height + "]", e); if (logLevel <= Log.INFO) { e.logRootCauses(GLIDE_TAG); } } loadStatus = null; status = Status.FAILED; isCallingCallbacks = true; try { //TODO: what if this is a thumbnail request? if (requestListener == null || !requestListener.onLoadFailed(e, model, target, isFirstReadyResource())) { setErrorPlaceholder(); } } finally { isCallingCallbacks = false; } }