Closed Bug 716095 Opened 13 years ago Closed 12 years ago

[tablet] Add a max width to door hangers

Categories

(Firefox for Android Graveyard :: General, defect, P3)

ARM
Android
defect

Tracking

(firefox15 verified, firefox16 verified, firefox17 verified, fennec15+)

VERIFIED FIXED
Firefox 16
Tracking Status
firefox15 --- verified
firefox16 --- verified
firefox17 --- verified
fennec 15+ ---

People

(Reporter: mfinkle, Assigned: Margaret)

References

Details

(Whiteboard: [tablet])

Attachments

(2 files, 2 obsolete files)

When displaying on tablets, doorhanger notifications span the entire width of the screen. This looks a bit silly. We could easily add a max width.
Whiteboard: [tablet]
tracking-fennec: --- → 12+
Priority: -- → P3
Assignee: nobody → dpetters
Attachment #587815 - Attachment description: Not being sure how to apply max_width, I first tried setting the width layoutparm to wrap_content. This seems to have given the des have given the desired behaviour on an Asus Tablet and Galaxy Nexus. → Not being sure how to apply max_width, I first tried setting the width LayoutParam to WRAP_CONTENT. This seems to have given the desired behavior on an Asus Tablet and Galaxy Nexus.
Status: NEW → ASSIGNED
Comment on attachment 587815 [details] [diff] [review]
Not being sure how to apply max_width, I first tried setting the width LayoutParam to WRAP_CONTENT. This seems to have given the desired behavior on an Asus Tablet and Galaxy Nexus.

Sriram - Can you look this patch over and give some feedback?
Attachment #587815 - Flags: feedback?(sriram)
Comment on attachment 587815 [details] [diff] [review]
Not being sure how to apply max_width, I first tried setting the width LayoutParam to WRAP_CONTENT. This seems to have given the desired behavior on an Asus Tablet and Galaxy Nexus.

Could you please post a screenshot with this patch?
Changing the FILL_PARENT to WRAP_CONTENT can cause issues if the text we should is very small (like 2 words). 
I would probably do a WRAP_CONTENT and set a minWidth for DoorHanger to make sure the width is atleast 200 dip or something. [http://developer.android.com/reference/android/view/View.html#setMinimumWidth%28int%29]
If that doesn't work, we might need to override onSizeChanged().

Marking it feedback-. If the screenshots are fine for very small text doorhangers, I am happy with this patch :)
Attachment #587815 - Flags: feedback?(sriram) → feedback-
Assignee: dpetters → nobody
tracking-fennec: 12+ → 15+
Margaret - Can you take this one?
Assignee: nobody → margaret.leibovic
Attached patch patch with min/max width (obsolete) — Splinter Review
This patch correctly limits the width of the doorhanger to be within a certain range, but we may want to adjust what that range is. Using 200dip makes it so that the doorhanger may not take up the entire width on phones, and I'm not sure that we want that.

When the doorhanger doesn't take up the whole width, the arrow is misaligned. This is already a problem on tablets (see bug 768073), but I'm thinking we could pass an offset to showAsDropDown to fix it.

Also, the sides of the doorhanger look really sharp when they're not against the edge of the screen, so we may want new assets for that.
Attachment #587815 - Attachment is obsolete: true
Attachment #636442 - Flags: feedback?(sriram)
Attached image screenshot
Here's a screenshot. You can see that our current use of showAsDropDown is just aligning the doorhanger with the left side of the favicon.
Comment on attachment 636442 [details] [diff] [review]
patch with min/max width

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

This looks good for me.
But since phones should have full screen width, please add the layout file to layout-xlarge/ and layout-sw600dp/
and leave the phone related ones like how it was early. It should work fine (with a "if" clause for windowlayout mode) :)
Attachment #636442 - Flags: feedback?(sriram) → feedback+
I checked that this maintains the old appearance on phones, but uses the correct restricted width for tablets.

I can file a follow-up to update the resources to make the edges look better.
Attachment #636442 - Attachment is obsolete: true
Attachment #636869 - Flags: review?(sriram)
Comment on attachment 636869 [details] [diff] [review]
patch with different layouts for tablet

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

This looks good to me.
I kind of don't like the "widthSpec" variable. If you could bring the tertiary operator into the setWindowLayoutMode(), that would be nice.
Attachment #636869 - Flags: review?(sriram) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/cd3101aa0360
Target Milestone: --- → Firefox 16
https://hg.mozilla.org/mozilla-central/rev/cd3101aa0360
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment on attachment 636869 [details] [diff] [review]
patch with different layouts for tablet

[Approval Request Comment]
Bug caused by (feature/regressing bug #): this is an issue with the new tablet UI, which is tracking 15
User impact if declined: doorhangers stretch all the way across the screen
Testing completed (on m-c, etc.): just landed on m-c
Risk to taking this patch (and alternatives if risky): low-risk, adds some new tablet-specific layouts
String or UUID changes made by this patch: n/a
Attachment #636869 - Flags: approval-mozilla-aurora?
Depends on: 768999
Depends on: 768073
Attachment #636869 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Status: RESOLVED → VERIFIED
OS: Linux → Android
Hardware: x86 → ARM
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: