Closed
Bug 1264599
Opened 9 years ago
Closed 9 years ago
GeckoPreferences: Remove CheckBoxPrefSetter and TwoStatePrefSetter
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox49 fixed)
RESOLVED
FIXED
Firefox 49
| Tracking | Status | |
|---|---|---|
| firefox49 | --- | fixed |
People
(Reporter: sebastian, Assigned: gui.bgd, Mentored)
References
Details
(Whiteboard: [lang=java][good next bug])
Attachments
(1 file, 2 obsolete files)
|
2.46 KB,
patch
|
sebastian
:
review+
|
Details | Diff | Splinter Review |
In GeckoPreferences we use CheckBoxPrefSetter and TwoStatePrefSetter to set a preference with a checkbox in a backwards compatible way. Now with ICS as base line we don't need that anymore and can just use TwoStatePreference.
https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java#1438-1473
Comment 1•9 years ago
|
||
Please assign this bug to me. Thanks.
| Reporter | ||
Updated•9 years ago
|
Assignee: nobody → jorick.caberio
Status: NEW → ASSIGNED
| Reporter | ||
Updated•9 years ago
|
Assignee: jorick.caberio → nobody
Status: ASSIGNED → NEW
| Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(jorick.caberio)
| Reporter | ||
Updated•9 years ago
|
Whiteboard: [lang=java][good next bug]
Comment 3•9 years ago
|
||
Sebastian : Is all that needs to be done here is to remove those two inner classes, along with the version of prefValue() that uses said classes?
Flags: needinfo?(s.kaspari)
| Reporter | ||
Comment 4•9 years ago
|
||
Yeah. We can update prefValue() to use TwoStatePreference directly now. We don't need the backwards compatibility to handle CheckBoxPreference anymore.
Flags: needinfo?(s.kaspari)
Hi, I'm new to Bugzilla, I had in mind to contribute to Firefox for Android, so once my environment setup, I looked for a bug that would fit my abilities and figured that this one is the perfect match. So I would love any feedback on this patch.
Flags: needinfo?(s.kaspari)
Sorry for previous attachment, it's my first time contributing and I did not take the necessary time on how to propose a patch.
Attachment #8754079 -
Attachment is obsolete: true
Attachment #8754111 -
Flags: review?(s.kaspari)
| Reporter | ||
Updated•9 years ago
|
Assignee: nobody → gui.bgd
Status: NEW → ASSIGNED
Flags: needinfo?(s.kaspari)
| Reporter | ||
Comment 7•9 years ago
|
||
Comment on attachment 8754111 [details] [diff] [review]
updatePrefValue.patch
Review of attachment 8754111 [details] [diff] [review]:
-----------------------------------------------------------------
This is looking good and just needs some cleanup.
You can run |mach gradle checkstyle| to verify that the code matches some of our style rules.
::: mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
@@ +1447,4 @@
> @Override
> public void prefValue(String prefName, final boolean value) {
> final Preference pref = getField(prefName);
> + final TwoStatePreference prefSetter = (TwoStatePreference) pref;
nit: Let's rename prefSetter or just cast directly:
> final TwoStatePreference pref = (TwoStatePreference) getField(prefName);
@@ +1451,4 @@
> ThreadUtils.postToUiThread(new Runnable() {
> @Override
> public void run() {
> + if(prefSetter.isChecked() != value)
Please add spaces and braces:
> if_(..)_{
Attachment #8754111 -
Flags: review?(s.kaspari) → feedback+
Hi, I've made the adjustment required.
Attachment #8754111 -
Attachment is obsolete: true
Attachment #8755374 -
Flags: review?(s.kaspari)
| Reporter | ||
Comment 9•9 years ago
|
||
Comment on attachment 8755374 [details] [diff] [review]
prefValue.patch
Review of attachment 8755374 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM.
Attachment #8755374 -
Flags: review?(s.kaspari) → review+
Keywords: checkin-needed
Comment 10•9 years ago
|
||
Keywords: checkin-needed
Comment 11•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
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
•