Closed Bug 725990 Opened 12 years ago Closed 12 years ago

Add capability to link from notification

Categories

(Firefox for Android Graveyard :: General, enhancement)

11 Branch
ARM
Android
enhancement
Not set
normal

Tracking

(blocking-fennec1.0 -, fennec+)

RESOLVED FIXED
Firefox 13
Tracking Status
blocking-fennec1.0 --- -
fennec + ---

People

(Reporter: lmandel, Assigned: bnicholson)

References

Details

(Keywords: uiwanted)

Attachments

(1 file)

Notifications (door hangars) on mobile should provide the capability to include links in the text. An specific requirements is for the implementation of bug 725987 we would like to have a "Learn more" link in a notification.
I think we'd want some UX input on what these links should look like.
Keywords: uiwanted
We should decorate these like we do links in content and on the about: pages, so that they're recognizable as tappable thigns.

Have a look at the styling in the Sync setup screens, too -- they've got a blue link on black background.
tracking-fennec: --- → ?
tracking-fennec: ? → +
blocking-fennec1.0: --- → ?
blocking-fennec1.0: ? → -
Blocks: 725987
Assignee: nobody → bnicholson
Attached patch patchSplinter Review
Adds link support to doorhangers. Links are specified as part of the doorhanger options, e.g.,

let options = {
  link: {
    label: "Learn more",
    url: "http://..."
  }
};
NativeWindow.doorhanger.show(msg, value, buttons, tab, options);
Attachment #603142 - Flags: review?(margaret.leibovic)
Blocks: 702319
Comment on attachment 603142 [details] [diff] [review]
patch

>diff --git a/mobile/android/base/resources/layout/doorhanger.xml b/mobile/android/base/resources/layout/doorhanger.xml

>     <TextView android:id="@+id/doorhanger_title"
>               android:layout_width="fill_parent"
>               android:layout_height="wrap_content"
>               android:textAppearance="?android:attr/textAppearanceMedium"
>               android:textColor="?android:attr/textColorPrimary"
>+              android:textColorLink="#ACC4D5"

Is hard-coding a color like this okay? We're using a system color for textColor, so shouldn't we also be using some system color for the link?
(In reply to Margaret Leibovic [:margaret] from comment #4)
>
> Is hard-coding a color like this okay? We're using a system color for
> textColor, so shouldn't we also be using some system color for the link?

TBH, I don't know what our current conventions are, if we have any, for using colors. We use system colors in some layouts, but we use hard-coded custom values in  others. If we use system colors, which ones do we use? How do we know they'll look good on all devices?

For custom values, we should probably at least factor them out into styles like those resources/values/styles.xml and resources/values/sync_styles.xml to clean things up a bit (note that these files also contain hard-coded colors). But it might be better to reserve that for a separate patch.
(In reply to Brian Nicholson (:bnicholson) from comment #5)
> TBH, I don't know what our current conventions are, if we have any, for
> using colors. We use system colors in some layouts, but we use hard-coded
> custom values in  others. If we use system colors, which ones do we use? How
> do we know they'll look good on all devices?

We should talk to UX folks and formalize these conventions (or lack thereof) for future reference. I'm not certain our existing color rules were all made intentionally.

> For custom values, we should probably at least factor them out into styles
> like those resources/values/styles.xml and resources/values/sync_styles.xml
> to clean things up a bit (note that these files also contain hard-coded
> colors). But it might be better to reserve that for a separate patch.

Yeah, let's file a follow-up for that.
Comment on attachment 603142 [details] [diff] [review]
patch

>diff --git a/mobile/android/base/DoorHanger.java b/mobile/android/base/DoorHanger.java

>+            SpannableString titleWithLink = new SpannableString(title + " " + linkLabel);

This doesn't look RTL-friendly, but I'm not sure what the expectation is for a link coming before or after the title text in RTL mode (also, more generally, I'm not sure how careful we've been to properly support RTL locales in other parts of the Java UI). Maybe file a follow-up to look into whether or not this is a problem?
Attachment #603142 - Flags: review?(margaret.leibovic) → review+
Filed bug 733588 for style cleanup.

I don't know which system color to use for the links - if we should even use system colors here - so I kept the hard-coded color for now (though I did move it to colors.xml). If necessary, we can come back and change this to an Android system color in bug 733588.

As discussed with gavin in IRC, we've been appending the link onto the right side of the doorhanger label for awhile now in desktop. There haven't been any problems, so we should be okay here.
https://hg.mozilla.org/mozilla-central/rev/55051c4e95c7
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
(In reply to Mark Finkle (:mfinkle) from comment #11)
> In About Home, we are using #22629e for the link color in 3 places:
> http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/resources/
> layout/abouthome_content.xml#69

We should address that (and all other hard-coded colors) in bug 733588.
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: