-
Notifications
You must be signed in to change notification settings - Fork 2
Code Explanations #1
Comments
Hey. This is how it works:
At least, that's what I think is happening. Maybe I forgot something, it's been a while. :) |
@xiprox Thank you so much. I will review your explanation and compare it with the code. I request you to keep the issue open, so if required I can ask for further explanation. |
You're welcome. I can't promise prompt response, but sure. |
In UploadStatusDelegate class you have used, this the above code to convert from Json Response received from Imgur server when an image is uploaded to convert to Kotlin Objects. Is there a better way to convert the same with Retrofit Converter Gson library in the model itself and getting rid of the ImgurResponseConverterFactory fromJson extension altogether? Please explain the reason why you choose to do the above way using custom ImgurResponseConverter... |
What ImgurResponseConverter and ImgurResponseConverterFactory do, together, is unwrap JSON objects from Imgur, which are structured like {
"data": { "someField": "hey" },
"success": true,
"status": 200
} into just If you look at ImgurService, you will notice that all our functions ultimately return objects of direct types (e.g. It's really not an essential thing. One could get rid of it and just do If you would prefer to get rid of it, removing the factory and the converter, then wrapping response types in ImgurResponse should work. |
In addPendingUploads() method, you have added id as
it
which is the url of image like file://image/pathHow does passing url of image path which is equal to
it
inid
works inside AlbumImage?I see both link and id has
it
and I am confused on how the code is working here.Could you please explain the above query?
` fun addPendingUploads(albumId: String, urls: List, onAdded: (() -> Unit)?) {
`
The text was updated successfully, but these errors were encountered: