Conver internal classes to "internal class"
Classes to be converted:
- FancyImageView
- Calculator
Hi I would like to working on this issue. Thank you
Thanks PRs welcome :)
Do I just need to add "internal" keyword to both class Calculator in Calculator.kt and class FancyImageView in FancyImageView.kt? Do I have to edit any other file? I would appreciate your hel and feedback.
After I add internal keyword to the FancyImageView, the FancyShowCaseViewTest shows compiler error. Since FancyImageView becomes internal in me.toptas.fancyshowcase, FancyShowCaseViewTest cannot access FancyImageView.DISABLE_ANIMATIONS_FOR_TESTING.
Can you try adding @VisibleForTesting annotation?
Thanks for the advise! After I google search on @VisibleForTesting, it seems like @VisibleForTesting does not actually change the visbility of a class/function. If a class/function is internal/private/public, its visibility is internal/private/public. Adding @VisibleForTesting will provide message when class/function is used in production code. Should I consider adding @VisibleForTesting(otherwise = VisbleForTesting.PACKAGE_PRIVATE) to both FancyImageView and Calculator?
I think the best way is moving the tests under library folder. Currently tests are running under app module.
Do you mean moving the tests from app modules to fancyshowcaseview module?
Yes. But it should be another task.
In summary, to convert internal class to "internal class", internal need to be added to FancyImageView and Calculator . After adding internal to FancyImageView and Calculator, FancyShowCaseViewTest need to be moved under fancyshowcaseview module. Moving FancyShowCaseViewTest under fancyshowcaseview module should be another task. Please correct me if I have any misunderstanding. Thank you.
After this investigation the scope is changed a bit.
FancyImageViewshould be internal andDISABLE_ANIMATIONS_FOR_TESTINGwill be moved underCalculator.