@craft-native/android 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@craft-native/android",
3
- "version": "0.0.192",
3
+ "version": "0.0.193",
4
4
  "homepage": "https://github.com/craft-native/craft/tree/main/packages/android#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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
- scaleX = scale
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
- view.scaleX = 1f
5550
- view.scaleY = 1f
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