Closed Bug 1312922 Opened 8 years ago Closed 8 years ago

On iOS 10 the Today Widget should support Compact and Expanded display

Categories

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

Other
iOS
defect

Tracking

()

RESOLVED FIXED
Iteration:
1.8
Tracking Status
fxios 6.0+ ---
fxios-v6.0 --- fixed
fxios-v7.0 --- fixed

People

(Reporter: st3fan, Assigned: farhan)

References

Details

(Whiteboard: [MobileAS])

Attachments

(3 files, 1 obsolete file)

So this is interesting. On iOS 10 Today Widgets are a fixed height. For ours, it is just tall enough to hold the New Tab buttons. But the Go To Copied Link button does not fit in it. But, a widget can ask the to be 'Expanded', which means a 'Show More' or 'Show Less' button appears in its title bar. When the user taps that button, the widget can grow bigger to show additional content. I have a (bad) patch ready that takes advantage of this and does the following: * If the today widget is shown and there is no link on the pasteboard, the widget size is Compact. It just shows the two New Tab buttons and no Show More button in the title bar. * If the today widget is shown and we do have a link on the pasteboard, then the widget opens by default in Compact mode, but the user can tap Show More to show the Go To Copied Link button. There is one caveat: only a user interaction (tap on Show More/Less) can change the size of the widget. They start Compact. But once you have chosen to show Expanded, it stays that way. In our case that means once the user has tapped Show more, the widget will always correctly size based on what is on the pasteboard. Movie attached with how this currently looks.
Flags: needinfo?(randersen)
Very rough initial patch that only works well on iOS 10 for now.
Summary: On iOS 10 the Today Widget does not have enough room for the copied link → On iOS 10 the Today Widget should support Compact and Expanded display
Whiteboard: [MobileAS]
Priority: -- → P1
Status: NEW → ASSIGNED
Comment on attachment 8804521 [details] [review] PR: https://github.com/mozilla-mobile/firefox-ios/pull/2195 Farhan, you most recently worked with the Today Widget code. Can you take a look at my patch and see if it is going the right way?
Attachment #8804521 - Flags: review?(fpatel)
Assignee: sarentz → fpatel
Attached image widget without expand
Hey Robin. So I can get this working without the "show more/less". I've attached a screenshot of how it looks. The original reason this patch was written was because the spacing between the new tab buttons and the copied link button was missing. Things are still a bit tight but we have the advantage of not having to hide functionality. If you want to take the time now to update anything in the Today Widget I can do that now too.
Attachment #8805895 - Flags: ui-review?(randersen)
Attachment #8804521 - Flags: review?(fpatel) → review-
(In reply to Farhan Patel from comment #5) > Created attachment 8805895 [details] > widget without expand > > Hey Robin. So I can get this working without the "show more/less". I've > attached a screenshot of how it looks. > > The original reason this patch was written was because the spacing between > the new tab buttons and the copied link button was missing. Things are still > a bit tight but we have the advantage of not having to hide functionality. > > If you want to take the time now to update anything in the Today Widget I > can do that now too. I'd still like to pin down why our release version still has the (preferred) darker background. See http://c.tecgirl.com/hxe0 Instead of re-working the palette to better serve the contrast ratio, can we at least get the background dark again (on both lock/notif screen and homescreen) and open up the line-height to match?
Flags: needinfo?(randersen)
(In reply to Robin Andersen [:tecgirl] from comment #6) > (In reply to Farhan Patel from comment #5) > > Created attachment 8805895 [details] > > widget without expand > > > > Hey Robin. So I can get this working without the "show more/less". I've > > attached a screenshot of how it looks. > > > > The original reason this patch was written was because the spacing between > > the new tab buttons and the copied link button was missing. Things are still > > a bit tight but we have the advantage of not having to hide functionality. > > > > If you want to take the time now to update anything in the Today Widget I > > can do that now too. > > I'd still like to pin down why our release version still has the (preferred) > darker background. See http://c.tecgirl.com/hxe0 Apple renders the widget differently based on what SDK the app is linked against. The release version is linked against the iOS 9 SDK while Nightly is linked against the iOS 10 SDK. > Instead of re-working the palette to better serve the contrast ratio, can we > at least get the background dark again (on both lock/notif screen and > homescreen) and open up the line-height to match? I don't think this is the right thing to do. On iOS 10 the widgets have a different style and we should follow that. If we use the vibrancy APIs, iOS will actually give us the right colors to use for text. Without us having to know if iOS will render the widget with Dark or Light style vibrancy.
Yea, Stefan has it right. I'll make sure that the color of the text matches the widget on both ios9/10
Attachment #8805895 - Flags: ui-review?(randersen)
Attached image finaltoday.jpg
Let me know what you think of the colors/alignment in this one. I've included both iOS9/iOS10 in the screenshot.
Attachment #8806273 - Flags: ui-review?(randersen)
Woops. Don't mind the "Show more" thats appearing. I've disabled that and it wont appear in the actual widget anymore.
Attached file Pull Request
I changed the widget to use the tint color property more to set the desired colors. This allows UIVibrancyEffect to work correctly on iOS10. On iOS9 I just set the tintColor to white manually. I also added some spacing between the copied link button and the rest of the extension.
Attachment #8804521 - Attachment is obsolete: true
Attachment #8806277 - Flags: review?(sarentz)
Iteration: --- → 1.8
Comment on attachment 8806277 [details] [review] Pull Request LGTM
Attachment #8806277 - Flags: review?(sarentz) → review+
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [MobileAS] → [MobileAS][needsuplift]
v6.x b5b1093
Whiteboard: [MobileAS][needsuplift] → [MobileAS]
Attachment #8806273 - Flags: ui-review?(randersen)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: