android-components icon indicating copy to clipboard operation
android-components copied to clipboard

Mark DesiredSize class as private/internal

Open pocmo opened this issue 7 years ago • 2 comments

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 avatar Jul 02 '19 10:07 pocmo

@pocmo After studying the code regarding this change/issue I think there are three possibilities:

  1. Close the issue given that the IconProcessor and IconDecoder interfaces expose the DesiredSize data 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.

  2. Reduce the extensibility of the library by only accepting new classes that implement the IconProcessor and IconDecoder interfaces thru PRs and making the DesiredSize class internal while removing the default parameters in the constructor of the BrowserIcons(...) class.

  3. Create a new Size interface that provides the data that the DesiredSize class normally would and update the IconProcessor and IconDecoder interfaces so they use ´Size´ instead. Keep the DesiredSize class and make it implement Size with a restricted visibility thru the internal modifier 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 avatar Jul 03 '19 23:07 nicolashleon

@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!

pocmo avatar Jul 04 '19 13:07 pocmo