You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no multiple inheritance, but I would like to know if somehow it's possible to create a base class that extends from any of the Presented****Layouts.
The text was updated successfully, but these errors were encountered:
Yeah this is the problem with inheritance (and Android relies much on it), because it's not flexible at all.
The only easy fix I see is for your 2 views to have the same base layout, like a FrameLayout. And then each one adds its custom layout LinearLayout and ScrollView.
The drawback would be that Android will render a useless FrameLayout, but the cost is negligible.
I don't know what's in your BaseView class, but it may be possible to apply the composition pattern rather than inheritance. Also, if you are a Kotlin user, you would may be able to use Traits to solve this :)
There is no multiple inheritance, but I would like to know if somehow it's possible to create a base class that extends from any of the Presented****Layouts.
The text was updated successfully, but these errors were encountered: