square / picasso

A powerful image downloading and caching library for Android
https://square.github.io/picasso/
Apache License 2.0
18.72k stars 3.97k forks source link

Let RequestTransformers change network and memory policy. #1800

Open NightlyNexus opened 6 years ago

NightlyNexus commented 6 years ago

Disallow changing to no memory cache lookup? Make all cache lookups before creating Requests?

I have something like this working and also fixed #1797, but I have to clean it up when I have time tonight. Feel free to tell me if it's a bad idea haha.

JakeWharton commented 6 years ago

With #739 we should just make them like interceptors and provide the ability to call .newBuilder() on a Request.

jrodbx commented 6 years ago

Seems like this should remain a global setting in the Picasso object itself, but I might be missing something. What's the vision here? In other words, as a request travels through the transformer pipeline, what conditions would lend one to change a network or memory policy of NO_CACHE to NO_STORE or OFFLINE?

NightlyNexus commented 6 years ago

These are properties of a request, so it seems like the should be transferable with newBuilder().

but maybe we leave them as properties for internal use and don't expose them for the RequestTransformers? unsure.