Closed Bug 697299 Opened 8 years ago Closed 8 years ago

Disable preferences before Gecko is loaded

Categories

(Firefox for Android :: General, defect)

All
Android
defect
Not set

Tracking

()

VERIFIED FIXED

People

(Reporter: bnicholson, Assigned: bnicholson)

Details

(Whiteboard: [testday-20111111])

Attachments

(2 files, 1 obsolete file)

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 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-
Attachment #569531 - Attachment is obsolete: true
Attachment #569536 - Flags: review?(doug.turner)
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
http://hg.mozilla.org/projects/birch/rev/6dae4cc31859
Status: ASSIGNED → RESOLVED
Closed: 8 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.
Attached patch additional patchSplinter Review
we need to do the update on the UI thread.  this patch fixes that (and addresses the problem aaron mentioned).
Attachment #569855 - Flags: review?
Attachment #569855 - Flags: review? → review?(doug.turner)
reopened for new patch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #569855 - Flags: review?(doug.turner) → review+
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+
http://hg.mozilla.org/projects/birch/rev/0716912a1f7f
Status: REOPENED → RESOLVED
Closed: 8 years ago8 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.