Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Fixes #381: Removes picasso library and uses glide library instead #384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

saketkumar
Copy link
Collaborator

Summary of changes

This PR fixes https://github.com/zulip/zulip-android/issues/381

Removed picasso and used glide in place of picasso.

  • Code is formatted.

  • Run the lint tests with ./gradlew lintDebug and make sure BUILD is SUCCESSFUL

  • Commit messages are well-written.

@smarx
Copy link

smarx commented Feb 10, 2017

Automated message from Dropbox CLA bot

@saketkumar95, it looks like you've already signed the Dropbox CLA. Thanks!

Copy link
Member

@Sam1301 Sam1301 left a comment

Choose a reason for hiding this comment

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

When I tried the changes I got this
screenshot_20170213-072712

We don't want to use the presence_online drawable when gravatar is not loaded, instead use the default avatar with randomly generated colors in such scenarios :)

@saketkumar
Copy link
Collaborator Author

@Sam1301 Check. It works fine now. :)

@@ -120,7 +122,7 @@ public void onItemClick(int viewId, int position) {
Person[] recipientArray = messageHeaderParent.getRecipients(zulipApp);
narrowListener.onNarrow(new NarrowFilterPM(Arrays.asList(recipientArray)),
messageHeaderParent.getMessageId());
narrowListener.onNarrowFillSendBoxPrivate(recipientArray,false);
narrowListener.onNarrowFillSendBoxPrivate(recipientArray, false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this change!

@@ -395,7 +397,7 @@ public void onBindViewHolder(final RecyclerView.ViewHolder holder, final int pos
public void onClick(View view) {
Intent i = new Intent(zulipApp.getApplicationContext(), PhotoViewActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.putExtra(Intent.EXTRA_TEXT , url);
i.putExtra(Intent.EXTRA_TEXT, url);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this chagne!

int hMapKey = message.getSender().getId();
int avatarColor;

// check if current sender has already been allotted a randomly generated color
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove these empty lines!

@Override
public void onSuccess() {
public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about displaying the default gravatar in this onException ?
And using a placeholder like before?

As this method will be called on every onBindViewHolder so we need to make sure these are taking minimal time!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As far i know, to display an error placeholder default Avatar the onException method must return false.
Check out this https://futurestud.io/tutorials/glide-exceptions-debugging-and-error-handling

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that's fine but see this we are initiating defaultAvatar even if the gravatar is loaded which is not needed, hence we can display the default blank (solid coloured square) only when an error is occurred!

@Sam1301
Copy link
Member

Sam1301 commented Mar 27, 2017

@saketkumar95 this looks nice! Can you please address Kunal's comment here?

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

Successfully merging this pull request may close these issues.

Using any one of them Glide or Picasso
4 participants