private void DisplayAd(VisxAdManager visxAdManager)
 {
     /// Adding Vis.X Banner/Video Ad to the created Android
     /// native View and invoced on the main Xamarin thread
     Android.Widget.RelativeLayout container = new Android.Widget.RelativeLayout(_context);
     MainThread.BeginInvokeOnMainThread(() =>
     {
         container = adContainer.FindViewById <Android.Widget.RelativeLayout>(Resource.Id.inlineContainer);
         container.AddView(visxAdManager.AdContainer);
     });
 }
        private void DisplayAd(VisxAdManager visxAdManager)
        {
            /// Adding Vis.X Universal Ad to the created Android
            /// native View and invoced on the main Xamarin thread
            Android.Widget.RelativeLayout container = new Android.Widget.RelativeLayout(_context);

            MainThread.BeginInvokeOnMainThread(() =>
            {
                container = _adContainer.FindViewById <Android.Widget.RelativeLayout>(Resource.Id.inlineContainer);

                if (visxAdManager.AdContainer.Parent != null)
                {
                    visxAdManager.AdContainer.RemoveFromParent();
                }

                container.AddView(visxAdManager.AdContainer);
            });
        }
Ejemplo n.º 3
0
        void InternalSetPage(Xamarin.Forms.Page page)
        {
            IList <Action <SKCanvas, int, int> > renderChildren = new List <Action <SKCanvas, int, int> >();

            _layout.AddView(new NativeSkiaView(this, new SkiaView((canvas, w, h) =>
            {
                canvas.Clear(SKColors.White);
                _canvas = canvas;
                _size   = new Xamarin.Forms.Size(w, h);
                foreach (var renderer in renderChildren)
                {
                    renderer(canvas, w, h);
                }
            })));

            _layout.BringToFront();

            AddRenderers(page, renderChildren);
        }
Ejemplo n.º 4
0
        void InternalSetPage(Page page)
        {
            if (!Forms.IsInitialized)
            {
                throw new InvalidOperationException("Call Forms.Init (Activity, Bundle) before this");
            }

            if (Platform != null)
            {
                Platform.SetPage(page);
                return;
            }

            PopupManager.ResetBusyCount(this);

            Platform = new AppCompat.Platform(this);
            Platform.SetPage(page);
            _layout.AddView(Platform);
            _layout.BringToFront();
        }