@ququplay/admob 8.0.3 → 8.0.4
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.
|
@@ -26,8 +26,8 @@ import com.google.android.gms.ads.AdSize;
|
|
|
26
26
|
import com.google.android.gms.ads.AdView;
|
|
27
27
|
import com.google.android.gms.ads.LoadAdError;
|
|
28
28
|
import com.google.android.gms.common.util.BiConsumer;
|
|
29
|
-
import
|
|
30
|
-
import androidx.core.view.
|
|
29
|
+
import androidx.core.view.ViewCompat;
|
|
30
|
+
import androidx.core.view.WindowInsetsCompat;
|
|
31
31
|
|
|
32
32
|
public class BannerExecutor extends Executor {
|
|
33
33
|
|
|
@@ -105,25 +105,22 @@ public class BannerExecutor extends Executor {
|
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
//
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
mAdViewLayoutParams.setMargins(0, 0, 0, bottomInset);
|
|
121
|
-
}
|
|
108
|
+
// Apply window insets for edge-to-edge support
|
|
109
|
+
// Insets will be 0 if not in edge-to-edge mode, so this handles both cases
|
|
110
|
+
View decorView = activitySupplier.get().getWindow().getDecorView();
|
|
111
|
+
ViewCompat.setOnApplyWindowInsetsListener(decorView, (v, insets) -> {
|
|
112
|
+
int bottomInset = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
|
|
113
|
+
int topInset = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
|
|
114
|
+
|
|
115
|
+
if ("TOP_CENTER".equals(adOptions.position)) {
|
|
116
|
+
mAdViewLayoutParams.setMargins(0, topInset, 0, 0);
|
|
117
|
+
} else {
|
|
118
|
+
mAdViewLayoutParams.setMargins(0, 0, 0, bottomInset);
|
|
119
|
+
}
|
|
122
120
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
121
|
+
mAdViewLayout.setLayoutParams(mAdViewLayoutParams);
|
|
122
|
+
return insets;
|
|
123
|
+
});
|
|
127
124
|
|
|
128
125
|
mAdViewLayout.setLayoutParams(mAdViewLayoutParams);
|
|
129
126
|
|