Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #8565: Fix updating dropdown preferences in ETP settings! #8573

Merged
merged 5 commits into from
Feb 25, 2020

Conversation

mcarare
Copy link
Contributor

@mcarare mcarare commented Feb 20, 2020

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@boek boek requested a review from ekager February 21, 2020 17:02
@@ -0,0 +1,20 @@
package org.mozilla.fenix.settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - license


fun DropDownListPreference.findEntriesValue(newValue: Any?): CharSequence? {
val newValueString = newValue as? String ?: return null
val index = this.findIndexOfValue(newValueString)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why when we get the EntriesValue do we have to find the index of value of this valueString and then return the entry based on the index? What is the newValueString then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have two arrays that store entries and entries values. Previously we received social for example, but we needed Cross-site and social media trackers, otherwise the preference would not have updated.

@codecov-io
Copy link

codecov-io commented Feb 24, 2020

Codecov Report

Merging #8573 into master will increase coverage by 0.04%.
The diff coverage is 21.42%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #8573      +/-   ##
============================================
+ Coverage     18.62%   18.66%   +0.04%     
  Complexity      464      464              
============================================
  Files           319      320       +1     
  Lines         12737    12747      +10     
  Branches       1682     1683       +1     
============================================
+ Hits           2372     2379       +7     
- Misses        10163    10165       +2     
- Partials        202      203       +1
Impacted Files Coverage Δ Complexity Δ
...zilla/fenix/settings/TrackingProtectionFragment.kt 0% <0%> (ø) 0 <0> (ø) ⬇️
...la/fenix/settings/StringSharedPreferenceUpdater.kt 0% <0%> (ø) 0 <0> (?)
...g/mozilla/fenix/settings/DropDownListPreference.kt 42.85% <100%> (+42.85%) 0 <0> (ø) ⬇️
...nix/components/toolbar/BrowserToolbarController.kt 60.22% <0%> (+2.27%) 0% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdd3d29...6bf02b9. Read the comment docs.

Copy link
Contributor

@sblatz sblatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good 😄

@severinrudie severinrudie changed the title For #8565: Fix updating dropdown preferences in ETP settings For #8565: Fix updating dropdown preferences in ETP settings! Feb 25, 2020
@severinrudie severinrudie merged commit 4be6932 into mozilla-mobile:master Feb 25, 2020
@mcarare mcarare deleted the 8565 branch June 3, 2020 10:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants