emi-indo-cordova-plugin-admob 1.5.7 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/android/emiAdmobPlugin.kt +6 -6
package/package.json
CHANGED
package/plugin.xml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
2
2
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
3
|
-
id="emi-indo-cordova-plugin-admob" version="1.5.
|
3
|
+
id="emi-indo-cordova-plugin-admob" version="1.5.8">
|
4
4
|
|
5
5
|
<name>emiAdmobPlugin</name>
|
6
6
|
<description>Cordova Plugin Admob Android IOS</description>
|
@@ -1186,14 +1186,14 @@ class emiAdmobPlugin : CordovaPlugin() {
|
|
1186
1186
|
private fun loadBannerAd(adUnitId: String, position: String, size: String) {
|
1187
1187
|
try {
|
1188
1188
|
if (bannerViewLayout == null) {
|
1189
|
-
bannerViewLayout = FrameLayout(
|
1189
|
+
bannerViewLayout = FrameLayout(mActivity!!)
|
1190
1190
|
val params = FrameLayout.LayoutParams(
|
1191
1191
|
FrameLayout.LayoutParams.MATCH_PARENT,
|
1192
1192
|
FrameLayout.LayoutParams.MATCH_PARENT
|
1193
1193
|
)
|
1194
1194
|
val decorView = mActivity!!.window.decorView as ViewGroup
|
1195
1195
|
decorView.addView(bannerViewLayout, params)
|
1196
|
-
bannerView = AdView(
|
1196
|
+
bannerView = AdView(mActivity!!)
|
1197
1197
|
setBannerPosition(position)
|
1198
1198
|
setBannerSiz(size)
|
1199
1199
|
bannerView!!.adUnitId = adUnitId
|
@@ -1475,19 +1475,19 @@ class emiAdmobPlugin : CordovaPlugin() {
|
|
1475
1475
|
"responsive_adaptive" -> bannerView!!.setAdSize(adSize)
|
1476
1476
|
"anchored_adaptive" -> bannerView!!.setAdSize(
|
1477
1477
|
AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(
|
1478
|
-
|
1478
|
+
mActivity!!, adWidth
|
1479
1479
|
)
|
1480
1480
|
)
|
1481
1481
|
|
1482
1482
|
"full_width_adaptive" -> bannerView!!.setAdSize(
|
1483
1483
|
AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(
|
1484
|
-
|
1484
|
+
mActivity!!, adWidth
|
1485
1485
|
)
|
1486
1486
|
)
|
1487
1487
|
|
1488
1488
|
"in_line_adaptive" -> bannerView!!.setAdSize(
|
1489
1489
|
AdSize.getCurrentOrientationInlineAdaptiveBannerAdSize(
|
1490
|
-
|
1490
|
+
mActivity!!, adWidth
|
1491
1491
|
)
|
1492
1492
|
)
|
1493
1493
|
|
@@ -1522,7 +1522,7 @@ class emiAdmobPlugin : CordovaPlugin() {
|
|
1522
1522
|
val adWidthPixels =
|
1523
1523
|
if (bannerViewLayout != null && bannerViewLayout!!.width > 0) bannerViewLayout!!.width else outMetrics.widthPixels
|
1524
1524
|
val adWidth = (adWidthPixels / density).toInt()
|
1525
|
-
return AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(
|
1525
|
+
return AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(mActivity!!, adWidth)
|
1526
1526
|
}
|
1527
1527
|
|
1528
1528
|
|