@loyalytics/swan-react-native-sdk 2.6.1-beta.0 → 2.6.1-beta.1
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.
- package/android/src/main/kotlin/com/loyalytics/swan/templates/carousel/CarouselTemplate.kt +16 -2
- package/lib/commonjs/version.js +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/src/version.d.ts +1 -1
- package/lib/typescript/module/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -321,9 +321,23 @@ class CarouselTemplate : SwanNotificationTemplate {
|
|
|
321
321
|
expanded = filmstrip.expanded
|
|
322
322
|
collapsed = filmstrip.collapsed
|
|
323
323
|
} else {
|
|
324
|
-
// Standard
|
|
324
|
+
// Standard loads ALL bitmaps into ViewFlipper at once.
|
|
325
|
+
// Android 13 (API 33) and below have a ~2MB RemoteViews limit.
|
|
326
|
+
// Scale down based on item count to stay within the limit:
|
|
327
|
+
// 3 items × 720px ARGB ≈ 3MB (exceeds limit on API ≤ 33)
|
|
328
|
+
// 3 items × 400px ARGB ≈ 960KB (safe)
|
|
329
|
+
val maxDim = if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.TIRAMISU) {
|
|
330
|
+
// Android 13 and below: scale down to fit within RemoteViews limit
|
|
331
|
+
when {
|
|
332
|
+
items.size <= 2 -> 500
|
|
333
|
+
items.size <= 4 -> 400
|
|
334
|
+
else -> 300 // 5+ items need aggressive scaling
|
|
335
|
+
}
|
|
336
|
+
} else {
|
|
337
|
+
720 // Android 14+ has relaxed RemoteViews limits
|
|
338
|
+
}
|
|
325
339
|
val scaledBitmaps = bitmaps.map { bitmap ->
|
|
326
|
-
bitmap?.let { scaleBitmap(it,
|
|
340
|
+
bitmap?.let { scaleBitmap(it, maxDim) }
|
|
327
341
|
}
|
|
328
342
|
val standard = CarouselRemoteViews.build(
|
|
329
343
|
context = context,
|
package/lib/commonjs/version.js
CHANGED
|
@@ -8,5 +8,5 @@ exports.SDK_VERSION = void 0;
|
|
|
8
8
|
// This file is generated from package.json version during build.
|
|
9
9
|
// See scripts/generate-version.js
|
|
10
10
|
|
|
11
|
-
const SDK_VERSION = exports.SDK_VERSION = '2.6.1-beta.
|
|
11
|
+
const SDK_VERSION = exports.SDK_VERSION = '2.6.1-beta.1';
|
|
12
12
|
//# sourceMappingURL=version.js.map
|
package/lib/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.6.1-beta.
|
|
1
|
+
export declare const SDK_VERSION = "2.6.1-beta.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.6.1-beta.
|
|
1
|
+
export declare const SDK_VERSION = "2.6.1-beta.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|