The MvxAndroidViewPresenter and MvxFormsDroidPagePresenter are both used in MvvmCross for Android applications, but they serve different purposes and are designed to handle different types of views.
MvxAndroidViewPresenter
- Purpose: This presenter is part of the MvvmCross framework and is specifically designed to handle native Android views. It supports various navigation patterns such as Activities, Fragments, Nested Fragments, Dialog Fragments, and more complex layouts like NavigationDrawer and BottomNavigationBar[3][6].
- Functionality: It acts as a bridge between ViewModels and native Android views, allowing for customization of presentation attributes. Developers can extend this presenter to implement custom navigation strategies by overriding its methods or adding new presentation attributes[3][6].
- Usage: Typically used in pure MvvmCross Android applications where native views are preferred over Xamarin.Forms pages.
MvxFormsDroidPagePresenter
- Purpose: This presenter is used in MvvmCross applications that integrate Xamarin.Forms pages. It is designed to handle the presentation of Xamarin.Forms pages within an Android application[5][8].
- Functionality: It works by converting Xamarin.Forms pages into native Android views and managing their lifecycle. It is less flexible than MvxAndroidViewPresenter in terms of native Android navigation patterns but is essential for integrating Xamarin.Forms into MvvmCross Android projects[5][8].
- Usage: Used in hybrid applications where both native Android views and Xamarin.Forms pages coexist. It requires implementing custom logic to handle navigation between Xamarin.Forms pages and native views, as it does not directly support all native Android navigation features[5][8].
In summary, MvxAndroidViewPresenter is ideal for applications using native Android views, offering extensive customization and support for various Android-specific navigation patterns. In contrast, MvxFormsDroidPagePresenter is used when integrating Xamarin.Forms pages into an MvvmCross Android application, providing a way to display Forms pages as native views but with limited native navigation capabilities.
Citations:[1] https://michaelridland.com/category/xamarin/page/3/
[2] https://stackoverflow.com/questions/35912706/mvvmcross-hybrid-xamarin-forms-and-android-activity-application
[3] https://www.mvvmcross.com/documentation/platform/android/android-view-presenter
[4] https://ridland2.rssing.com/chan-57660607/all_p1.html
[5] https://michaelridland.com/xamarin/mixing-xamarin-forms-mvvmcross-nativeviews/
[6] https://www.mvvmcross.com/documentation/fundamentals/view-presenters
[7] https://jessejiang.wordpress.com
[8] https://stackoverflow.com/questions/38181508/login-page-with-xamarin-mvvmcross-forms-preventing-back-navigation-on-android