@NonNull @CheckResult public T apply(@NonNull BaseRequestOptions<?> o) { if (isAutoCloneEnabled) { return clone().apply(o); } BaseRequestOptions<?> other = o;
if (isSet(other.fields, SIZE_MULTIPLIER)) { sizeMultiplier = other.sizeMultiplier; } if (isSet(other.fields, USE_UNLIMITED_SOURCE_GENERATORS_POOL)) { useUnlimitedSourceGeneratorsPool = other.useUnlimitedSourceGeneratorsPool; } if (isSet(other.fields, USE_ANIMATION_POOL)) { useAnimationPool = other.useAnimationPool; } if (isSet(other.fields, DISK_CACHE_STRATEGY)) { diskCacheStrategy = other.diskCacheStrategy; } if (isSet(other.fields, PRIORITY)) { priority = other.priority; } if (isSet(other.fields, ERROR_PLACEHOLDER)) { errorPlaceholder = other.errorPlaceholder; errorId = 0; fields &= ~ERROR_ID; } if (isSet(other.fields, ERROR_ID)) { errorId = other.errorId; errorPlaceholder = null; fields &= ~ERROR_PLACEHOLDER; } if (isSet(other.fields, PLACEHOLDER)) { placeholderDrawable = other.placeholderDrawable; placeholderId = 0; fields &= ~PLACEHOLDER_ID; } if (isSet(other.fields, PLACEHOLDER_ID)) { placeholderId = other.placeholderId; placeholderDrawable = null; fields &= ~PLACEHOLDER; } if (isSet(other.fields, IS_CACHEABLE)) { isCacheable = other.isCacheable; } if (isSet(other.fields, OVERRIDE)) { overrideWidth = other.overrideWidth; overrideHeight = other.overrideHeight; } if (isSet(other.fields, SIGNATURE)) { signature = other.signature; } if (isSet(other.fields, RESOURCE_CLASS)) { resourceClass = other.resourceClass; } if (isSet(other.fields, FALLBACK)) { fallbackDrawable = other.fallbackDrawable; fallbackId = 0; fields &= ~FALLBACK_ID; } if (isSet(other.fields, FALLBACK_ID)) { fallbackId = other.fallbackId; fallbackDrawable = null; fields &= ~FALLBACK; } if (isSet(other.fields, THEME)) { theme = other.theme; } if (isSet(other.fields, TRANSFORMATION_ALLOWED)) { isTransformationAllowed = other.isTransformationAllowed; } if (isSet(other.fields, TRANSFORMATION_REQUIRED)) { isTransformationRequired = other.isTransformationRequired; } if (isSet(other.fields, TRANSFORMATION)) { transformations.putAll(other.transformations); isScaleOnlyOrNoTransform = other.isScaleOnlyOrNoTransform; } if (isSet(other.fields, ONLY_RETRIEVE_FROM_CACHE)) { onlyRetrieveFromCache = other.onlyRetrieveFromCache; }
// Applying options with dontTransform() is expected to clear our transformations. if (!isTransformationAllowed) { transformations.clear(); fields &= ~TRANSFORMATION; isTransformationRequired = false; fields &= ~TRANSFORMATION_REQUIRED; isScaleOnlyOrNoTransform = true; }