Ejemplo n.º 1
0
        protected override DrawerLayout CreateNativeView()
        {
            var li = MauiContext?.GetLayoutInflater();

            _ = li ?? throw new InvalidOperationException($"LayoutInflater cannot be null");

            var dl = li.Inflate(Resource.Layout.drawer_layout, null)
                     .JavaCast <DrawerLayout>()
                     ?? throw new InvalidOperationException($"Resource.Layout.drawer_layout missing");

            return(dl);
        }
Ejemplo n.º 2
0
        protected override View CreateNativeView()
        {
            LayoutInflater?li = MauiContext?.GetLayoutInflater();

            _ = li ?? throw new InvalidOperationException($"LayoutInflater cannot be null");

            var view = li.Inflate(Resource.Layout.fragment_backstack, null).JavaCast <FragmentContainerView>();

            _ = view ?? throw new InvalidOperationException($"Resource.Layout.navigationlayout view not found");

            return(view);
        }
Ejemplo n.º 3
0
        protected override View CreatePlatformView()
        {
            var li = MauiContext?.GetLayoutInflater();

            _ = li ?? throw new InvalidOperationException($"LayoutInflater cannot be null");

            var dl = li.Inflate(Resource.Layout.drawer_layout, null)
                     .JavaCast <DrawerLayout>()
                     ?? throw new InvalidOperationException($"Resource.Layout.drawer_layout missing");

            _navigationRoot = li.Inflate(Resource.Layout.navigationlayout, null)
                              ?? throw new InvalidOperationException($"Resource.Layout.navigationlayout missing");

            _navigationRoot.Id = View.GenerateViewId();
            return(dl);
        }
Ejemplo n.º 4
0
        protected override MaterialToolbar CreateNativeElement()
        {
            LayoutInflater?li = MauiContext?.GetLayoutInflater();

            _ = li ?? throw new InvalidOperationException($"LayoutInflater cannot be null");

            var view = li.Inflate(Microsoft.Maui.Resource.Layout.maui_toolbar, null)?.JavaCast <MaterialToolbar>();

            _ = view ?? throw new InvalidOperationException($"Resource.Layout.maui_toolbar view not found");

            view.LayoutParameters = new AppBarLayout.LayoutParams(LP.MatchParent, MauiContext?.Context?.GetActionBarHeight() ?? LP.WrapContent)
            {
                ScrollFlags = 0
            };

            return(view);
        }