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

[Android] fix ntp background image aspect ratio #17186

Merged
merged 2 commits into from
Feb 21, 2023

Conversation

tapanmodh
Copy link
Contributor

@tapanmodh tapanmodh commented Feb 14, 2023

Resolves brave/brave-browser#28450

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run lint, npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

something that measures the "squareness" or the aspect ratio of something identifiable on one of the bg images.
Please double check private tabs are not affected

@tapanmodh tapanmodh added CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS labels Feb 14, 2023
@tapanmodh tapanmodh added this to the 1.50.x - Nightly milestone Feb 14, 2023
@tapanmodh tapanmodh self-assigned this Feb 14, 2023
@tapanmodh tapanmodh force-pushed the fix_ntp_bg_image_aspect_ratio_android branch from 6c55f61 to e7d4837 Compare February 21, 2023 18:15
@tapanmodh tapanmodh requested a review from samartnik February 21, 2023 18:18
Copy link
Contributor

@samartnik samartnik left a comment

Choose a reason for hiding this comment

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

lgtm

mWorkerTask = new FetchWallpaperWorkerTask(
ntpImage, mDeviceWidth, mDeviceHeight, wallpaperRetrievedCallback);
mWorkerTask =
new FetchWallpaperWorkerTask(ntpImage, mBgImageView.getMeasuredWidth(),
Copy link
Contributor

Choose a reason for hiding this comment

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

@tapanmodh what's the reasoning here to use imageview size over the screen size ? is it related to top bar and bottom bar size ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, because of use of screen size, bottom parts of ntp image was getting cut. As per design instructions, we need to display full size of image's height in the ntp.

Copy link
Contributor

@deeppandya deeppandya left a comment

Choose a reason for hiding this comment

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

Changes LGTM

@kjozwiak
Copy link
Member

kjozwiak commented Feb 22, 2023

Verification PASSED on Pixel 6 running Android 13 using the following build(s):

Brave | 1.50.55 Chromium: 110.0.5481.104 (Official Build) canary (32-bit)
--- | ---
Revision | 46de4a7f41979e829b430bc1ee30ef483aa227ac-refs/branch-heads/5481_77@{#19}
OS | Android 13; Build/TQ1A.230205.002

Image examples from 1.50.54 Chromium: 110.0.5481.104 which is the broken build

Example Example Example Example Example
Screenshot_20230222-131453 Screenshot_20230222-131653 Screenshot_20230222-131926 Screenshot_20230222-131645 Screenshot_20230222-131723

Image examples from 1.50.55 Chromium: 110.0.5481.104 which is the fixed build

Example Example Example Example Example
Screenshot_20230222-132616 Screenshot_20230222-132528 Screenshot_20230222-132541 Screenshot_20230222-132519 Screenshot_20230222-132505
Example Example Example Example Example
Screenshot_20230222_143746_Brave - Nightly Screenshot_20230222_143705_Brave - Nightly Screenshot_20230222_143723_Brave - Nightly Screenshot_20230222_143651_Brave - Nightly Screenshot_20230222_143831_Brave - Nightly

@deeppandya also went through the above using his Pixel 7 Pro device and confirmed that the grid images are appearing correctly as per the following:

Example Example Example Example
Screenshot_20230223-015210 Screenshot_20230223-015246 Screenshot_20230223-015237 Screenshot_20230223-015251

kjozwiak pushed a commit that referenced this pull request Feb 23, 2023
kjozwiak pushed a commit that referenced this pull request Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-ios Do not run CI builds for iOS CI/skip-macos-x64 Do not run CI builds for macOS x64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android NTP background images are the wrong aspect ratio
4 participants