craft-native 0.0.192 → 0.0.193
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.
|
@@ -2458,6 +2458,8 @@ private data class LayoutBounds(
|
|
|
2458
2458
|
*/
|
|
2459
2459
|
private class CraftNativeActivityIndicator(context: Context) :
|
|
2460
2460
|
android.widget.ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal) {
|
|
2461
|
+
var indicatorScale = 1f
|
|
2462
|
+
|
|
2461
2463
|
init {
|
|
2462
2464
|
val spinner = android.widget.ProgressBar(context).indeterminateDrawable
|
|
2463
2465
|
indeterminateDrawable = spinner
|
|
@@ -4903,8 +4905,7 @@ class MainActivity : AppCompatActivity() {
|
|
|
4903
4905
|
is Number -> (requestedSize.toDouble() / 24.0).takeIf { it.isFinite() }?.toFloat()?.coerceAtLeast(0.5f) ?: 1f
|
|
4904
4906
|
else -> 1f
|
|
4905
4907
|
}
|
|
4906
|
-
|
|
4907
|
-
scaleY = scale
|
|
4908
|
+
indicatorScale = scale
|
|
4908
4909
|
val animating = props.optBoolean("animating", true)
|
|
4909
4910
|
isIndeterminate = animating
|
|
4910
4911
|
visibility = if (!animating && props.optBoolean("hidesWhenStopped", true)) View.GONE else View.VISIBLE
|
|
@@ -5546,8 +5547,11 @@ class MainActivity : AppCompatActivity() {
|
|
|
5546
5547
|
private fun applyTransform(view: View, transforms: JSONArray?) {
|
|
5547
5548
|
view.translationX = 0f
|
|
5548
5549
|
view.translationY = 0f
|
|
5549
|
-
|
|
5550
|
-
|
|
5550
|
+
// Reconciliation reapplies transforms; start from the control's
|
|
5551
|
+
// intrinsic scale rather than erasing its authored indicator size.
|
|
5552
|
+
val intrinsicScale = (view as? CraftNativeActivityIndicator)?.indicatorScale ?: 1f
|
|
5553
|
+
view.scaleX = intrinsicScale
|
|
5554
|
+
view.scaleY = intrinsicScale
|
|
5551
5555
|
view.rotation = 0f
|
|
5552
5556
|
view.rotationX = 0f
|
|
5553
5557
|
view.rotationY = 0f
|
package/dist/cli.js
CHANGED
|
@@ -3424,7 +3424,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
|
|
|
3424
3424
|
`);
|
|
3425
3425
|
}
|
|
3426
3426
|
// package.json
|
|
3427
|
-
var version = "0.0.
|
|
3427
|
+
var version = "0.0.193";
|
|
3428
3428
|
|
|
3429
3429
|
// bin/cli.ts
|
|
3430
3430
|
var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -726,6 +726,11 @@ private func craftNativeAlignContentCode(_ value: String) -> UInt32 {
|
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
728
|
|
|
729
|
+
/// Keep the indicator's intrinsic size separate from authored style transforms.
|
|
730
|
+
private final class CraftNativeActivityIndicatorView: UIActivityIndicatorView {
|
|
731
|
+
var indicatorScale: CGFloat = 1
|
|
732
|
+
}
|
|
733
|
+
|
|
729
734
|
/// A native screen's `<Video>`: AVPlayerViewController in place.
|
|
730
735
|
///
|
|
731
736
|
/// With sound, a video takes the audio session as a playing sound does
|
|
@@ -5510,7 +5515,7 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
|
|
|
5510
5515
|
updateHandler(nonEmptyHandler(events["onValueChange"]) ?? nonEmptyHandler(events["onChange"]), for: slider)
|
|
5511
5516
|
updateAuxiliaryHandler(events["onSlidingComplete"], in: &sliderCompleteHandlers, for: slider)
|
|
5512
5517
|
case "ActivityIndicator":
|
|
5513
|
-
let indicator = result as!
|
|
5518
|
+
let indicator = result as! CraftNativeActivityIndicatorView
|
|
5514
5519
|
let requestedSize = props["size"]
|
|
5515
5520
|
indicator.style = (requestedSize as? String) == "large" ? .large : .medium
|
|
5516
5521
|
let scale: CGFloat
|
|
@@ -5522,7 +5527,7 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
|
|
|
5522
5527
|
} else {
|
|
5523
5528
|
scale = 1
|
|
5524
5529
|
}
|
|
5525
|
-
indicator.
|
|
5530
|
+
indicator.indicatorScale = scale
|
|
5526
5531
|
indicator.color = color(props["color"]) ?? .tintColor
|
|
5527
5532
|
indicator.hidesWhenStopped = props["hidesWhenStopped"] as? Bool ?? true
|
|
5528
5533
|
if props["animating"] as? Bool == false {
|
|
@@ -5728,7 +5733,7 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
|
|
|
5728
5733
|
slider.addTarget(self, action: #selector(sliderFinished(_:)), for: [.touchUpInside, .touchUpOutside, .touchCancel])
|
|
5729
5734
|
return slider
|
|
5730
5735
|
case "ActivityIndicator":
|
|
5731
|
-
return
|
|
5736
|
+
return CraftNativeActivityIndicatorView(style: .medium)
|
|
5732
5737
|
case "StatusBar", "RefreshControl":
|
|
5733
5738
|
return CraftNativeFlowView()
|
|
5734
5739
|
case "Image":
|
|
@@ -6437,8 +6442,9 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
|
|
|
6437
6442
|
}
|
|
6438
6443
|
|
|
6439
6444
|
private func applyTransform(_ raw: Any?, to view: UIView) {
|
|
6440
|
-
|
|
6445
|
+
let intrinsicScale = (view as? CraftNativeActivityIndicatorView)?.indicatorScale ?? 1
|
|
6441
6446
|
view.layer.transform = CATransform3DIdentity
|
|
6447
|
+
view.transform = CGAffineTransform(scaleX: intrinsicScale, y: intrinsicScale)
|
|
6442
6448
|
guard let transforms = raw as? [[String: Any]] else { return }
|
|
6443
6449
|
var affine = CGAffineTransform.identity
|
|
6444
6450
|
var threeDimensional = CATransform3DIdentity
|
|
@@ -6461,6 +6467,7 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
|
|
|
6461
6467
|
hasThreeDimensionalRotation = true
|
|
6462
6468
|
}
|
|
6463
6469
|
}
|
|
6470
|
+
affine = affine.scaledBy(x: intrinsicScale, y: intrinsicScale)
|
|
6464
6471
|
if hasThreeDimensionalRotation {
|
|
6465
6472
|
view.layer.transform = CATransform3DConcat(CATransform3DMakeAffineTransform(affine), threeDimensional)
|
|
6466
6473
|
} else {
|