Mark DesiredSize class as private/internal
It should only be used by browser-icons itself:
https://github.com/mozilla-mobile/android-components/blob/master/components/browser/icons/src/main/java/mozilla/components/browser/icons/DesiredSize.kt
┆Issue is synchronized with this Jira Task
@pocmo After studying the code regarding this change/issue I think there are three possibilities:
-
Close the issue given that the
IconProcessorandIconDecoderinterfaces expose theDesiredSizedata class to other classes outside the module (thru defaultBrowserIcons(...)) making it impossible to change its visibility. This way the module will remain extensible to other projects that are external to Mozilla, allowing other developers to customize the lib. -
Reduce the extensibility of the library by only accepting new classes that implement the
IconProcessorandIconDecoderinterfaces thru PRs and making theDesiredSizeclass internal while removing the default parameters in the constructor of theBrowserIcons(...)class. -
Create a new
Sizeinterface that provides the data that theDesiredSizeclass normally would and update theIconProcessorandIconDecoderinterfaces so they use ´Size´ instead. Keep theDesiredSizeclass and make it implementSizewith a restricted visibility thru theinternalmodifier and allow its use inside the module only. This would be the middle approach between the two previous ones.
Please provide some more information on the issue, how to proceed and what Mozilla expects regarding the library extensibility in relation to the change.
@nicolashleon Thank you for looking into this! When I filed this issue I only saw it being used inside BrowserIcons and did not see that it was also part of the public API of IconProcessor and IconDecoder. In this case the best option is to probably just keep it as-is for now. Thank you!