use of com.bumptech.glide.load.Options in project glide by bumptech.
the class HttpGlideUrlLoaderTest method testReturnsValidFetcher.
@Test
public void testReturnsValidFetcher() {
DataFetcher<InputStream> result = Preconditions.checkNotNull(loader.buildLoadData(model, 100, 100, new Options())).fetcher;
assertThat(result).isInstanceOf(HttpUrlFetcher.class);
}
use of com.bumptech.glide.load.Options in project glide by bumptech.
the class ByteArrayLoaderTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
loader = new ByteArrayLoader<>(converter);
options = new Options();
}
use of com.bumptech.glide.load.Options in project glide by bumptech.
the class ResourceLoaderTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
options = new Options();
loader = new ResourceLoader<>(RuntimeEnvironment.application.getResources(), uriLoader);
}
use of com.bumptech.glide.load.Options in project glide by bumptech.
the class EngineKeyTest method updateDiskCacheKey_throwsException.
@Test
public void updateDiskCacheKey_throwsException() throws NoSuchAlgorithmException {
// If this test fails, update testEqualsAndHashcode to use KeyTester including regression tests.
EngineKey key = new EngineKey("id", new ObjectKey("signature"), 100, 100, Collections.<Class<?>, Transformation<?>>emptyMap(), Object.class, Object.class, new Options());
expectedException.expect(UnsupportedOperationException.class);
key.updateDiskCacheKey(MessageDigest.getInstance("SHA-1"));
}
use of com.bumptech.glide.load.Options in project glide by bumptech.
the class DecodeJob method getOptionsWithHardwareConfig.
@NonNull
private Options getOptionsWithHardwareConfig(DataSource dataSource) {
Options options = this.options;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return options;
}
if (options.get(Downsampler.ALLOW_HARDWARE_CONFIG) != null) {
return options;
}
if (dataSource == DataSource.RESOURCE_DISK_CACHE || decodeHelper.isScaleOnlyOrNoTransform()) {
options = new Options();
options.putAll(this.options);
options.set(Downsampler.ALLOW_HARDWARE_CONFIG, true);
}
return options;
}
Aggregations