Closed Bug 1264599 Opened 9 years ago Closed 9 years ago

GeckoPreferences: Remove CheckBoxPrefSetter and TwoStatePrefSetter

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

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)

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
Please assign this bug to me. Thanks.
Assignee: nobody → jorick.caberio
Status: NEW → ASSIGNED
@Jorick: Any update here? :)
Flags: needinfo?(jorick.caberio)
Assignee: jorick.caberio → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(jorick.caberio)
Whiteboard: [lang=java][good next bug]
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)
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)
Attached patch updatePrefValue.patch (obsolete) — Splinter Review
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)
Assignee: nobody → gui.bgd
Status: NEW → ASSIGNED
Flags: needinfo?(s.kaspari)
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+
Attached patch prefValue.patchSplinter Review
Hi, I've made the adjustment required.
Attachment #8754111 - Attachment is obsolete: true
Attachment #8755374 - Flags: review?(s.kaspari)
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
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
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

Creator:
Created:
Updated:
Size: