Open ChasakisD opened 4 years ago
@ChasakisD does this PR address what you need?
@PureWeen I am not saying about the creation of the ShellSectionRootRenderer, but for changing the inheritance of ShellSectionRenderer from UINavigationController to lets say Material's AppBarNavigationController. Right now, if you want to change to another navigation controller, you have to copy and paste the ShellSectionRenderer and just replace the UINavigationController with AppBarNavigationController.
@ChasakisD aw ok I see what you're getting at
Yea, this will definitely become relevant as we ramp up Material Shell
This should be done just like the other Renderers where on CreateNativeControl() you specify the the class of the control.
The tricky part here is that on iOS all the normal renderers are wrapped by a parented UIView whereas ShellSectionRenderer inherits directly from UINavigationController so we'd need to move all the behavior out of the class into something that's reusable.
We do this on Android for all the renderers that inherit directly from components opposed to being wrapped by ViewGroups
I wish this was legal :-)
ShellSectionRendererBase
@PureWeen Didn't know about any plans for MaterialShell. Sorry for that. I am starting playing with MaterialComponents on iOS and they are pretty awesome. That's why I opened this issue.
Yeah that pattern that was applied on Android Renderers is going to make it very easy to integrate with other NavigationControllers, and as far the ShellNavBarAppearanceTracker is also open, it will be very easy to customize the MaterialComponents' AppBar!
@ChasakisD
Didn't about any plans for MaterialShell. Sorry for that. I am starting playing with MaterialComponents on iOS and they are pretty awesome. That's why I opened this issue.
We haven't started work on it but it's on the road map. I'm going to elevate this issue here on my queue of things though see if I can get this exposed how you want
If you're working on integrating Material things into Shell I'd really like to make that as easy as I can for you!!
@ChasakisD have you done an implementation with Shell and MDCAppBarNavigationController ?
Summary
There are a lot of cases where you want to use a custom NavigationViewController just like MaterialComponents one (MDCAppBarNavigationController) or AMScrollingNavbar's ScrollingViewController. Write now, to solve the problem, you have to copy the ShellSectionRenderer class with some other internal extension methods and just change 1 line of code, the base class. This should be done just like the other Renderers where on CreateNativeControl() you specify the the class of the control.
API Changes
Maybe a wrapper class or a factory in order to be able to create another implementations of UINavigationController.
Intended Use Case
There are a lot of goodies in MDCAppBarNavigationController, like the scrolling behavior that are missing from UINavigationController. By opening up the creation of UINavigationController, developers will be able to easily integrate a custom UINavigationController to their apps.