Closed Bug 1035642 (widget) Opened 10 years ago Closed 10 years ago

Provide a simple launcher widget for Firefox and the Search Activity

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(relnote-firefox 35+)

VERIFIED FIXED
Firefox 34
Tracking Status
relnote-firefox --- 35+

People

(Reporter: wesj, Assigned: wesj)

References

Details

(Keywords: feature)

Attachments

(5 files, 3 obsolete files)

As a first pass, lets just make a widget that launches Fennec or the search activity. We can tie its creation to the existence of the search activity (for now?).
Attached patch Patch v1 (obsolete) — Splinter Review
Simple widget. There are quite a few images in here that I made myself or stole from other parts of the tree. It would be nice if UX could get us some betters ones or ones for every resolution we support.

Included in here are
1.) A logo image
2.) A new + button for the new tab option (the only one we have is for menus and is to large)
3.) A white background with a short dropshadow on it.
4.) A highlight state for the same buttons
5.) A preview image to show in the widget picker dialog/when dragging a new widget onto your home screen.

Build at:
http://people.mozilla.com/~wjohnston/widget.apk

I'll post a few screenshots too.
Attachment #8452148 - Flags: review?(mark.finkle)
Attached image Screenshot of widget (obsolete) —
Flags: needinfo?(ywang)
Flags: needinfo?(ibarlow)
Flags: needinfo?(alam)
Attached image Preview screenshot
I'll let Anthony nitpick over pixels, but I noticed that the preview in the widgets tray doesn't have any text in it. Can we fix that?
Flags: needinfo?(ibarlow)
Yeah, I yanked it because it wouldn't be localized, but we can add it back. It looks like most Google widgets just don't care about that either.
Ok cool. Also, can New Tab open about:home, instead of about:blank?
Comment on attachment 8452148 [details] [diff] [review]
Patch v1

>diff --git a/configure.in b/configure.in

>-MOZ_ANDROID_SEARCH_ACTIVITY=
>+MOZ_ANDROID_SEARCH_ACTIVITY=1

Not ready to land, right? and shouldn't we do this in confvars anyway?

>diff --git a/mobile/android/base/AndroidManifest.xml.in b/mobile/android/base/AndroidManifest.xml.in

>+#ifdef MOZ_ANDROID_SEARCH_ACTIVITY
>+        <!-- Basic launcher widget. -->
>+        <receiver android:name="org.mozilla.gecko.LaunchWidget" >

This might be too generally named. Is this the SearchWidget?

>diff --git a/mobile/android/base/moz.build b/mobile/android/base/moz.build

>+    'LaunchWidget.java',

Naming TBD (Launch or Search or something else)


>diff --git a/mobile/android/base/resources/drawable-hdpi/launch_widget_preview.png b/mobile/android/base/resources/drawable-hdpi/launch_widget_preview.png

This image seems a little big. Make sure we pngcrush it or pngquant it.

>diff --git a/mobile/android/base/resources/drawable-xhdpi/firefox_logo.png b/mobile/android/base/resources/drawable-xhdpi/firefox_logo.png

Same

>diff --git a/mobile/android/base/resources/drawable/widget_button.xml b/mobile/android/base/resources/drawable/widget_button.xml

Careful with the general naming

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

Same
Attachment #8452148 - Flags: review?(mark.finkle) → feedback+
Attached patch Patch (obsolete) — Splinter Review
Pretty dumb. Pretty simple. I removed the search widget dependency (for now?) Instead we just use a slightly different layout without the search button if its not enabled. I'll grab some screenshots of both.
Attachment #8452148 - Attachment is obsolete: true
Attachment #8462114 - Flags: review?(mark.finkle)
Attached image Without search
Attachment #8452150 - Attachment is obsolete: true
Attached image Preview
Making the preview change based on whether search is installed or not means dynamically bundling some different resources. We could, but I get the feeling this non-search widget isn't as great as I'd hoped anyway. Maybe I should turn that off. For now, everyone gets the same initial previews.
Attached patch Patch v2Splinter Review
Sorry I convinced myself yesterday that having a non-search version of this wasn't that helpful. This removes that (and moves everything into the search folder) Build at:

http://people.mozilla.org/~wjohnston/widget.apk
Attachment #8462114 - Attachment is obsolete: true
Attachment #8462114 - Flags: review?(mark.finkle)
Attachment #8462855 - Flags: review?(mark.finkle)
Flags: needinfo?(ywang)
Flags: needinfo?(alam)
Comment on attachment 8462855 [details] [diff] [review]
Patch v2

>diff --git a/mobile/android/search/java/org/mozilla/search/SearchWidget.java b/mobile/android/search/java/org/mozilla/search/SearchWidget.java
>+        } else if (intent.getAction().equals(ACTION_LAUNCH_SEARCH)) {
>+            redirect = buildRedirectIntent(Intent.ACTION_VIEW,
>+                                           "org.mozilla.search.MainActivity",

Can we make a constant for this string too?

>+    // Utility for adding a pending intent to be fired when a View is clicked.
>+    private void addClickIntent(final Context context, final RemoteViews views, final int viewId, final String action) {
>+        final Intent intent = new Intent(context, SearchWidget.class);
>+        intent.setAction(action);
>+        intent.setData(Uri.parse("about:home"));

You test APK is still going to about:blank. Is it just out of date? Sometimes when Fennec is already running and I press "New Tab" it switches to Fennec, but does not load a new page. Worth debugging, or maybe an out of date APK.

>diff --git a/mobile/android/search/res/layout/search_widget.xml b/mobile/android/search/res/layout/search_widget.xml

>+<!-- A homescreen widget for launching Fennec or the search activity. We can't use styles in here

s/Fennec/the browser

>+    <!-- The logo. adjustViewBounds is required for the buttons above to stretch underneith the logo. -->

nit: underneath

r+ with nits
Attachment #8462855 - Flags: review?(mark.finkle) → review+
Landed the branding resources:
https://hg.mozilla.org/integration/fx-team/rev/9050c556c556

The rest of this needs to land in github.
Whiteboard: [leave-open]
(In reply to Wesley Johnston (:wesj) from comment #13)
> Landed the branding resources:
> https://hg.mozilla.org/integration/fx-team/rev/9050c556c556
> 
> The rest of this needs to land in github.

To clarify, yes, you'll want to make a PR with the required changes, but then you should use `grunt export
Oops, hit the enter key by mistake...

(In reply to :Margaret Leibovic from comment #14)
> (In reply to Wesley Johnston (:wesj) from comment #13)
> > Landed the branding resources:
> > https://hg.mozilla.org/integration/fx-team/rev/9050c556c556
> > 
> > The rest of this needs to land in github.
> 
> To clarify, yes, you'll want to make a PR with the required changes, but
> then you should use `grunt export`

... to create a patch to land on fx-team.
Merged into FirefoxSearch:
https://github.com/ericedens/FirefoxSearch/commit/61a78940142702fe7acffb0a709cb16b9a3796ae

wesj, I'll let you land this on fx-team.
I had to remove the text_color_primary declaration because I was getting a duplicate declaration error when trying to package as part of Fennec. I'll file a separate search activity bug to figure out how we can fix this in the github repo.

https://hg.mozilla.org/integration/fx-team/rev/b4771f701601
Assignee: nobody → wjohnston
Whiteboard: [leave-open]
Depends on: 1046405
Attached image Widget.png
Attaching a WIP of the first iteration for this "simple widget". 

I imagine the 3 functions (from left to right) to be opens Firefox, starts search activity, and opens a new tab. That being said, I've given each the same size in terms of hit areas but given the build logo a backdrop since it also serves another purpose which is branding. 

Pretty basic for now, but I just wanted to post a WIP. Maybe I could get some feedback on which functionality is meant to be the primary and I can try to rejig the UI to create more of a hierarchy (currently they're all on the same level in terms of importance).
Depends on: 1046419
(In reply to Anthony Lam (:antlam) from comment #19)
> Created attachment 8465031 [details]
> Widget.png
> 
> Attaching a WIP of the first iteration for this "simple widget". 
> 
> I imagine the 3 functions (from left to right) to be opens Firefox, starts
> search activity, and opens a new tab. That being said, I've given each the
> same size in terms of hit areas but given the build logo a backdrop since it
> also serves another purpose which is branding. 
> 
> Pretty basic for now, but I just wanted to post a WIP. Maybe I could get
> some feedback on which functionality is meant to be the primary and I can
> try to rejig the UI to create more of a hierarchy (currently they're all on
> the same level in terms of importance).

Since the patch in this bug already landed, I filed bug 1046419 as a follow-up to work on refining the design.
Blocks: search
https://hg.mozilla.org/mozilla-central/rev/b4771f701601
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
Flags: in-moztrap?(fennec)
Keywords: feature, verifyme
OS: Linux → Android
QA Contact: aaron.train
Hardware: x86_64 → ARM
Version: unspecified → Trunk
Is it expected that tapping the branding logo also opens a new tab?
Alias: widget
Status: RESOLVED → VERIFIED
(In reply to Aaron Train [:aaronmt] from comment #22)
> Is it expected that tapping the branding logo also opens a new tab?

In my head, I would think tapping the logo would open up Firefox (just like tapping on the app icon would do in the app drawer)
(In reply to Anthony Lam (:antlam) from comment #23)
> (In reply to Aaron Train [:aaronmt] from comment #22)
> > Is it expected that tapping the branding logo also opens a new tab?
> 
> In my head, I would think tapping the logo would open up Firefox (just like
> tapping on the app icon would do in the app drawer)

Thats reads to me then that the current behaviour is unexpected. I'll open a bug.
Depends on: 1048545
Depends on: 1050101
Depends on: 1050403
Depends on: 1050794
Blocks: 1004715
Removing verifyme flag since the bug was verified.
Keywords: verifyme
Depends on: 1055657
Depends on: 1057613
Blocks: 1058149
Blocks: 1065752
Depends on: 1078166
Depends on: 1078182
Depends on: 1083824
Depends on: 1079891
Depends on: 1098421
For record, Android 5.0 removed lock-screen widget functionality.
Depends on: 1127250
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: