@24jieqi/react-native-brayant-ad 0.1.11 → 0.1.12
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.
|
@@ -44,11 +44,13 @@ public class BannerAdView extends RelativeLayout {
|
|
|
44
44
|
inflate(context, R.layout.feed_view, this);
|
|
45
45
|
Utils.setupLayoutHack(this);
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
|
|
48
48
|
RelativeLayout.LayoutParams.MATCH_PARENT,
|
|
49
|
-
|
|
50
|
-
)
|
|
51
|
-
|
|
49
|
+
_expectedHeight
|
|
50
|
+
);
|
|
51
|
+
setLayoutParams(params);
|
|
52
|
+
|
|
53
|
+
Log.d(TAG, "[DEBUG] BannerAdView constructor completed - LayoutParams set (width=MATCH_PARENT, height=" + _expectedHeight + ")");
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
public void setWidth(int width) {
|
|
@@ -60,6 +62,14 @@ public class BannerAdView extends RelativeLayout {
|
|
|
60
62
|
public void setHeight(int height) {
|
|
61
63
|
Log.d(TAG, "[DEBUG] setHeight called - codeid=" + _codeid + ", height=" + height + ", current width=" + _expectedWidth);
|
|
62
64
|
_expectedHeight = height;
|
|
65
|
+
|
|
66
|
+
LayoutParams params = getLayoutParams();
|
|
67
|
+
if (params != null) {
|
|
68
|
+
params.height = height;
|
|
69
|
+
setLayoutParams(params);
|
|
70
|
+
Log.d(TAG, "[DEBUG] setHeight - LayoutParams updated to height=" + height);
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
showAd();
|
|
64
74
|
}
|
|
65
75
|
|
|
@@ -217,6 +227,21 @@ public class BannerAdView extends RelativeLayout {
|
|
|
217
227
|
mExpressContainer.addView(view, params);
|
|
218
228
|
|
|
219
229
|
Log.d(TAG, "[DEBUG] onRenderSuccess - adView added to feed_container");
|
|
230
|
+
|
|
231
|
+
RelativeLayout.LayoutParams containerParams = (RelativeLayout.LayoutParams) mExpressContainer.getLayoutParams();
|
|
232
|
+
if (containerParams != null) {
|
|
233
|
+
containerParams.height = (int) height;
|
|
234
|
+
mExpressContainer.setLayoutParams(containerParams);
|
|
235
|
+
Log.d(TAG, "[DEBUG] onRenderSuccess - feed_container LayoutParams updated to height=" + (int) height);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
RelativeLayout.LayoutParams viewParams = (RelativeLayout.LayoutParams) BannerAdView.this.getLayoutParams();
|
|
239
|
+
if (viewParams != null) {
|
|
240
|
+
viewParams.height = (int) height;
|
|
241
|
+
BannerAdView.this.setLayoutParams(viewParams);
|
|
242
|
+
Log.d(TAG, "[DEBUG] onRenderSuccess - BannerAdView LayoutParams updated to height=" + (int) height);
|
|
243
|
+
}
|
|
244
|
+
|
|
220
245
|
Log.d(TAG, "[DEBUG] onRenderSuccess - BannerAdView size: width=" + BannerAdView.this.getWidth() + ", height=" + BannerAdView.this.getHeight());
|
|
221
246
|
Log.d(TAG, "[DEBUG] onRenderSuccess - feed_container size: width=" + mExpressContainer.getWidth() + ", height=" + mExpressContainer.getHeight());
|
|
222
247
|
|