Exemplo n.º 1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         View = null;
     }
     base.Dispose(disposing);
 }
Exemplo n.º 2
0
        public IOSNativeAdView(NativeAdView view)
        {
            View = view;

            Agent = view.Agent ?? throw new Exception(".NativeAdView.Agent is null");

            var attributes = new ads.NativeAdViewAttributes {
                BackgroundColor = UIColor.Clear
            };

            var nativeAdView = Agent.Render(attributes);

            nativeAdView.Frame = View.GetFrame();

            Add(nativeAdView);

            view.RotateRequested.Handle(LoadNext);
            LoadNext().RunInParallel();
        }
Exemplo n.º 3
0
        public AndroidNativeAdView(NativeAdView view) : base(Renderer.Context)
        {
            View = view;

            Agent = view.Agent ?? throw new Exception(".NativeAdView.Agent is null");

            var attributes = new ads.NativeAdViewAttributes(Renderer.Context)
                .SetBackgroundColor(Android.Graphics.Color.Transparent);

            var nativeAdView = Agent.Render(attributes);
            nativeAdView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            Container = new AndroidNativeAdViewContainer();
            Container.AddView(nativeAdView);

            AddView(Container);

            view.RotateRequested.Handle(LoadNext);
            LoadNext().RunInParallel();
        }