Closed Bug 1043029 Opened 10 years ago Closed 10 years ago

Active style for search history/suggestion items

Categories

(Firefox for Android Graveyard :: Search Activity, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 34

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(2 files)

This is a follow-up to bug 1041738.

According to antlam's feedback, we should just change the background color of the card items when they are pressed. NI for some mocks :)
Flags: needinfo?(alam)
Let's give this color a go: #DCDCE1, it's a direct descendent of the background color.
Flags: needinfo?(alam)
This is turning out to be trickier than I thought it would be. I put a WIP here, but it doesn't work right:
https://github.com/leibovic/FirefoxSearch/commit/6e3b118d52814f9c8bd98acd9a5263e01d266d1b

I only started by working on the search history list, not the search suggestions.

The main issue is that it seems we need to use the listSelector property to set a different background when a list item is selected, but that isn't interacting well with the background drawable we're using for the individual items.

Cc'ing lucasr in case he has some wisdom about list item selection styles :)
(In reply to :Margaret Leibovic from comment #2)
> This is turning out to be trickier than I thought it would be. I put a WIP
> here, but it doesn't work right:
> https://github.com/leibovic/FirefoxSearch/commit/
> 6e3b118d52814f9c8bd98acd9a5263e01d266d1b
> 
> I only started by working on the search history list, not the search
> suggestions.
> 
> The main issue is that it seems we need to use the listSelector property to
> set a different background when a list item is selected, but that isn't
> interacting well with the background drawable we're using for the individual
> items.

List selectors are mostly useful for keyboard navigation (when not in 'touch mode'), you don't necessarily need to use it for showing pressed state on individual items. Just use a background drawable that handles pressed state (i.e. selector drawable and focused state) on each list item and remove the list selector from your ListView.
(In reply to Lucas Rocha (:lucasr) from comment #3)
> (In reply to :Margaret Leibovic from comment #2)
> > This is turning out to be trickier than I thought it would be. I put a WIP
> > here, but it doesn't work right:
> > https://github.com/leibovic/FirefoxSearch/commit/
> > 6e3b118d52814f9c8bd98acd9a5263e01d266d1b
> > 
> > I only started by working on the search history list, not the search
> > suggestions.
> > 
> > The main issue is that it seems we need to use the listSelector property to
> > set a different background when a list item is selected, but that isn't
> > interacting well with the background drawable we're using for the individual
> > items.
> 
> List selectors are mostly useful for keyboard navigation (when not in 'touch
> mode'), you don't necessarily need to use it for showing pressed state on
> individual items. Just use a background drawable that handles pressed state
> (i.e. selector drawable and focused state) on each list item and remove the
> list selector from your ListView.

Hm... I tried that originally but it wasn't working for me. Maybe I was missing something or using the wrong state, I'll try that again!
Assignee: nobody → margaret.leibovic
Not sure what I was doing wrong the first time I tried this, but this does the job.

I still had to set the listSelector to transparent, because otherwise it was displaying a default selection color underneath.
Attachment #8464364 - Flags: review?(eric.edens)
Comment on attachment 8464364 [details] [diff] [review]
Pressed style for search history/suggestion items

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

Looks good!
Attachment #8464364 - Flags: review?(eric.edens) → review+
https://hg.mozilla.org/mozilla-central/rev/eed3189b2c66
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
Oops, forgot to hg add the new files:

https://hg.mozilla.org/integration/fx-team/rev/ac4d0d124429
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: