Skip to content

Commit

Permalink
npm release v1.9.9
Browse files Browse the repository at this point in the history
  • Loading branch information
EMI-INDO committed Dec 29, 2024
1 parent 5c24a52 commit 6e3c1e6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
1 change: 0 additions & 1 deletion example/www/js/bannerAd.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ function loadBanner() {

cordova.plugins.emiAdmobPlugin.styleBannerAd({
isOverlapping: true,
isStatusBarHide: false,
overlappingHeight: 0, // default 0 (Automatic)
padding: 0, // default 0
margins: 0 // default 0 (Automatic)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "emi-indo-cordova-plugin-admob",
"version": "1.8.9",
"version": "1.9.9",
"description": "Cordova/Quasar/Capacitor Plugin Admob Android IOS",
"cordova": {
"id": "emi-indo-cordova-plugin-admob",
Expand Down
3 changes: 1 addition & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="emi-indo-cordova-plugin-admob" version="1.8.9">
id="emi-indo-cordova-plugin-admob" version="1.9.9">

<name>emiAdmobPlugin</name>
<description>Cordova/Quasar/Capacitor Plugin Admob Android IOS</description>
Expand Down Expand Up @@ -41,7 +41,6 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</config-file>


<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity
android:launchMode="singleTask"
Expand Down
15 changes: 3 additions & 12 deletions src/android/emiAdmobPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ class emiAdmobPlugin : CordovaPlugin() {

private var isOverlapping: Boolean = false
private var overlappingHeight: Int = 0
private var statusBarHide: Boolean = false

var adType="";
var adType = ""

var isBannerLoad: Boolean = false
var isBannerShow: Boolean = false
Expand Down Expand Up @@ -1223,7 +1222,6 @@ class emiAdmobPlugin : CordovaPlugin() {
val navBarHeight = maxOf(0, screenHeight - usableHeight)

val isOverlapping = options.optBoolean("isOverlapping", false)
val statusBarHide = options.optBoolean("isStatusBarHide")
val overlappingHeight = options.optInt("overlappingHeight", navBarHeight)
val paddingPx = options.optInt("padding", 0)
val marginsPx = options.optInt("margins", navBarHeight)
Expand All @@ -1232,7 +1230,6 @@ class emiAdmobPlugin : CordovaPlugin() {
try {
// Make sure to only set variables if they have the correct values
this.isOverlapping = isOverlapping
this.statusBarHide = statusBarHide
this.overlappingHeight = if (overlappingHeight > 0) overlappingHeight else navBarHeight
this.paddingInPx = paddingPx
this.marginsInPx = if (marginsPx > 0) marginsPx else navBarHeight
Expand Down Expand Up @@ -1370,7 +1367,7 @@ class emiAdmobPlugin : CordovaPlugin() {


private fun loadBannerAd(adUnitId: String, position: String, size: String) {
adType=size;
adType = size;
try {
if (bannerViewLayout == null) {
bannerViewLayout = FrameLayout(mActivity!!)
Expand Down Expand Up @@ -1695,17 +1692,11 @@ class emiAdmobPlugin : CordovaPlugin() {
val displayMetrics = DisplayMetrics()
mActivity!!.windowManager.defaultDisplay.getMetrics(displayMetrics)
val screenHeightInPx = displayMetrics.heightPixels
if (statusBarHide){
val webViewHeight = screenHeightInPx - (adSize.height)
val layoutParams = cWebView!!.view.layoutParams
layoutParams.height = webViewHeight
cWebView!!.view.layoutParams = layoutParams
} else {

val webViewHeight = screenHeightInPx - (adSize.height + overlappingHeight)
val layoutParams = cWebView!!.view.layoutParams
layoutParams.height = webViewHeight
cWebView!!.view.layoutParams = layoutParams
}

// Log.d("BannerAdjustment", "Adjusted WebView height: $webViewHeight")
} catch (e: Exception) {
Expand Down

0 comments on commit 6e3c1e6

Please sign in to comment.