@@ -19,46 +19,14 @@ export class NativeAdView extends NativeAdViewBase implements AddChildFromBuilde
1919 }
2020
2121 _addChildFromBuilder ( name : string , value : any ) : void {
22- if ( value instanceof View ) {
23- this . _child = value ;
24- }
22+ this . content = value ;
2523 }
2624
27- public eachChildView ( callback : ( child : View ) => boolean ) : void {
28- if ( this . _child ) {
29- callback ( this . _child ) ;
30- }
31- }
32-
33- public onMeasure ( widthMeasureSpec : number , heightMeasureSpec : number ) : void {
34- const result = View . measureChild ( this , this . _child , widthMeasureSpec , heightMeasureSpec ) ;
35-
36- const width = Utils . layout . getMeasureSpecSize ( widthMeasureSpec ) ;
37- const widthMode = Utils . layout . getMeasureSpecMode ( widthMeasureSpec ) ;
38-
39- const height = Utils . layout . getMeasureSpecSize ( heightMeasureSpec ) ;
40- const heightMode = Utils . layout . getMeasureSpecMode ( heightMeasureSpec ) ;
41-
42- const measureWidth = Math . max ( result . measuredWidth , this . effectiveMinWidth ) ;
43- const measureHeight = Math . max ( result . measuredHeight , this . effectiveMinHeight ) ;
44-
45- const widthAndState = View . resolveSizeAndState ( measureWidth , width , widthMode , 0 ) ;
46- const heightAndState = View . resolveSizeAndState ( measureHeight , height , heightMode , 0 ) ;
47-
48- this . setMeasuredDimension ( widthAndState , heightAndState ) ;
49- }
50-
51- public onLayout ( left : number , top : number , right : number , bottom : number ) : void {
52- View . layoutChild ( this , this . _child , 0 , 0 , right - left , bottom - top ) ;
53- }
54-
55- onLoaded ( ) {
56- super . onLoaded ( ) ;
57- if ( this . _child ) {
58- this . _addView ( this . _child ) ;
59- this . _native . addSubview ( this . _child . nativeView ) ;
60- }
61- }
25+ // public eachChildView(callback: (child: View) => boolean): void {
26+ // if (this._child) {
27+ // callback(this._child);
28+ // }
29+ // }
6230
6331 _adChoicesView : View ;
6432 get adChoicesView ( ) : View {
@@ -376,6 +344,9 @@ export class NativeAd implements INativeAd {
376344 return MediaContent . fromNative ( this . native ?. mediaContent ) ;
377345 }
378346
347+ get customMuteThisAdAvailable ( ) {
348+ return this . native . customMuteThisAdAvailable ;
349+ }
379350 isCustomClickGestureEnabled ( ) : boolean {
380351 return this . native ?. customClickGestureEnabled ;
381352 }
@@ -433,6 +404,12 @@ export class NativeAd implements INativeAd {
433404 return result ;
434405 }
435406
407+ muteThisAdWithReason ( reason : MuteThisAdReason ) {
408+ if ( reason ?. native ) {
409+ this . native ?. muteThisAdWithReason ?.( reason . native ) ;
410+ }
411+ }
412+
436413 get images ( ) {
437414 const result = [ ] ;
438415 const images = this . native ?. images ;
0 commit comments