@ququplay/admob 8.0.2 → 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,6 +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 androidx.core.view.ViewCompat;
|
|
30
|
+
import androidx.core.view.WindowInsetsCompat;
|
|
29
31
|
|
|
30
32
|
public class BannerExecutor extends Executor {
|
|
31
33
|
|
|
@@ -103,23 +105,22 @@ public class BannerExecutor extends Executor {
|
|
|
103
105
|
break;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
//
|
|
107
|
-
if
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
+
}
|
|
118
120
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
121
|
+
mAdViewLayout.setLayoutParams(mAdViewLayoutParams);
|
|
122
|
+
return insets;
|
|
123
|
+
});
|
|
123
124
|
|
|
124
125
|
mAdViewLayout.setLayoutParams(mAdViewLayoutParams);
|
|
125
126
|
|
package/android/src/main/java/com/getcapacitor/community/admob/consent/AdConsentExecutor.java
CHANGED
|
@@ -218,8 +218,8 @@ public class AdConsentExecutor extends Executor {
|
|
|
218
218
|
.runOnUiThread(() ->
|
|
219
219
|
UserMessagingPlatform.loadConsentForm(
|
|
220
220
|
contextSupplier.get(),
|
|
221
|
-
consentForm ->
|
|
222
|
-
consentForm.show(activitySupplier.get(), formError -> {
|
|
221
|
+
(consentForm) ->
|
|
222
|
+
consentForm.show(activitySupplier.get(), (formError) -> {
|
|
223
223
|
if (formError != null) {
|
|
224
224
|
call.reject("Error when show consent form", formError.getMessage());
|
|
225
225
|
} else {
|
|
@@ -227,7 +227,10 @@ public class AdConsentExecutor extends Executor {
|
|
|
227
227
|
consentFormInfo.put("status", getConsentStatusString(consentInformation.getConsentStatus()));
|
|
228
228
|
consentFormInfo.put("isConsentFormAvailable", consentInformation.isConsentFormAvailable());
|
|
229
229
|
consentFormInfo.put("canRequestAds", consentInformation.canRequestAds());
|
|
230
|
-
consentFormInfo.put(
|
|
230
|
+
consentFormInfo.put(
|
|
231
|
+
"privacyOptionsRequirementStatus",
|
|
232
|
+
consentInformation.getPrivacyOptionsRequirementStatus().name()
|
|
233
|
+
);
|
|
231
234
|
consentFormInfo.put("canShowAds", canShowAds());
|
|
232
235
|
consentFormInfo.put("canShowPersonalizedAds", canShowPersonalizedAds());
|
|
233
236
|
consentFormInfo.put("isConsentOutdated", isConsentOutdated());
|
|
@@ -235,7 +238,7 @@ public class AdConsentExecutor extends Executor {
|
|
|
235
238
|
call.resolve(consentFormInfo);
|
|
236
239
|
}
|
|
237
240
|
}),
|
|
238
|
-
formError -> call.reject("Error when show consent form", formError.getMessage())
|
|
241
|
+
(formError) -> call.reject("Error when show consent form", formError.getMessage())
|
|
239
242
|
)
|
|
240
243
|
);
|
|
241
244
|
} catch (Exception ex) {
|
package/package.json
CHANGED