craft-native 0.0.205 → 0.0.207

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.
@@ -1,6 +1,7 @@
1
1
  package {{PACKAGE_NAME}}
2
2
 
3
3
  import android.content.Context
4
+ import org.json.JSONObject
4
5
  import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
5
6
 
6
7
  /** Swipe-to-refresh host for a native FlatList. */
@@ -21,6 +22,12 @@ internal class CraftNativeRefreshableFlatList(context: Context) : SwipeRefreshLa
21
22
  if (handler == null) isRefreshing = false
22
23
  }
23
24
 
25
+ fun setRefreshAppearance(props: JSONObject, fallback: Int) {
26
+ val tint = props.optString("tintColor").takeIf { it.isNotBlank() }
27
+ val resolved = tint?.let { runCatching { craftNativeColor(it) }.getOrNull() } ?: fallback
28
+ setColorSchemeColors(resolved)
29
+ }
30
+
24
31
  override fun onDetachedFromWindow() {
25
32
  refreshHandler = null
26
33
  isRefreshing = false