Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support loading Uri Strings #24

Closed
colinrtwhite opened this issue Aug 14, 2019 · 1 comment · Fixed by #75
Closed

Support loading Uri Strings #24

colinrtwhite opened this issue Aug 14, 2019 · 1 comment · Fixed by #75
Labels
enhancement New feature or request

Comments

@colinrtwhite
Copy link
Member

colinrtwhite commented Aug 14, 2019

Is your feature request related to a problem? Please describe.
Currently load(String) must always be a valid URL, but we could support automatically switching between Uris and HttpUrls.

Describe the solution you'd like
This should load the file/asset Uri correctly:

imageView.load("file:///android_asset/starrynight.jpg")

Additional context
Glide and Picasso already handle this.

Previous discussion: #10

@ghost
Copy link

ghost commented Aug 22, 2019

Should analyze the string to determine whether it is a file type,Glide has made a judgment.

like:

if (str.startsWith("http"))
load(str, imageLoader, builder)
else
load(File(str), imageLoader, builder)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant