Exemplo n.º 1
0
        public void Init(ContentView loadingIndicatorView = null)
        {
            // check if the page parameter is available
            if (loadingIndicatorView != null)
            {
                // build the loading page with native base
                loadingIndicatorView.Parent = Xamarin.Forms.Application.Current.MainPage;

                loadingIndicatorView.Layout(new Rectangle(0, 0,
                                                          Xamarin.Forms.Application.Current.MainPage.Width,
                                                          Xamarin.Forms.Application.Current.MainPage.Height));

                var renderer = loadingIndicatorView.GetOrCreateRenderer();

                nativeView = renderer.View;

                dialog = new Dialog(CrossCurrentActivity.Current.Activity);
                dialog.RequestWindowFeature((int)WindowFeatures.NoTitle);
                dialog.SetCancelable(false);
                dialog.SetContentView(nativeView);
                Window window = dialog.Window;
                window.SetLayout(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                window.ClearFlags(WindowManagerFlags.DimBehind);
                window.SetBackgroundDrawable(new ColorDrawable(Android.Graphics.Color.Transparent));

                isInitialized = true;
            }
        }