Skip to content

Commit

Permalink
Fixes for Android layout
Browse files Browse the repository at this point in the history
  • Loading branch information
AGulev committed Jun 30, 2019
1 parent c5eb37c commit 986437a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions defunityads/src/android/com/agulev/defunityads/DefUnityAds.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void run() {
}

public void showBanner() {
if (bannerView == null) {
if (isShown || bannerView == null) {
return;
}

Expand Down Expand Up @@ -187,14 +187,12 @@ public void onUnityBannerLoaded(String placementId, View view) {

layout.addView(bannerView, params);

windowParams = new WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_APPLICATION_PANEL,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
PixelFormat.TRANSLUCENT);
windowParams = new WindowManager.LayoutParams();
windowParams.x = WindowManager.LayoutParams.WRAP_CONTENT;
windowParams.y = WindowManager.LayoutParams.WRAP_CONTENT;
windowParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
windowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
windowParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;

DefUnityAds.onUnityBannerLoaded(placementId);
}
Expand All @@ -204,6 +202,7 @@ public void onUnityBannerUnloaded(String placementId) {
layout = null;
bannerView = null;
windowParams = null;
isShown = false;
DefUnityAds.onUnityBannerUnloaded(placementId);
}

Expand Down

0 comments on commit 986437a

Please sign in to comment.