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

Switch to Glide #42

Closed
wants to merge 2 commits into from
Closed

Switch to Glide #42

wants to merge 2 commits into from

Conversation

fatih-atasever
Copy link

Migrated to glide for better performance and cache management, and built in gif support to be able to use gifs on any ImageView. Also made ImageDialog full screen, with gif support and panning/zooming.

I used application class for centralized image loading, been using this approach with no issues, if there is any caveat please let me know.

/**
* Initialize MySoup so that we can start making API requests
*/
public static void initSoup(){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? The way the WhatAPI works is that we need to set some static information like the site name, if we're using SSL and our user agent. Without this we won't be able to make API requests to the site. Related to this the site string shouldn't have been removed either.

I haven't had time to fully go through the PR and try testing it but this stuck out.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see this moved up to WhatApplication

@Twinklebear
Copy link
Collaborator

Still working through the Pull Request, but why did you split parts of LoggedInActivity into WhatApplication? It seems like it's just a container for some static methods so why would it inherit from Application if we won't actually instantiate it (do we? I'm still reading). We override onCreate so maybe it is created somewhere? Where does it fit in?

@fatih-atasever
Copy link
Author

A normal class with some static methods/variables is not guaranteed to live through application lifecycle. It can be killed, variables may get removed etc. Application class is guaranteed to live. By adding it into the manifest as the name of the application, it is guaranteed that WhatApplication class initializes first, before any acticity or class, and it is killed last.

For these properties, i always thought doing app-wide things and initializations in Application class is beneficial, or convenient at least. And had no problems in the past with it.

@Twinklebear
Copy link
Collaborator

Hmm, I see. I also noticed you took out checking for null or empty image URLs which we do sometimes get on the site. Will Glide just throw an exception which is picked up by the exception handler given to it?

sharedConstructing(context);
}

private void sharedConstructing(Context context) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability I'd prefer it if there wasn't a newline after every statement here but that things were grouped logically instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, i will refactor it.

@fatih-atasever
Copy link
Author

Yes, our exception handler catches it and shows the appropriate error image/placeholder.

@stuxo
Copy link
Contributor

stuxo commented Sep 21, 2015

Should this PR be targeting develop rather than master?

@Twinklebear
Copy link
Collaborator

@stuxo You're right, good catch. @Hfatih Could you change this pull to be targeting the develop branch?

@fatih-atasever
Copy link
Author

Oh, my bad. I didn't even use development branch to begin with. I will reapply these changes to development branch and open a new pull request if we are okay with the changes.

@Twinklebear
Copy link
Collaborator

@Hfatih do you think you may have time to finish up this PR? We're hoping to get a release out soon with the material design update and some bug fixes and this would be awesome PR to have in as well. If you don't think you'd have time I can finish making the final tweaks and testing to merge this in if it's in an ok state.

@fatih-atasever
Copy link
Author

Sure, i already applied little changes mentioned above and tested everywhere image loading used. Gifs work everywhere too. I will make another pull request in dev branch tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants