Closed Bug 1065663 Opened 10 years ago Closed 10 years ago

Tabs tray is empty

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 35

People

(Reporter: lucasr, Assigned: lucasr)

References

Details

(Whiteboard: [fixed-larch])

Attachments

(1 file)

mhaigh did the right thing (tm) in his recent adapter changes (i.e. using inflate(int,ViewGroup,boolean) instead of inflate(int,null)) but that exposed a little bug in TwoWayView when using invalid layout params in child views.
Attachment #8487518 - Flags: review?(michael.l.comella)
In case you're wondering why this is happening...

When you use inflate(id, null), the inflated view will fallback to the container's default LayoutParams. This is not a good practice and leads to confusion. See this blog post for more context: http://www.doubleencore.com/2013/05/layout-inflation-as-intended/

When you use inflate(id, parent, false) though, the inflated view's LayoutParams are taken into account when adding it to its container later. In this case, the container is supposed to validate their child LayoutParams (checkLayoutParams(LayoutParams)) and create a new one if validation fails (generateLayoutParams(LayoutParams)). TwoWayView is accepting invalid LayoutParams which causes the child views to be incorrectly measured.

I could fix TwoWayView now but it's a riskier change at this point. I filed bug 1065672 to track the TwoWayView bug. For now, this is the simplest solution. And using width=match_parent in tabs_item_cell doesn't really make sense anyway.
Comment on attachment 8487518 [details] [diff] [review]
Use correct layout param for TwoWayView in tabs_item_cell (r=mcomella)

Review of attachment 8487518 [details] [diff] [review]:
-----------------------------------------------------------------

Makes sense because the the content size is not defined in terms of the parent width (which would change from match_parent -> wrap_content).
Attachment #8487518 - Flags: review?(michael.l.comella) → review+
https://hg.mozilla.org/projects/larch/rev/125cc63143af
Whiteboard: [fixed-larch]
https://hg.mozilla.org/mozilla-central/rev/125cc63143af
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 35
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: