Closed
Bug 866352
Opened 12 years ago
Closed 11 years ago
"Up" behavior in Settings ActionBar broken for nested xml preference screens
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 833625
People
(Reporter: liuche, Assigned: liuche)
References
Details
Attachments
(1 file, 1 obsolete file)
35.01 KB,
patch
|
Details | Diff | Splinter Review |
If you use nesting of PreferenceScreens in xml to build tiered preferences screens, the icon in the action bar does nothing when clicked. (This looks like an Android bug.) Currently we don't use this, but we might want to do so in the future.
Building tiered preferences screens via xml is the easiest way to make nested preference screens, but AFAICT it's not possible to get a handle to the ActionBar object that is actually displayed. This is a problem in v14+ where you must explicitly enable the "up" behavior with actionBar.setHomeButtonEnabled().
The hack is to make each settings tier its own Activity, so you don't have to deal with this nesting ActionBar bug.
Basically, this involves lifting out an abstract GeckoPreferencesActivity (from GeckoPreferences) that has the basic settings screen behavior, and let all settings screens inherit from there, so every settings screen is a "first-tier" PreferenceScreen.
Other approaches are:
- leave the "up" button on second-tier screens broken
- remove the "up" arrow and "up" behavior from the ActionBar
Assignee | ||
Updated•12 years ago
|
QA Contact: liuche
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → liuche
QA Contact: liuche
Comment 1•12 years ago
|
||
This work could tie into work Wes is doing to make the Setting screen better organized.
Assignee | ||
Comment 2•12 years ago
|
||
Abstract out preferences for preferences screen. Groundwork for nested (non-broken) PreferenceScreens+ActionBar.
This is almost a strict lift of shared parts of GeckoPreferences into and abstract GeckoPreferencesActivity, except for the following:
- requiring nested preference screens support multi-pane mode for tablets
- fixed a strict-mode error in setting the Title Bar pref
Attachment #743750 -
Flags: review?(wjohnston)
Attachment #743750 -
Flags: feedback?(bnicholson)
Assignee | ||
Comment 3•12 years ago
|
||
Note: since GeckoPreferences is changed fairly frequently, I'll check for changes to GeckoPreferences and incorporate them, because they will require manual copying/lifting.
Comment 4•12 years ago
|
||
Comment on attachment 743750 [details] [diff] [review]
Abstract out preferences screen v1
Looks like you forgot to add GeckoPreferencesActivity to your patch.
Attachment #743750 -
Flags: review?(wjohnston) → review-
Comment 5•12 years ago
|
||
Comment on attachment 743750 [details] [diff] [review]
Abstract out preferences screen v1
Err, flipped the wrong flag.
Attachment #743750 -
Flags: review?(wjohnston)
Attachment #743750 -
Flags: review-
Attachment #743750 -
Flags: feedback?(bnicholson)
Attachment #743750 -
Flags: feedback-
Assignee | ||
Comment 6•12 years ago
|
||
Derp, added GeckoPreferencesActivity.
Attachment #743750 -
Attachment is obsolete: true
Attachment #743750 -
Flags: review?(wjohnston)
Attachment #743841 -
Flags: review?(wjohnston)
Attachment #743841 -
Flags: feedback?(bnicholson)
Updated•12 years ago
|
Attachment #743841 -
Attachment is patch: true
Assignee | ||
Comment 7•12 years ago
|
||
Ian, some input from you: I've been talking to Brian and Wes about the higher complexity that this hack adds, and I was wondering if you think it'd be acceptable to leave off the "up" arrows in the settings menu. On further thought, I don't think it's very easy to fake the "up" behavior.
As I see it, the up functionality is useful for navigating through the levels of an app if the user has been redirected there from somewhere else; in that case, the back button has a different functionality, returning the user to whichever app did the redirect.
Anyways, what is your opinion of removing the "up" arrow in the Fennec settings action bar?
I've posted two apks on people if you want to try them out. "Data choices" is the only nested screen at the moment.
https://people.mozilla.com/~liuche/bug-866352/
Flags: needinfo?(ibarlow)
Comment 8•12 years ago
|
||
Hm, I definitely find myself missing the Up arrow when it's not there...
I also notice that some Google apps (Gmail, Calendar, Chrome) have the up arrow in nested Settings lists, while others strangely do not (Maps, for one). Any idea what apps like Gmail and Chrome might be doing that we aren't? It would be great to keep the up arrow if we can.
Flags: needinfo?(ibarlow)
Assignee | ||
Comment 9•12 years ago
|
||
I was playing around Gmail this morning, and it appears that each level is a separate activity, so they won't be running into the action bar problem. I'm not sure exactly how they do the "up" behavior, but it's possible that they hard-code an "up" hierarchy (a guess on my part).
Chrome seems to do something different which is interesting, and I'll investigate a little more - thanks for the feedback, Ian!
Assignee | ||
Comment 10•11 years ago
|
||
Closing this as invalid, because bug 833625 implements an approach for nesting Preference Screens, using Fragments for v11 and above and PreferenceScreen intents for versions less than v11. This approach does create xml resource duplication, so we might consider a fragment-only approach at some point, although this likely involves copying a lot of Android v11 code.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Updated•11 years ago
|
Attachment #743841 -
Flags: review?(wjohnston)
Attachment #743841 -
Flags: feedback?(bnicholson)
Assignee | ||
Updated•11 years ago
|
Resolution: INVALID → DUPLICATE
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•