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
Couple of things I have noted out that are still missing from MvvmCross (Of course you could get it to work with some overrides or hacks etc)
Nested Fragment + Activity Fragment. Using a fragment as nested fragment as well as an activity fragment is really hard (isn't supported out of the box). You can only specify 1 attribute above each fragment meaning you can only choose to make it a nested attribute or a activity host fragment. The presenter currently checks if its a nested fragment and otherwise just expects its an activity fragment. But fragments should be mobile and can be a nested fragment in one instance or an activity fragment in a different instance.
Solution:
We should think of a better way to use MvxFragmentPresentationAttribute where I can add multiple activity hosts and multiple fragment hosts. (just by adding multiple attributes really). And the way to recognize which to use is based off of who calls the navigate.
Child nesting on multiple levels isn't supported. (when I have time I will work on this further, currently busy with work)
Navigating to a fragment should be possible without it having a host activity. This will give more consistency with iOS as iOS you can use a nested view anywhere. Right now the navigation of the Android vs iOS differs.
Navigation from JarViewModel to CookieViewModel will be as follows:
iOS: _navigationService.Navigate<CookieViewModel>(); //all fine works as expected
Android: _navigationService.Navigate<CookieViewModel>() // we can't do this as we cannot navigate to a fragment without specifying an activity host for it to live in. we are using the same fragment else where as a nested one, so we cannot convert it to an activity.
So for android we would need to create a dummy host : SingleFragmentView (type: MvxFragmentActivity) and then do something like:
Now we need to also relay the bundle parameters as well as we want to send something over to the CookieViewModel.
Solution:
The solution is simple let's just make a simple Host Activity which hosts the fragment and relays whatever we add as parameters or presentation attributes. This way we have consistency with iOS and navigation would be seamlessly. If the user does specify a host activity we just dont create the Host Activity internally. _navigationService.Navigate<CookieViewModel>()
Let me know what you guys think. Maybe I missed something in MvvmCross and some of my comments are invalid, please let me know.
The text was updated successfully, but these errors were encountered:
Couple of things I have noted out that are still missing from MvvmCross (Of course you could get it to work with some overrides or hacks etc)
Solution:
We should think of a better way to use MvxFragmentPresentationAttribute where I can add multiple activity hosts and multiple fragment hosts. (just by adding multiple attributes really). And the way to recognize which to use is based off of who calls the navigate.
Child nesting on multiple levels isn't supported. (when I have time I will work on this further, currently busy with work)
Navigating to a fragment should be possible without it having a host activity. This will give more consistency with iOS as iOS you can use a nested view anywhere. Right now the navigation of the Android vs iOS differs.
Example:
CookieView(Fragment - Android, ViewController - iOS) - CookieViewModel
Navigation from JarViewModel to CookieViewModel will be as follows:
So for android we would need to create a dummy host : SingleFragmentView (type: MvxFragmentActivity) and then do something like:
Now we need to also relay the bundle parameters as well as we want to send something over to the CookieViewModel.
Solution:
The solution is simple let's just make a simple Host Activity which hosts the fragment and relays whatever we add as parameters or presentation attributes. This way we have consistency with iOS and navigation would be seamlessly. If the user does specify a host activity we just dont create the Host Activity internally.
_navigationService.Navigate<CookieViewModel>()
Let me know what you guys think. Maybe I missed something in MvvmCross and some of my comments are invalid, please let me know.
The text was updated successfully, but these errors were encountered: