@craft-native/android 0.0.191 → 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
|
@@ -286,7 +286,10 @@ internal class CraftNativeServices(
|
|
|
286
286
|
else -> Intent(Intent.ACTION_SEND).apply { type = "text/plain" }
|
|
287
287
|
}
|
|
288
288
|
if (text.isNotBlank()) intent.putExtra(Intent.EXTRA_TEXT, text)
|
|
289
|
-
options.optString("title").takeIf { it.isNotBlank() }?.let {
|
|
289
|
+
options.optString("title").takeIf { it.isNotBlank() }?.let {
|
|
290
|
+
intent.putExtra(Intent.EXTRA_SUBJECT, it)
|
|
291
|
+
intent.putExtra(Intent.EXTRA_TITLE, it)
|
|
292
|
+
}
|
|
290
293
|
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
291
294
|
host.startActivity(Intent.createChooser(intent, options.optString("title").ifBlank { null }))
|
|
292
295
|
// Android does not say whether something was shared; the sheet opened.
|
|
@@ -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
|
|
@@ -5111,7 +5112,7 @@ class MainActivity : AppCompatActivity() {
|
|
|
5111
5112
|
val pressOutHandler = craftNativeEventName(events, "onPressOut").takeIf { it.isNotBlank() }
|
|
5112
5113
|
if (pressInHandler != null) screen.pressInHandlers[control] = pressInHandler else screen.pressInHandlers.remove(control)
|
|
5113
5114
|
if (pressOutHandler != null) screen.pressOutHandlers[control] = pressOutHandler else screen.pressOutHandlers.remove(control)
|
|
5114
|
-
if (type != "Button" && type != "Link" && type != "TextInput" && type != "Picker" && type != "DatePicker" && type != "Modal" && type != "Switch" && type != "Slider" && type != "ActivityIndicator" && type != "KeyboardAvoidingView" && type != "StatusBar" && type != "RefreshControl" && type != "Map") {
|
|
5115
|
+
if (type != "Button" && type != "Link" && type != "Checkbox" && type != "TextInput" && type != "Picker" && type != "DatePicker" && type != "Modal" && type != "Switch" && type != "Slider" && type != "ActivityIndicator" && type != "KeyboardAvoidingView" && type != "StatusBar" && type != "RefreshControl" && type != "Map") {
|
|
5115
5116
|
val handler = craftNativeEventName(events, "onPress", "onClick")
|
|
5116
5117
|
val disabled = props.optBoolean("disabled", false)
|
|
5117
5118
|
val target = listOf(props.opt("href"), props.opt("to"))
|
|
@@ -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
|