Disable preferences before Gecko is loaded

VERIFIED FIXED

Status

()

Firefox for Android
General
VERIFIED FIXED
6 years ago
a year ago

People

(Reporter: bnicholson, Assigned: bnicholson)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [testday-20111111])

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 569531 [details] [diff] [review]
disables menu item before gecko is ready

If the user tries to view the preferences activity before Gecko has been loaded, the screen won't be populated with the user's preferences.  This patch prevents the preferences activity from being shown before Gecko has been loaded.
Attachment #569531 - Flags: review?(doug.turner)

Comment 1

6 years ago
Comment on attachment 569531 [details] [diff] [review]
disables menu item before gecko is ready

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

looks good.  two nits.  post another patch, i'll r+

::: embedding/android/GeckoApp.java
@@ +101,5 @@
>      private PopupWindow mTabsTray;
>      private TabsAdapter mTabsAdapter;
>      public DoorHanger mDoorHanger;
>      private static boolean isTabsTrayShowing;
> +    private static boolean sIsGeckoReady = false;

can you rename isTabsTrayShowing to sIsTabsTrayShowing while you are here?

@@ +400,5 @@
>          sMenu = menu;
>          MenuInflater inflater = getMenuInflater();
>          inflater.inflate(R.layout.gecko_menu, menu);
> +        if (sIsGeckoReady)
> +            menu.findItem(R.id.preferences).setEnabled(true);

how would sIsGeckoReady ever be true here?  You probably can just drop these two lines.
Attachment #569531 - Flags: review?(doug.turner) → review-
(Assignee)

Comment 2

6 years ago
Created attachment 569536 [details] [diff] [review]
updated with renamed sIsTabsTrayShowing
Attachment #569531 - Attachment is obsolete: true
Attachment #569536 - Flags: review?(doug.turner)
(Assignee)

Comment 3

6 years ago
re: how would sIsGeckoReady ever be true here?  You probably can just drop these two lines.

the menu is recreated every time the activity is recreated
e.g., the view is rotated or the user clicks back and resumes fennec again without quitting first

Comment 4

6 years ago
http://hg.mozilla.org/projects/birch/rev/6dae4cc31859
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
When Gecko is ready, are you able to flip android:enabled="false" to true? If a user has the menu bar open, after Gecko is ready, the Preferences item is still greyed out.
(Assignee)

Comment 6

6 years ago
Created attachment 569855 [details] [diff] [review]
additional patch

we need to do the update on the UI thread.  this patch fixes that (and addresses the problem aaron mentioned).
Attachment #569855 - Flags: review?
(Assignee)

Updated

6 years ago
Attachment #569855 - Flags: review? → review?(doug.turner)
(Assignee)

Comment 7

6 years ago
reopened for new patch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Updated

6 years ago
Attachment #569855 - Flags: review?(doug.turner) → review+

Comment 8

6 years ago
Comment on attachment 569536 [details] [diff] [review]
updated with renamed sIsTabsTrayShowing

w/ the other patch to post the UI manipulation to the right thread.
Attachment #569536 - Flags: review?(doug.turner) → review+
(Assignee)

Comment 9

6 years ago
http://hg.mozilla.org/projects/birch/rev/0716912a1f7f
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
Verified on Samsung Galaxy S2 during 11/11/11 testday.
Status: RESOLVED → VERIFIED
Whiteboard: [testday-20111111]
You need to log in before you can comment on or make changes to this bug.