Closed Bug 1402481 Opened 2 years ago Closed 2 years ago

Fix overlap of divider in highlight empty state

Categories

(Firefox for Android :: General, defect, P1)

ARM
Android
defect

Tracking

()

VERIFIED FIXED
Firefox 58
Iteration:
1.30
Tracking Status
firefox57 --- verified
firefox58 --- fixed

People

(Reporter: liuche, Assigned: liuche)

Details

(Whiteboard: [MobileAS])

Attachments

(2 files)

This is a regression from bug 1400950 where I forgot to reverse the sign of the divider calculation.
Assignee: nobody → liuche
Comment on attachment 8911348 [details]
Bug 1402481 - Reverse incorrect sign of margin calculation.

https://reviewboard.mozilla.org/r/182824/#review188070

lgtm! The biggest problem this solved was the reversed sign when adding/subtracting the margin.

::: mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/HighlightsDividerItemDecoration.java:63
(Diff revision 1)
>              }
>  
>              final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
>                      .getLayoutParams();
> -            final int topOfDivider = child.getTop() + params.topMargin;
> +            final int dividerHeight = divider.getIntrinsicHeight();
> +            // Calculate draw position of divider by accounting for margin and half the divider height.

nit: this comment is redundant to the code. I think it would be useful to describe why we're using the dividerHeight / 2 (in order to span two children views).

::: mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/HighlightsDividerItemDecoration.java:64
(Diff revision 1)
>  
>              final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
>                      .getLayoutParams();
> -            final int topOfDivider = child.getTop() + params.topMargin;
> +            final int dividerHeight = divider.getIntrinsicHeight();
> +            // Calculate draw position of divider by accounting for margin and half the divider height.
> +            final int topOfDivider = child.getTop() - params.topMargin - dividerHeight/2;

nit: `dividerHeight / 2`
Attachment #8911348 - Flags: review?(michael.l.comella) → review+
Pushed by cliu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2b59b2d150ce
Reverse incorrect sign of margin calculation. r=mcomella
Comment on attachment 8911348 [details]
Bug 1402481 - Reverse incorrect sign of margin calculation.

Approval Request Comment
[Feature/Bug causing the regression]: bug 1400950, swapped sign of calculation (+ instead -)
[User impact if declined]: divider line runs through "empty content" text - see screenshot
[Is this code covered by automated tests?]: no
[Has the fix been verified in Nightly?]: local testing, no longer overlapping
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]: no
[Is the change risky?]:no
[Why is the change risky/not risky?]: swap a + and - sign
[String changes made/needed]: none
Attachment #8911348 - Flags: approval-mozilla-beta?
https://hg.mozilla.org/mozilla-central/rev/2b59b2d150ce
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Comment on attachment 8911348 [details]
Bug 1402481 - Reverse incorrect sign of margin calculation.

Fix a visual regression, taking it.
Should be in 57b3
Attachment #8911348 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Verified as fixed in Beta 57.0b3.
Devices:
Asus ZenPad 8.0 Z380KL (Android 6.0.1)
LG G4 (Android 6.0)
Lenovo A536 (Android 4.4.2)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.