Closed Bug 894045 Opened 9 years ago Closed 8 years ago

Gamepad support for search suggestions

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 26

People

(Reporter: bnicholson, Assigned: bnicholson)

References

Details

(Whiteboard: abouthome-hackathon, fixed-fig)

Attachments

(1 file)

Bug 876765 needs to be ported to fig so a game controller can be used to navigate search suggestions.
I just merged m-c into fig, and I punted on properly merging over the changes from bug 876765, but we should now be able to go ahead and port over that functionality without worrying about more conflicts.

Part of the problem was that on fig there was already a home/SearchEngineRow class, and I didn't want to try to manually go through the SearchEngineRow class on m-c to compare exactly what changes needed to make their way over.
Assignee: nobody → bnicholson
Status: NEW → ASSIGNED
Whiteboard: abouthome-hackathon
Pretty much just a copy/paste from central.
Attachment #781300 - Flags: review?(lucasr.at.mozilla)
Comment on attachment 781300 [details] [diff] [review]
Add gamepad support for search suggestions

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

Nice.

::: mobile/android/base/home/BrowserSearch.java
@@ +232,5 @@
> +
> +        mList.setOnKeyListener(new View.OnKeyListener() {
> +            @Override
> +            public boolean onKey(View v, int keyCode, android.view.KeyEvent event) {
> +                View selected = mList.getSelectedView();

final

@@ +235,5 @@
> +            public boolean onKey(View v, int keyCode, android.view.KeyEvent event) {
> +                View selected = mList.getSelectedView();
> +
> +                if (selected instanceof SearchEngineRow) {
> +                    return ((SearchEngineRow) selected).onKeyDown(keyCode, event);

Do you really need this casting here? AFAIK, onKeyDown is part of View's API.
Attachment #781300 - Flags: review?(lucasr.at.mozilla) → review+
(In reply to Lucas Rocha (:lucasr) from comment #3)
> @@ +235,5 @@
> > +            public boolean onKey(View v, int keyCode, android.view.KeyEvent event) {
> > +                View selected = mList.getSelectedView();
> > +
> > +                if (selected instanceof SearchEngineRow) {
> > +                    return ((SearchEngineRow) selected).onKeyDown(keyCode, event);
> 
> Do you really need this casting here? AFAIK, onKeyDown is part of View's API.

Nope, good catch.

https://hg.mozilla.org/projects/fig/rev/962211a2b765
Whiteboard: abouthome-hackathon → abouthome-hackathon, fixed-fig
https://hg.mozilla.org/mozilla-central/rev/962211a2b765
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.