Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #15402: Hide ETP pop-up if the toolbar is not visible #15667

Merged
merged 5 commits into from Oct 9, 2020

Conversation

sijanr
Copy link
Contributor

@sijanr sijanr commented Oct 4, 2020

ETP

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@sijanr sijanr requested review from a team as code owners October 4, 2020 03:02
@firefoxci-taskcluster
Copy link

No Taskcluster jobs started for this pull request
The `allowPullRequests` configuration for this repository (in `.taskcluster.yml` on the
default branch) does not allow starting tasks for this pull request.

Copy link
Contributor

@Mugurell Mugurell left a comment

Choose a reason for hiding this comment

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

Thank you for looking into this!

For a complete fix we need the same issue also resolved for when the toolbar is set at top (to know about this I think you can use a AppBarLayout.OnOffsetChangedListener)

Changes after which TrackingProtectionOverlayTest will probably need to be updated.

@Mugurell Mugurell self-assigned this Oct 5, 2020
@Mugurell Mugurell added the pr:needs-changes PRs that need some changes/fixes before they can land label Oct 5, 2020
Copy link
Contributor Author

@sijanr sijanr left a comment

Choose a reason for hiding this comment

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

The issue with adding the listener would be there's already one added for the app bar in BrowserToolbarView.kt.

app_bar.addOnOffsetChangedListener(offsetChangedListener)

So, I checked the parent of the toolbar instead.

@Mugurell
Copy link
Contributor

Mugurell commented Oct 6, 2020

Thank you!
It looks and functions nicely!
Just one improvement to be made regarding knowing if we have a top or bottom toolbar.
Some small tests just for the return would be nice but I see the showTrackingProtectionOnboarding does quite a lot so fully testing this could be done in a later ticket.

Copy link
Contributor Author

@sijanr sijanr left a comment

Choose a reason for hiding this comment

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

Yeah I agree with you that the code couldn't be easily read. I found a property to check the toolbar's position in Settings class and included it in the check because it appeared more readable. Thanks for your help.

@Mugurell
Copy link
Contributor

Mugurell commented Oct 7, 2020

Yeah I agree with you that the code couldn't be easily read. I found a property to check the toolbar's position in Settings class and included it in the check because it appeared more readable. Thanks for your help.

Thank you!
It looks indeed better!

One small thing related to a safe cast to be resolved and then I'll merge this.

@Mugurell
Copy link
Contributor

Mugurell commented Oct 8, 2020

bors try

bors bot pushed a commit that referenced this pull request Oct 8, 2020
@bors
Copy link

bors bot commented Oct 8, 2020

try

Build succeeded:

@Mugurell
Copy link
Contributor

Mugurell commented Oct 8, 2020

@sijanr
Looks like ktlint fails at

TrackingProtectionOverlay.kt:16:1: Unused import
TrackingProtectionOverlay.kt:61:19: Missing spacing after "if"
TrackingProtectionOverlay.kt:68:23: Missing spacing after "if"

Can you please check and update the patch?

Copy link
Contributor Author

@sijanr sijanr left a comment

Choose a reason for hiding this comment

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

I think this should fix the ktlint errors

@Mugurell
Copy link
Contributor

Mugurell commented Oct 9, 2020

bors try

bors bot pushed a commit that referenced this pull request Oct 9, 2020
@bors
Copy link

bors bot commented Oct 9, 2020

try

Build succeeded:

Copy link
Contributor

@Mugurell Mugurell left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for pushing through with this!

@Mugurell
Copy link
Contributor

Mugurell commented Oct 9, 2020

bors r=Mugurell

@bors
Copy link

bors bot commented Oct 9, 2020

👎 Rejected by label

@Mugurell Mugurell removed the pr:needs-changes PRs that need some changes/fixes before they can land label Oct 9, 2020
@Mugurell
Copy link
Contributor

Mugurell commented Oct 9, 2020

bors r=Mugurell

bors bot pushed a commit that referenced this pull request Oct 9, 2020
15667: For #15402: Hide ETP pop-up if the toolbar is not visible r=Mugurell a=sijanr


![ETP](https://user-images.githubusercontent.com/47872289/95005944-269c6280-05b3-11eb-870e-4bd2ef90bf79.gif)

### Pull Request checklist
<!-- Before submitting the PR, please address each item -->
- [ ] **Tests**: This PR includes thorough tests or an explanation of why it does not
- [x] **Screenshots**: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
- [ ] **Accessibility**: The code in this PR follows [accessibility best practices](https://github.com/mozilla-mobile/shared-docs/blob/master/android/accessibility_guide.md) or does not include any user facing features. In addition, it includes a screenshot of a successful [accessibility scan](https://play.google.com/store/apps/details?id=com.google.android.apps.accessibility.auditor&hl=en_US) to ensure no new defects are added to the product.

### To download an APK when reviewing a PR:
1. click on Show All Checks,
2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
3. click on the "Fenix - assemble" task, then click "Run Artifacts".
4. the APK links should be on the left side of the screen, named for each CPU architecture


Co-authored-by: sijanr <sijan1.rijal@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #15667 into master will increase coverage by 0.01%.
The diff coverage is 20.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #15667      +/-   ##
============================================
+ Coverage     29.79%   29.80%   +0.01%     
- Complexity     1180     1182       +2     
============================================
  Files           452      452              
  Lines         18394    18401       +7     
  Branches       2376     2381       +5     
============================================
+ Hits           5481     5485       +4     
- Misses        12525    12528       +3     
  Partials        388      388              
Impacted Files Coverage Δ Complexity Δ
...ix/trackingprotection/TrackingProtectionOverlay.kt 67.79% <20.00%> (-9.13%) 9.00 <4.00> (ø)
app/src/main/java/org/mozilla/fenix/Config.kt 50.00% <0.00%> (-4.55%) 2.00% <0.00%> (ø%)
...mponents/searchengine/FenixSearchEngineProvider.kt 60.71% <0.00%> (+2.67%) 14.00% <0.00%> (ø%)
...in/java/org/mozilla/fenix/settings/SupportUtils.kt 74.50% <0.00%> (+3.92%) 13.00% <0.00%> (+2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec3595d...c6d5108. Read the comment docs.

@Mugurell Mugurell merged commit 127d006 into mozilla-mobile:master Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants