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

Icon rounding issue resolved #6770

Conversation

rafaysaleem89
Copy link
Contributor

@rafaysaleem89 rafaysaleem89 commented Dec 15, 2021

Details

The android push notification icon will now be rounded. For some reason the push notifications weren't working on the debug build, so had to do my tests on release builds.

Fixed Issues

The Custom Notification Provider was being used to make a custom layout for notifications in which a bitmap was being used for user's avatar which was being displayed in a. square shape. I added the code to clip the bitmap over a circular path to fix this issue.
$ #6132

Tests

  1. Log in with account A on Android
  2. Log in with account B on web
  3. Send some message from account B to account A
  4. Check the push notifications now the user avatar is rounded.

QA Steps

Add a numbered list of manual tests that can be performed by our QA engineers on the staging environment to validate that 1. Log in with account A on Android
2. Log in with account B on web
3. Send some message from account B to account A
4. Check the push notifications now the user avatar is rounded.

Tested On

  • Android

Screenshots

Add screenshots for all platforms tested. Pull requests won't be merged unless the screenshots show the app was
tested on all platforms

(This was an Android only issue hence only added screen shot of Android)

Android

409caa6f-1193-47f8-a070-dfaa9d3bbe19

@rafaysaleem89 rafaysaleem89 requested a review from a team as a code owner December 15, 2021 11:31
@MelvinBot MelvinBot requested review from marcaaron and parasharrajat and removed request for a team December 15, 2021 11:31
@github-actions
Copy link
Contributor

github-actions bot commented Dec 15, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@parasharrajat
Copy link
Member

@rafaysaleem89 Could you please sign the CLA?

@parasharrajat
Copy link
Member

@Julesssss Could you please review this? i

@rafaysaleem89
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);

final int color = 0xff424242;
Copy link
Contributor

Choose a reason for hiding this comment

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

What colour? Improve var name please.

Comment on lines 82 to 83

public Bitmap getCroppedBitmap(Bitmap bitmap) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment to the function explaining what it's doing.

@rafaysaleem89
Copy link
Contributor Author

Updated

@Julesssss
Copy link
Contributor

Julesssss commented Dec 17, 2021

Hi @rafaysaleem89, the code looks good but I struggled with building to native Android devices (some dependency issues, ect). I'll aim to build and confirm Monday morning.

@marcaaron
Copy link
Contributor

Sorry this code looks good but I'm not able to get push notifications working on Android at all and can't seem to figure out why. Also won't be able to get to this until next week.

@marcaaron
Copy link
Contributor

Guessing they are just not working on dev and need to use the staging server.

@marcaaron
Copy link
Contributor

Oh LOL I recently removed my SIM card so I think they can't work anymore. Going to unassign myself here as I'm unable to test.

@marcaaron marcaaron removed their request for review December 17, 2021 22:21
@Julesssss
Copy link
Contributor

I had further trouble today and didn't get around to this, but I did resolve the release build issues. Back on this tomorrow!

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

Not an Android guy but the code looks neat. and have one question. I leave reviewing and merging to @Julesssss. thanks.

bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);

final int defaultBackgroundColor = 0xff424242;
Copy link
Member

Choose a reason for hiding this comment

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

Is this color used only for masking? If this is shown on the notification then we need to make it theme-specific.
e.g. Dark mode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This color is the fill color for the circle that will be drawn in the background. I don't think that it will ever be shown as there will always be a bitmap drawn on top of it. But we could make it theme specific just in case.

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

I was expecting to see the user's actual profile picture, but this isn't the case. Is that expected @rafaysaleem89?

Android 8
No profile image is displayed
Screenshot_20211221-170938

Android 12
Profile image is displayed, but it is not the actual custom image
Screenshot_20211221-162725_2 Screenshot_20211221-162701

@Julesssss
Copy link
Contributor

The sender has a custom profile image, which I was expecting to see here. Perhaps this was never implemented and should be treated as a separate issue though.

Screenshot 2021-12-21 at 17 16 55

@rafaysaleem89
Copy link
Contributor Author

The sender has a custom profile image, which I was expecting to see here. Perhaps this was never implemented and should be treated as a separate issue though.

Screenshot 2021-12-21 at 17 16 55

this issue might be linked to this part of the code. there is a notification cache in which user information is being saved, and hence it may be that the profile picture is updated later on and it is being retrieved from the cache instead of actually getting it from the server.

image

@rafaysaleem89
Copy link
Contributor Author

@Julesssss how do you want to proceed on this?

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

Code looks fine to me.

@Julesssss
Copy link
Contributor

Hi @rafaysaleem89, sorry for the delay, I have been off over Christmas and NY.

I should have merged previously, as clearly the missing profile is an unrelated issue.

@Julesssss Julesssss merged commit 63a7f55 into Expensify:main Jan 4, 2022
@OSBotify
Copy link
Contributor

OSBotify commented Jan 4, 2022

@rafaysaleem89, Great job getting your first Expensify/App pull request over the finish line! 🎉

I know there's a lot of information in our contributing guidelines, so here are some points to take note of 📝:

  1. Now that your first PR has been merged, you can be hired for another issue. Once you've completed a few issues, you may be eligible to work on more than one job at a time.
  2. Once your PR is deployed to our staging servers, it will undergo quality assurance (QA) testing. If we find that it doesn't work as expected or causes a regression, you'll be responsible for fixing it. Typically, we would revert this PR and give you another chance to create a similar PR without causing a regression.
  3. Once your PR is deployed to production, we start a 7-day timer ⏰. After it has been on production for 7 days without causing any regressions, then we pay out the Upwork job. 💰

So it might take a while before you're paid for your work, but we typically post multiple new jobs every day, so there's plenty of opportunity. I hope you've had a positive experience contributing to this repo! 😊

@OSBotify
Copy link
Contributor

OSBotify commented Jan 4, 2022

🚀 Deployed to staging by @Julesssss in version: 1.1.24-21 🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 failure ❌
🍎 iOS 🍎 failure ❌
🕸 web 🕸 failure ❌

@Julesssss
Copy link
Contributor

Julesssss commented Jan 4, 2022

This failure is due to an existing issue that has now been fixed. At the time of the merge, main hadn't recieved the hotfix.

@mvtglobally
Copy link

@Julesssss @parasharrajat
On what platforms do you need this tested? Android app only or any other

@Julesssss
Copy link
Contributor

Hi @mvtglobally, just Android please.

@OSBotify
Copy link
Contributor

OSBotify commented Jan 5, 2022

🚀 Deployed to production by @francoisl in version: 1.1.25-1 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@parasharrajat
Copy link
Member

Heads up! This PR caused an issue related to Avatar images on android #12967.

Note for me: Although, I am assigned to C+ here Neither I tested/approved it nor did I get paid for this. I handed it over to Jules #6770 (comment) due to unfamiliarity with the native code.

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.

6 participants