예제 #1
0
            public override AView OnCreateView(ALayoutInflater inflater, AViewGroup container, Bundle savedInstanceState)
            {
                ScopedMauiContext = _mauiContext.MakeScoped(layoutInflater: inflater, fragmentManager: ChildFragmentManager, registerNewNavigationRoot: true);
                var handler = (WindowHandlerStub)_window.ToHandler(ScopedMauiContext);

                var decorView = RequireActivity().Window.DecorView;

                handler.PlatformViewUnderTest.LayoutParameters = new FitWindowsFrameLayout.LayoutParams(AViewGroup.LayoutParams.MatchParent, AViewGroup.LayoutParams.MatchParent);

                FakeActivityRootView = new FakeActivityRootView(ScopedMauiContext.Context);
                FakeActivityRootView.LayoutParameters = new LinearLayoutCompat.LayoutParams(AViewGroup.LayoutParams.MatchParent, AViewGroup.LayoutParams.MatchParent);
                FakeActivityRootView.AddView(handler.PlatformViewUnderTest);

                return(FakeActivityRootView);
            }
예제 #2
0
            public override AView OnCreateView(ALayoutInflater inflater, AViewGroup container, Bundle savedInstanceState)
            {
                ScopedMauiContext = _mauiContext.MakeScoped(layoutInflater: inflater, fragmentManager: ChildFragmentManager, registerNewNavigationRoot: true);
                _ = _window.ToHandler(ScopedMauiContext);

                var rootView  = ScopedMauiContext.GetNavigationRootManager().RootView;
                var decorView = RequireActivity().Window.DecorView;

                rootView.LayoutParameters = new LinearLayoutCompat.LayoutParams(decorView.MeasuredWidth, decorView.MeasuredHeight);

                FakeActivityRootView = new FakeActivityRootView(ScopedMauiContext.Context);
                FakeActivityRootView.LayoutParameters = new LinearLayoutCompat.LayoutParams(decorView.MeasuredWidth, decorView.MeasuredHeight);
                FakeActivityRootView.AddView(rootView);

                return(FakeActivityRootView);
            }