-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[interactive_media_ads] Adds initial Android implementation #6733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
9f02730
get libraries to generate
bparrishMines 5f767fb
add a bunch of classes
bparrishMines b3317a0
some more videview stuff
bparrishMines 631c1e0
some display implementation for android
bparrishMines 35a4445
add the minimum required wrappings
bparrishMines 8ac0311
fix build error
bparrishMines bc4d770
implement other platform classes
bparrishMines 1f74ead
start creating an implementation
bparrishMines 4320f50
move interfaces to bottom and format
bparrishMines e85027d
fix callback events
bparrishMines 6739d7f
remove prints
bparrishMines e803962
fix removeStrongReference error
bparrishMines 0d59a8e
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines 6b22ebc
also send time updates
bparrishMines 957e2ba
combine implementation files
bparrishMines d0be873
fix lint warnings
bparrishMines 875d6be
fix Android dartPluginClass
bparrishMines 0122f6c
fix missing params call
bparrishMines d0971db
make tracking ad progress in ad display container
bparrishMines 6b8ee3a
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines b1ace40
add missing error codes
bparrishMines cc728d2
discard ad break
bparrishMines f345071
licenses
bparrishMines 90965aa
copyright header
bparrishMines 93c239b
first test file
bparrishMines c1b00f1
working tests
bparrishMines dce1723
more working tests
bparrishMines 76af339
more tests
bparrishMines c2d6f67
media player test
bparrishMines 9dde9d6
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines 15aa049
some more tests
bparrishMines 7c3dc18
finish platform unit tests
bparrishMines 48c7a42
switch tests to use TestProxyApiRegistrar
bparrishMines c5842ad
fix ad size
bparrishMines 8157448
version bump
bparrishMines 37fce6f
fix name
bparrishMines f00caf2
remove pigeon bro
bparrishMines 979ad8c
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines bdac900
start proxy
bparrishMines 9250e8d
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines 1dc6a07
change calls to proxy
bparrishMines 713bdbd
remove pigeon
bparrishMines 828ea3a
documentation
bparrishMines b4e8cda
fix key and some cleanup
bparrishMines c25d360
working addisplaycontainer test
bparrishMines 849ca63
erge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines b182af5
onerror and oncompletion test
bparrishMines e2fb27e
on prepared test
bparrishMines 48fb4de
pause ad and play ad tests
bparrishMines 0bbba9a
assert and tests
bparrishMines 1ce77c1
request ads and onAdsLoaded test
bparrishMines c7a320e
finish tests
bparrishMines a558a54
finish basic tests
bparrishMines 1c3a2c2
finish all tests
bparrishMines 428ecec
formatting
bparrishMines e8d822c
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines 5311d85
version bump and license
bparrishMines ba23b1d
lower kotlin version
bparrishMines 52a2c49
try fix lint
bparrishMines f32e74f
update generated kotlin
bparrishMines 75957f2
override pigeonRegistrar type
bparrishMines 6743d69
make platform classes base to be mockable
bparrishMines 3edc221
separate some logic
bparrishMines 3893efe
separate class implementations
bparrishMines 1c5fac7
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines a30c9fc
doc improvements
bparrishMines 8fa430b
lower meta version to 1.12.0
bparrishMines 220e2f0
move meta to 1.10.0
bparrishMines f55805f
only null ad duration on stop and error
bparrishMines 284098a
stop any ad tracking before starting a new one
bparrishMines 69e088c
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines 48828e3
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines 891f4d4
stop ad progress tracking on video completion
bparrishMines 9ada3ef
change generated kotlin library name
bparrishMines 84d1ff5
docs for kotlin classes
bparrishMines 1abcabc
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines b4b2152
variable docs
bparrishMines 519c68e
beef up docs and some formatting
bparrishMines f7d25c6
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines 8923d5f
uncomment pigeon file
bparrishMines 9145273
an
bparrishMines c3ce374
add an unknown value for enum
bparrishMines 5e11462
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines 24f0baa
Merge branch 'main' of github.com:flutter/packages into ima_android
bparrishMines dc6f38a
comment pigeon
bparrishMines 819441a
add flutter request agent
bparrishMines eda9cac
request agent test
bparrishMines 6a18fac
formatting and lint
bparrishMines 4829c85
only run example on Android
bparrishMines 463bfe4
small nits
bparrishMines File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.0.2 | ||
|
||
* Adds Android implementation. | ||
|
||
## 0.0.1+3 | ||
|
||
* Fixes the pub badge source. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
.../src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdDisplayContainerProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
/** | ||
* ProxyApi implementation for [com.google.ads.interactivemedia.v3.api.AdDisplayContainer]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdDisplayContainerProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdDisplayContainer(pigeonRegistrar) |
21 changes: 21 additions & 0 deletions
21
...ndroid/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdErrorEventProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.AdError | ||
import com.google.ads.interactivemedia.v3.api.AdErrorEvent | ||
|
||
/** | ||
* ProxyApi implementation for [AdErrorEvent]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdErrorEventProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdErrorEvent(pigeonRegistrar) { | ||
override fun error(pigeon_instance: AdErrorEvent): AdError { | ||
return pigeon_instance.error | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...oid/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdErrorListenerProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.AdErrorEvent | ||
|
||
/** | ||
* ProxyApi implementation for [AdErrorEvent.AdErrorListener]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdErrorListenerProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdErrorListener(pigeonRegistrar) { | ||
internal class AdErrorListenerImpl(val api: AdErrorListenerProxyApi) : | ||
AdErrorEvent.AdErrorListener { | ||
override fun onAdError(event: AdErrorEvent) { | ||
api.pigeonRegistrar.runOnMainThread { api.onAdError(this, event) {} } | ||
} | ||
} | ||
|
||
override fun pigeon_defaultConstructor(): AdErrorEvent.AdErrorListener { | ||
return AdErrorListenerImpl(this) | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
...ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdErrorProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.AdError | ||
|
||
/** | ||
* ProxyApi implementation for [AdError]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdErrorProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdError(pigeonRegistrar) { | ||
override fun errorCode(pigeon_instance: AdError): AdErrorCode { | ||
return when (pigeon_instance.errorCode) { | ||
AdError.AdErrorCode.ADS_PLAYER_NOT_PROVIDED -> AdErrorCode.ADS_PLAYER_WAS_NOT_PROVIDED | ||
AdError.AdErrorCode.INTERNAL_ERROR -> AdErrorCode.INTERNAL_ERROR | ||
AdError.AdErrorCode.VAST_MALFORMED_RESPONSE -> AdErrorCode.VAST_MALFORMED_RESPONSE | ||
AdError.AdErrorCode.UNKNOWN_AD_RESPONSE -> AdErrorCode.UNKNOWN_AD_RESPONSE | ||
AdError.AdErrorCode.VAST_TRAFFICKING_ERROR -> AdErrorCode.VAST_TRAFFICKING_ERROR | ||
AdError.AdErrorCode.VAST_LOAD_TIMEOUT -> AdErrorCode.VAST_LOAD_TIMEOUT | ||
AdError.AdErrorCode.VAST_TOO_MANY_REDIRECTS -> AdErrorCode.VAST_TOO_MANY_REDIRECTS | ||
AdError.AdErrorCode.VAST_NO_ADS_AFTER_WRAPPER -> AdErrorCode.VAST_NO_ADS_AFTER_WRAPPER | ||
AdError.AdErrorCode.VIDEO_PLAY_ERROR -> AdErrorCode.VIDEO_PLAY_ERROR | ||
AdError.AdErrorCode.VAST_MEDIA_LOAD_TIMEOUT -> AdErrorCode.VAST_MEDIA_LOAD_TIMEOUT | ||
AdError.AdErrorCode.VAST_LINEAR_ASSET_MISMATCH -> AdErrorCode.VAST_LINEAR_ASSET_MISMATCH | ||
AdError.AdErrorCode.OVERLAY_AD_PLAYING_FAILED -> AdErrorCode.OVERLAY_AD_PLAYING_FAILED | ||
AdError.AdErrorCode.OVERLAY_AD_LOADING_FAILED -> AdErrorCode.OVERLAY_AD_LOADING_FAILED | ||
AdError.AdErrorCode.VAST_NONLINEAR_ASSET_MISMATCH -> AdErrorCode.VAST_NONLINEAR_ASSET_MISMATCH | ||
AdError.AdErrorCode.COMPANION_AD_LOADING_FAILED -> AdErrorCode.COMPANION_AD_LOADING_FAILED | ||
AdError.AdErrorCode.UNKNOWN_ERROR -> AdErrorCode.UNKNOWN_ERROR | ||
AdError.AdErrorCode.VAST_EMPTY_RESPONSE -> AdErrorCode.VAST_EMPTY_RESPONSE | ||
AdError.AdErrorCode.FAILED_TO_REQUEST_ADS -> AdErrorCode.FAILED_TO_REQUEST_ADS | ||
AdError.AdErrorCode.VAST_ASSET_NOT_FOUND -> AdErrorCode.VAST_ASSET_NOT_FOUND | ||
AdError.AdErrorCode.ADS_REQUEST_NETWORK_ERROR -> AdErrorCode.ADS_REQUEST_NETWORK_ERROR | ||
AdError.AdErrorCode.INVALID_ARGUMENTS -> AdErrorCode.INVALID_ARGUMENTS | ||
AdError.AdErrorCode.PLAYLIST_NO_CONTENT_TRACKING -> AdErrorCode.PLAYLIST_NO_CONTENT_TRACKING | ||
AdError.AdErrorCode.UNEXPECTED_ADS_LOADED_EVENT -> AdErrorCode.UNEXPECTED_ADS_LOADED_EVENT | ||
else -> AdErrorCode.UNKNOWN | ||
} | ||
bparrishMines marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
override fun errorCodeNumber(pigeon_instance: AdError): Long { | ||
return pigeon_instance.errorCodeNumber.toLong() | ||
} | ||
|
||
override fun errorType(pigeon_instance: AdError): AdErrorType { | ||
return when (pigeon_instance.errorType) { | ||
AdError.AdErrorType.LOAD -> AdErrorType.LOAD | ||
AdError.AdErrorType.PLAY -> AdErrorType.PLAY | ||
else -> AdErrorType.UNKNOWN | ||
} | ||
} | ||
|
||
override fun message(pigeon_instance: AdError): String { | ||
return pigeon_instance.message | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...oid/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdEventListenerProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.AdEvent | ||
|
||
/** | ||
* ProxyApi implementation for [AdEvent.AdEventListener]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdEventListenerProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdEventListener(pigeonRegistrar) { | ||
internal class AdEventListenerImpl(val api: AdEventListenerProxyApi) : AdEvent.AdEventListener { | ||
override fun onAdEvent(event: AdEvent) { | ||
api.pigeonRegistrar.runOnMainThread { api.onAdEvent(this, event) {} } | ||
} | ||
} | ||
|
||
override fun pigeon_defaultConstructor(): AdEvent.AdEventListener { | ||
return AdEventListenerImpl(this) | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdEventProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.AdEvent | ||
|
||
/** | ||
* ProxyApi implementation for [AdEvent]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdEventProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdEvent(pigeonRegistrar) { | ||
override fun type(pigeon_instance: AdEvent): AdEventType { | ||
return when (pigeon_instance.type) { | ||
AdEvent.AdEventType.ALL_ADS_COMPLETED -> AdEventType.ALL_ADS_COMPLETED | ||
AdEvent.AdEventType.AD_BREAK_FETCH_ERROR -> AdEventType.AD_BREAK_FETCH_ERROR | ||
AdEvent.AdEventType.CLICKED -> AdEventType.CLICKED | ||
AdEvent.AdEventType.COMPLETED -> AdEventType.COMPLETED | ||
AdEvent.AdEventType.CUEPOINTS_CHANGED -> AdEventType.CUEPOINTS_CHANGED | ||
AdEvent.AdEventType.CONTENT_PAUSE_REQUESTED -> AdEventType.CONTENT_PAUSE_REQUESTED | ||
AdEvent.AdEventType.CONTENT_RESUME_REQUESTED -> AdEventType.CONTENT_RESUME_REQUESTED | ||
AdEvent.AdEventType.FIRST_QUARTILE -> AdEventType.FIRST_QUARTILE | ||
AdEvent.AdEventType.LOG -> AdEventType.LOG | ||
AdEvent.AdEventType.AD_BREAK_READY -> AdEventType.AD_BREAK_READY | ||
AdEvent.AdEventType.MIDPOINT -> AdEventType.MIDPOINT | ||
AdEvent.AdEventType.PAUSED -> AdEventType.PAUSED | ||
AdEvent.AdEventType.RESUMED -> AdEventType.RESUMED | ||
AdEvent.AdEventType.SKIPPABLE_STATE_CHANGED -> AdEventType.SKIPPABLE_STATE_CHANGED | ||
AdEvent.AdEventType.SKIPPED -> AdEventType.SKIPPED | ||
AdEvent.AdEventType.STARTED -> AdEventType.STARTED | ||
AdEvent.AdEventType.TAPPED -> AdEventType.TAPPED | ||
AdEvent.AdEventType.ICON_TAPPED -> AdEventType.ICON_TAPPED | ||
AdEvent.AdEventType.ICON_FALLBACK_IMAGE_CLOSED -> AdEventType.ICON_FALLBACK_IMAGE_CLOSED | ||
AdEvent.AdEventType.THIRD_QUARTILE -> AdEventType.THIRD_QUARTILE | ||
AdEvent.AdEventType.LOADED -> AdEventType.LOADED | ||
AdEvent.AdEventType.AD_PROGRESS -> AdEventType.AD_PROGRESS | ||
AdEvent.AdEventType.AD_BUFFERING -> AdEventType.AD_BUFFERING | ||
AdEvent.AdEventType.AD_BREAK_STARTED -> AdEventType.AD_BREAK_STARTED | ||
AdEvent.AdEventType.AD_BREAK_ENDED -> AdEventType.AD_BREAK_ENDED | ||
AdEvent.AdEventType.AD_PERIOD_STARTED -> AdEventType.AD_PERIOD_STARTED | ||
AdEvent.AdEventType.AD_PERIOD_ENDED -> AdEventType.AD_PERIOD_ENDED | ||
else -> AdEventType.UNKNOWN | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdMediaInfoProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.player.AdMediaInfo | ||
|
||
/** | ||
* ProxyApi implementation for [AdMediaInfo]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdMediaInfoProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdMediaInfo(pigeonRegistrar) { | ||
override fun url(pigeon_instance: AdMediaInfo): String { | ||
return pigeon_instance.url | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...s/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdPodInfoProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.AdPodInfo | ||
|
||
/** | ||
* ProxyApi implementation for [AdPodInfo]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdPodInfoProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdPodInfo(pigeonRegistrar) { | ||
override fun adPosition(pigeon_instance: AdPodInfo): Long { | ||
return pigeon_instance.adPosition.toLong() | ||
} | ||
|
||
override fun maxDuration(pigeon_instance: AdPodInfo): Double { | ||
return pigeon_instance.maxDuration | ||
} | ||
|
||
override fun podIndex(pigeon_instance: AdPodInfo): Long { | ||
return pigeon_instance.podIndex.toLong() | ||
} | ||
|
||
override fun timeOffset(pigeon_instance: AdPodInfo): Double { | ||
return pigeon_instance.timeOffset | ||
} | ||
|
||
override fun totalAds(pigeon_instance: AdPodInfo): Long { | ||
return pigeon_instance.totalAds.toLong() | ||
} | ||
|
||
override fun isBumper(pigeon_instance: AdPodInfo): Boolean { | ||
return pigeon_instance.isBumper | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...d/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsLoadedListenerProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.AdsLoader | ||
import com.google.ads.interactivemedia.v3.api.AdsManagerLoadedEvent | ||
|
||
/** | ||
* ProxyApi implementation for [AdsLoader.AdsLoadedListener]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdsLoadedListenerProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdsLoadedListener(pigeonRegistrar) { | ||
internal class AdsLoadedListenerImpl(val api: AdsLoadedListenerProxyApi) : | ||
AdsLoader.AdsLoadedListener { | ||
override fun onAdsManagerLoaded(event: AdsManagerLoadedEvent) { | ||
api.pigeonRegistrar.runOnMainThread { api.onAdsManagerLoaded(this, event) {} } | ||
} | ||
} | ||
|
||
override fun pigeon_defaultConstructor(): AdsLoader.AdsLoadedListener { | ||
return AdsLoadedListenerImpl(this) | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...s/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsLoaderProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.AdErrorEvent | ||
import com.google.ads.interactivemedia.v3.api.AdsLoader | ||
import com.google.ads.interactivemedia.v3.api.AdsRequest | ||
|
||
/** | ||
* ProxyApi implementation for [AdsLoader]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdsLoaderProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdsLoader(pigeonRegistrar) { | ||
override fun addAdErrorListener( | ||
pigeon_instance: AdsLoader, | ||
listener: AdErrorEvent.AdErrorListener | ||
) { | ||
pigeon_instance.addAdErrorListener(listener) | ||
} | ||
|
||
override fun addAdsLoadedListener( | ||
pigeon_instance: AdsLoader, | ||
listener: AdsLoader.AdsLoadedListener | ||
) { | ||
pigeon_instance.addAdsLoadedListener(listener) | ||
} | ||
|
||
override fun requestAds(pigeon_instance: AdsLoader, request: AdsRequest) { | ||
pigeon_instance.requestAds(request) | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...c/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsManagerLoadedEventProxyApi.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package dev.flutter.packages.interactive_media_ads | ||
|
||
import com.google.ads.interactivemedia.v3.api.AdsManager | ||
import com.google.ads.interactivemedia.v3.api.AdsManagerLoadedEvent | ||
|
||
/** | ||
* ProxyApi implementation for [AdsManagerLoadedEvent]. | ||
* | ||
* <p>This class may handle instantiating native object instances that are attached to a Dart | ||
* instance or handle method calls on the associated native class or an instance of that class. | ||
*/ | ||
class AdsManagerLoadedEventProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : | ||
PigeonApiAdsManagerLoadedEvent(pigeonRegistrar) { | ||
override fun manager(pigeon_instance: AdsManagerLoadedEvent): AdsManager { | ||
return pigeon_instance.adsManager | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same line added to
camera_android_camerax
: https://github.com/flutter/packages/blob/main/packages/camera/camera_android_camerax/android/build.gradle#L77This fixed the build failure when adding the
'com.google.ads.interactivemedia.v3:interactivemedia:3.33.0'
dependency.