What is the benefit of making RecyclerView.OnScrollListener
an abstract class? Now you actually have to create a separate class instead of simply implementing the listener's method in the Fragment
/Activity
...
This question was asked before here but the answer just quotes Google which doesn't seem to really answer what benefits there actually are. Google stated:
Abstract classes allow frameworks to add new methods without breaking existing implementations.
But is that necessarily true? Adding more methods to an abstract class would also break existing implementations because if not implemented then the class extending it would have to be abstract as well... so it's the same problem as with adding methods to interfaces.
The diff for when they changed it here also says
I also changed it to be an abstract class instead of an interface to make future changes easier.
but again I don't see how that makes any sense. Does anyone understand the benefit of this change offered in this context? And if it really was better, why are all of the other listeners implemented as interfaces rather than abstract classes?
edit: note there aren't any concrete implementations in the class either, so I see no inherent benefit of using abstract class here vs an interface