Why are some classes not publicly available in the Android Support Library?

Why are some of the classes included in Android libraries not publicly available? For me this makes no sense and basically just creates a barrier to developing interim fixes for some of the recently released bug widgets.

In particular, I'm talking about TextInputLayoutin the Android Design Support Library . For example, if I want to create my own widget that overrides some code in the constructor, I cannot do this because it is CollapsingTextHelpernot a public class. I will need to download the source code and copy the appropriate classes into my project, but in fact there is nothing that would prevent me from doing this anyway. So, what's the point of not posting it first?

As I understand it, as the library is updated and improved over time, you can simply add an annotation @Deprecatedto indicate that a particular class is deprecated or deprecated and still exists to prevent breaking outdated code.
I know that it makes no sense for a library to simply publish all classes, but I don’t understand why the classes needed to implement the widget should not be publicly available. Why can't they just add annotation @Deprecatedwhen one of the classes is replaced with a better version or when widgets are implemented in a completely different way?

+4
source share
3 answers

, , / - () .

, @Deprecated , , .

+7

, . , . @Deprecated , .


, , . API .

, Google , - . .

, . , .

Android Studio IntelliJ , "Go to" -> "Declaration" :

  • Mac: + B
  • Windows: Ctrl + B

, , .


, 99% . Google, , , , , API .

+3

// java ( ) .

, ( , ..).

, , .

, , . , , , ?

+1

All Articles