@onekeyfe/react-native-native-list 3.0.179-alpha.304 → 3.0.179

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.
Files changed (111) hide show
  1. package/README.md +3 -32
  2. package/android/build.gradle +1 -0
  3. package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +1 -22
  4. package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +8 -8
  5. package/android/src/main/java/com/onekey/nativelist/NativeListActionRenderer.kt +5 -5
  6. package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +4 -4
  7. package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +6 -6
  8. package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +1 -6
  9. package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +11 -11
  10. package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +20 -20
  11. package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +4 -5
  12. package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +7 -7
  13. package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +5 -5
  14. package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +7 -8
  15. package/android/src/main/java/com/onekey/nativelist/NativeListMetricCardRenderer.kt +14 -14
  16. package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +15 -28
  17. package/android/src/main/java/com/onekey/nativelist/NativeListRailRenderer.kt +4 -4
  18. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +3 -3
  19. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +2 -3
  20. package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +4 -5
  21. package/android/src/main/java/com/onekey/nativelist/NativeListRowHost.kt +1 -1
  22. package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +20 -20
  23. package/android/src/main/java/com/onekey/nativelist/NativeListSystemRenderer.kt +3 -3
  24. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +18 -104
  25. package/android/src/main/java/com/onekey/nativelist/NativeListWalletGroupRenderer.kt +5 -6
  26. package/common/fonts/Roobert-Bold.ttf +0 -0
  27. package/common/fonts/Roobert-Medium.ttf +0 -0
  28. package/common/fonts/Roobert-Regular.ttf +0 -0
  29. package/common/fonts/Roobert-SemiBold.ttf +0 -0
  30. package/docs/SPEC.md +0 -69
  31. package/docs/STYLE_SPEC.md +2 -12
  32. package/ios/HybridNativeList.swift +6 -18
  33. package/ios/NativeListAccessoryStack.swift +10 -14
  34. package/ios/NativeListActionRenderer.swift +4 -7
  35. package/ios/NativeListActivityDetailsView.swift +24 -63
  36. package/ios/NativeListActivityRenderer.swift +10 -19
  37. package/ios/NativeListDataRowRenderer.swift +19 -23
  38. package/ios/NativeListDesignAssets.swift +34 -43
  39. package/ios/NativeListIdentityRenderer.swift +19 -23
  40. package/ios/NativeListLeadingVisual.swift +4 -9
  41. package/ios/NativeListMarketRenderer.swift +11 -19
  42. package/ios/NativeListMediaTileRenderer.swift +7 -11
  43. package/ios/NativeListMessageRenderer.swift +10 -20
  44. package/ios/NativeListMetricCardRenderer.swift +12 -16
  45. package/ios/NativeListRailRenderer.swift +7 -9
  46. package/ios/NativeListRendererCell.swift +4 -6
  47. package/ios/NativeListRendererRegistry.swift +3 -8
  48. package/ios/NativeListResolvedText.swift +3 -3
  49. package/ios/NativeListRowHost.swift +2 -7
  50. package/ios/NativeListSectionHeaderRenderer.swift +19 -22
  51. package/ios/NativeListSystemRenderer.swift +16 -18
  52. package/ios/NativeListTextStyles.swift +12 -18
  53. package/ios/NativeListWalletGroupRenderer.swift +4 -6
  54. package/ios/RNCNativeListView.swift +5 -38
  55. package/ios/tests/NativeListActivityPresentationTests.swift +3 -5
  56. package/ios/tests/NativeListLifecycleTests.swift +2 -77
  57. package/lib/module/NativeList.js +0 -3
  58. package/lib/module/NativeList.web.js +1 -8
  59. package/lib/module/index.js +0 -1
  60. package/lib/module/web/NativeListWebEngine.js +24 -48
  61. package/lib/module/web/templates/ActionRowRenderer.js +1 -2
  62. package/lib/module/web/templates/IdentityRowRenderer.js +3 -4
  63. package/lib/module/web/templates/MarketRowRenderer.js +1 -2
  64. package/lib/module/web/templates/RowText.js +3 -13
  65. package/lib/module/web/templates/SectionHeaderRowRenderer.js +2 -3
  66. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +0 -9
  67. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +0 -2
  68. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +0 -5
  69. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +0 -6
  70. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +0 -7
  71. package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +0 -6
  72. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +0 -1
  73. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +0 -11
  74. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +0 -2
  75. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +0 -2
  76. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +0 -2
  77. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +0 -3
  78. package/lib/nitrogen/generated/shared/json/NativeListConfig.json +0 -1
  79. package/lib/typescript/src/NativeList.nitro.d.ts +0 -1
  80. package/lib/typescript/src/index.d.ts +0 -2
  81. package/lib/typescript/src/web/NativeListWebEngine.d.ts +1 -4
  82. package/lib/typescript/src/web/templates/RowText.d.ts +0 -1
  83. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +0 -9
  84. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +0 -2
  85. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +0 -5
  86. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +0 -6
  87. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +0 -7
  88. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +0 -6
  89. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +0 -1
  90. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +0 -11
  91. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +0 -2
  92. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +0 -2
  93. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +0 -2
  94. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +0 -3
  95. package/nitrogen/generated/shared/json/NativeListConfig.json +0 -1
  96. package/package.json +5 -4
  97. package/react-native-native-list.podspec +1 -0
  98. package/src/NativeList.nitro.ts +0 -1
  99. package/src/NativeList.tsx +0 -3
  100. package/src/NativeList.web.tsx +1 -10
  101. package/src/index.ts +0 -3
  102. package/src/web/NativeListWebEngine.ts +24 -53
  103. package/src/web/templates/ActionRowRenderer.ts +1 -2
  104. package/src/web/templates/IdentityRowRenderer.ts +3 -4
  105. package/src/web/templates/MarketRowRenderer.ts +2 -4
  106. package/src/web/templates/RowText.ts +3 -15
  107. package/src/web/templates/SectionHeaderRowRenderer.ts +3 -6
  108. package/LICENSE +0 -36
  109. package/lib/module/fonts.js +0 -44
  110. package/lib/typescript/src/fonts.d.ts +0 -10
  111. package/src/fonts.ts +0 -64
@@ -15,9 +15,9 @@ import com.facebook.react.uimanager.ThemedReactContext
15
15
  import org.json.JSONArray
16
16
  import org.json.JSONObject
17
17
 
18
- internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: NativeListFonts) :
19
- NativeListRendererRowView(context, fonts) {
20
- private val visual = NativeListLeadingVisual(context, fonts)
18
+ internal class NativeListMetricCardRowView(context: ThemedReactContext) :
19
+ NativeListRendererRowView(context) {
20
+ private val visual = NativeListLeadingVisual(context)
21
21
  private val column = LinearLayout(context).apply { orientation = VERTICAL }
22
22
  private val titleLine =
23
23
  LinearLayout(context).apply {
@@ -136,7 +136,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
136
136
  ink: Int = color(theme, "secondaryText", "#0000009B"),
137
137
  ) {
138
138
  NativeListResolvedText.resolve(
139
- context, fonts,
139
+ context,
140
140
  value,
141
141
  style.optJSONObject(slot),
142
142
  size,
@@ -157,7 +157,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
157
157
  if (heading != null) {
158
158
  val spacing = heading.letterSpacing
159
159
  NativeListResolvedText.resolve(
160
- context, fonts,
160
+ context,
161
161
  data.optString("title").uppercase(),
162
162
  style.optJSONObject("title"),
163
163
  11f,
@@ -229,7 +229,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
229
229
  )
230
230
  text(detail, data.optString("subtitle"), "subtitle", 14f)
231
231
  NativeListResolvedText.resolve(
232
- context, fonts,
232
+ context,
233
233
  data.optJSONObject("badge")?.optString("text") ?: "",
234
234
  null,
235
235
  12f,
@@ -282,7 +282,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
282
282
  value = item.json.optString("title").uppercase(),
283
283
  size = 11f,
284
284
  lineHeight = 14,
285
- typeface = fonts.regular(context),
285
+ typeface = NativeListFonts.regular(context),
286
286
  textColor = color(theme, "disabledText", "#00000072"),
287
287
  letterSpacingDp = 1.2f,
288
288
  )
@@ -313,7 +313,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
313
313
  alignment = Gravity.START,
314
314
  valueSize = 18f,
315
315
  valueLineHeight = 24,
316
- valueTypeface = fonts.semibold(context),
316
+ valueTypeface = NativeListFonts.semibold(context),
317
317
  ),
318
318
  LayoutParams(0, LayoutParams.WRAP_CONTENT, 1f),
319
319
  )
@@ -327,7 +327,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
327
327
  alignment = Gravity.END,
328
328
  valueSize = 14f,
329
329
  valueLineHeight = 20,
330
- valueTypeface = fonts.semibold(context),
330
+ valueTypeface = NativeListFonts.semibold(context),
331
331
  ),
332
332
  LayoutParams(0, LayoutParams.WRAP_CONTENT, 1f),
333
333
  )
@@ -379,7 +379,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
379
379
  alignment = Gravity.START,
380
380
  valueSize = 16f,
381
381
  valueLineHeight = 24,
382
- valueTypeface = fonts.semibold(context),
382
+ valueTypeface = NativeListFonts.semibold(context),
383
383
  ),
384
384
  LayoutParams(0, LayoutParams.WRAP_CONTENT, 1f),
385
385
  )
@@ -393,7 +393,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
393
393
  alignment = Gravity.END,
394
394
  valueSize = 14f,
395
395
  valueLineHeight = 20,
396
- valueTypeface = fonts.semibold(context),
396
+ valueTypeface = NativeListFonts.semibold(context),
397
397
  ),
398
398
  LayoutParams(0, LayoutParams.WRAP_CONTENT, 1f),
399
399
  )
@@ -419,7 +419,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
419
419
  alignment = alignment,
420
420
  valueSize = 14f,
421
421
  valueLineHeight = 20,
422
- valueTypeface = fonts.medium(context),
422
+ valueTypeface = NativeListFonts.medium(context),
423
423
  ),
424
424
  LayoutParams(0, LayoutParams.WRAP_CONTENT, 1f),
425
425
  )
@@ -441,7 +441,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
441
441
  alignment = Gravity.START,
442
442
  valueSize = 14f,
443
443
  valueLineHeight = 20,
444
- valueTypeface = fonts.medium(context),
444
+ valueTypeface = NativeListFonts.medium(context),
445
445
  )
446
446
  .apply {
447
447
  setPadding(dp(10), dp(10), dp(10), dp(10))
@@ -473,7 +473,7 @@ internal class NativeListMetricCardRowView(context: ThemedReactContext, fonts: N
473
473
  value = metric.optString("label"),
474
474
  size = 11f,
475
475
  lineHeight = 14,
476
- typeface = fonts.regular(context),
476
+ typeface = NativeListFonts.regular(context),
477
477
  textColor = color(theme, "disabledText", "#00000072"),
478
478
  gravity = alignment,
479
479
  )
@@ -9,7 +9,6 @@ import android.view.View
9
9
  import android.widget.LinearLayout
10
10
  import android.widget.TextView
11
11
  import androidx.core.graphics.PathParser
12
- import com.facebook.react.common.assets.ReactFontManager
13
12
  import kotlin.math.roundToInt
14
13
 
15
14
  /** React Native color strings use CSS #RRGGBBAA ordering; Android expects #AARRGGBB. */
@@ -46,37 +45,25 @@ internal object NativeListScale {
46
45
  if (factor(resources) == 1f) value else (value * factor(resources)).roundToInt().toFloat()
47
46
  }
48
47
 
49
- internal class NativeListFonts {
50
- var generation = 0
51
- private set
52
- private var families: Map<String, String> = emptyMap()
48
+ internal object NativeListFonts {
49
+ private val cache = mutableMapOf<String, Typeface>()
53
50
 
54
- fun configure(json: String): Boolean {
55
- val objectValue = runCatching { org.json.JSONObject(json) }.getOrNull() ?: return false
56
- val next = linkedMapOf<String, String>()
57
- val weights = setOf("regular", "medium", "semibold", "bold")
58
- for (key in objectValue.keys()) {
59
- val name = objectValue.opt(key) as? String ?: return false
60
- if (key !in weights || name.isEmpty() || name.length > 128 || name.any { it.code < 32 || it.code == 127 }) return false
61
- next[key] = name
51
+ private fun load(context: android.content.Context, weight: String, fallback: String): Typeface =
52
+ cache.getOrPut(weight) {
53
+ try {
54
+ Typeface.createFromAsset(context.assets, "fonts/Roobert-$weight.ttf")
55
+ } catch (_: RuntimeException) {
56
+ Typeface.create(fallback, Typeface.NORMAL)
57
+ }
62
58
  }
63
- if (families == next) return false
64
- families = next.toMap()
65
- generation++
66
- return true
67
- }
68
59
 
69
- private fun load(context: android.content.Context, weight: String, systemWeight: Int): Typeface {
70
- val family = families[weight]
71
- return if (family != null) ReactFontManager.getInstance().getTypeface(family, Typeface.NORMAL, context.assets)
72
- else if (android.os.Build.VERSION.SDK_INT >= 28) Typeface.create(Typeface.DEFAULT, systemWeight, false)
73
- else Typeface.create(if (systemWeight in 500..600) "sans-serif-medium" else "sans-serif", if (systemWeight >= 700) Typeface.BOLD else Typeface.NORMAL)
74
- }
60
+ fun regular(context: android.content.Context) = load(context, "Regular", "sans-serif")
61
+
62
+ fun medium(context: android.content.Context) = load(context, "Medium", "sans-serif-medium")
63
+
64
+ fun semibold(context: android.content.Context) = load(context, "SemiBold", "sans-serif-medium")
75
65
 
76
- fun regular(context: android.content.Context) = load(context, "regular", 400)
77
- fun medium(context: android.content.Context) = load(context, "medium", 500)
78
- fun semibold(context: android.content.Context) = load(context, "semibold", 600)
79
- fun bold(context: android.content.Context) = load(context, "bold", 700)
66
+ fun bold(context: android.content.Context) = load(context, "Bold", "sans-serif")
80
67
  }
81
68
 
82
69
  internal class DottedUnderlineTextView(context: android.content.Context) :
@@ -6,8 +6,8 @@ import com.facebook.react.uimanager.ThemedReactContext
6
6
  import kotlin.math.roundToInt
7
7
  import org.json.JSONObject
8
8
 
9
- internal class NativeListRailRowView(context: ThemedReactContext, fonts: NativeListFonts) :
10
- NativeListRendererRowView(context, fonts) {
9
+ internal class NativeListRailRowView(context: ThemedReactContext) :
10
+ NativeListRendererRowView(context) {
11
11
  private val textLine =
12
12
  LinearLayout(context).apply {
13
13
  orientation = HORIZONTAL
@@ -56,7 +56,7 @@ internal class NativeListRailRowView(context: ThemedReactContext, fonts: NativeL
56
56
  lineHeight: Int,
57
57
  ) {
58
58
  NativeListResolvedText.resolve(
59
- reactContext, fonts,
59
+ reactContext,
60
60
  value,
61
61
  style.optJSONObject(field),
62
62
  12f,
@@ -113,7 +113,7 @@ internal class NativeListRailRowView(context: ThemedReactContext, fonts: NativeL
113
113
  // Legacy: a rail without a visual still reserves its empty 20dp slot and gap.
114
114
  val source =
115
115
  item.json.optJSONObject("visual") ?: JSONObject().put("backgroundColor", "#00000000")
116
- val view = visual ?: NativeListLeadingVisual(reactContext, fonts).also { visual = it }
116
+ val view = visual ?: NativeListLeadingVisual(reactContext).also { visual = it }
117
117
  view.bind(source, image, item.key, theme, false, sourceScale)
118
118
  val params = LayoutParams(leadingWidth, imageHeight).apply { marginEnd = leadingGap }
119
119
  if (view.parent == null) addView(view, 0, params) else view.layoutParams = params
@@ -3,7 +3,7 @@ package com.margelo.nitro.nativelist
3
3
  import com.facebook.react.uimanager.ThemedReactContext
4
4
 
5
5
  internal object NativeListRendererRegistry {
6
- private val factories: Map<NativeListRendererKey, (ThemedReactContext, NativeListFonts) -> NativeListRowHost> =
6
+ private val factories: Map<NativeListRendererKey, (ThemedReactContext) -> NativeListRowHost> =
7
7
  mapOf(
8
8
  NativeListRendererKey.SECTION_HEADER to ::NativeListSectionHeaderRowView,
9
9
  NativeListRendererKey.WALLET_GROUP to ::NativeListWalletGroupRowView,
@@ -37,6 +37,6 @@ internal object NativeListRendererRegistry {
37
37
 
38
38
  fun key(type: String) = keys.getValue(type)
39
39
 
40
- fun create(context: ThemedReactContext, viewType: Int, fonts: NativeListFonts): NativeListRowHost =
41
- factories.getValue(NativeListRendererKey.entries[viewType])(context, fonts)
40
+ fun create(context: ThemedReactContext, viewType: Int): NativeListRowHost =
41
+ factories.getValue(NativeListRendererKey.entries[viewType])(context)
42
42
  }
@@ -19,8 +19,8 @@ internal enum class NativeListRendererUpdate {
19
19
  }
20
20
 
21
21
  // Shared chrome and binding lifetime; each renderer owns its content views.
22
- internal abstract class NativeListRendererRowView(protected val reactContext: ThemedReactContext, fonts: NativeListFonts) :
23
- NativeListRowHost(reactContext, fonts) {
22
+ internal abstract class NativeListRendererRowView(protected val reactContext: ThemedReactContext) :
23
+ NativeListRowHost(reactContext) {
24
24
  protected abstract fun bindContent(
25
25
  item: NativeListItem,
26
26
  theme: JSONObject?,
@@ -188,7 +188,6 @@ internal abstract class NativeListRendererRowView(protected val reactContext: Th
188
188
  val signature =
189
189
  nativeListCanonical(
190
190
  JSONObject()
191
- .put("fonts", fonts.generation)
192
191
  .put("theme", theme)
193
192
  .put("layout", layout)
194
193
  .put("orientation", listOrientation)
@@ -76,7 +76,6 @@ internal data class NativeListResolvedText(
76
76
  companion object {
77
77
  fun resolve(
78
78
  context: Context,
79
- fonts: NativeListFonts,
80
79
  text: String,
81
80
  style: JSONObject?,
82
81
  size: Float,
@@ -96,10 +95,10 @@ internal data class NativeListResolvedText(
96
95
  context.resources.displayMetrics.scaledDensity
97
96
  val face =
98
97
  when (style?.optString("fontWeight", weight) ?: weight) {
99
- "medium" -> fonts.medium(context)
100
- "semibold" -> fonts.semibold(context)
101
- "bold" -> fonts.bold(context)
102
- else -> fonts.regular(context)
98
+ "medium" -> NativeListFonts.medium(context)
99
+ "semibold" -> NativeListFonts.semibold(context)
100
+ "bold" -> NativeListFonts.bold(context)
101
+ else -> NativeListFonts.regular(context)
103
102
  }
104
103
  val line =
105
104
  if (style?.has("lineHeight") == true) (style.optDouble("lineHeight") * density).roundToInt()
@@ -17,7 +17,7 @@ internal data class NativeListActionOrigin(
17
17
  )
18
18
 
19
19
  /** List-facing lifecycle shared by template renderers. */
20
- internal abstract class NativeListRowHost(context: ThemedReactContext, val fonts: NativeListFonts) : LinearLayout(context) {
20
+ internal abstract class NativeListRowHost(context: ThemedReactContext) : LinearLayout(context) {
21
21
  var bindingEpoch: Long = 0
22
22
  protected set
23
23
 
@@ -21,8 +21,8 @@ import kotlin.math.roundToInt
21
21
  import org.json.JSONArray
22
22
  import org.json.JSONObject
23
23
 
24
- internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts: NativeListFonts) :
25
- NativeListRendererRowView(context, fonts) {
24
+ internal class NativeListSectionHeaderRowView(context: ThemedReactContext) :
25
+ NativeListRendererRowView(context) {
26
26
  private val mainColumn = LinearLayout(context)
27
27
  private val titleLine = PackedTitleLineLayout(context)
28
28
  private val title = DottedUnderlineTextView(context)
@@ -33,7 +33,7 @@ internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts
33
33
  private val subtitle = NativeListTextView(context)
34
34
  private val trailingColumn = LinearLayout(context)
35
35
  private val trailingViews = listOf(NativeListTextView(context))
36
- private val checkboxControl = NativeListAccessoryStack(context, fonts)
36
+ private val checkboxControl = NativeListAccessoryStack(context)
37
37
  private val headerTitleIcon = OneKeyIconView(context)
38
38
  private val headerValueIcon = OneKeyIconView(context)
39
39
  private var currentItem: NativeListItem? = null
@@ -200,11 +200,11 @@ internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts
200
200
  title.useSourceScale = sourceScale
201
201
  title.showsDottedUnderline = false
202
202
  subtitle.textSize = sp(14f)
203
- subtitle.typeface = fonts.regular(context)
203
+ subtitle.typeface = NativeListFonts.regular(context)
204
204
  subtitle.setTextColor(color(theme, "secondaryText", "#0000009B"))
205
205
  subtitle.layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)
206
206
  trailingViews[0].apply {
207
- typeface = fonts.medium(context)
207
+ typeface = NativeListFonts.medium(context)
208
208
  textSize = sp(16f)
209
209
  gravity = Gravity.END or Gravity.CENTER_VERTICAL
210
210
  setTextColor(color(theme, "primaryText", "#000000DF"))
@@ -238,11 +238,11 @@ internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts
238
238
  item.hasExplicitHeight &&
239
239
  variant != "summary" &&
240
240
  (item.json.optJSONObject("checkbox") != null ||
241
- item.json.optString("titleActionKey").isEmpty()) -> fonts.semibold(context)
242
- network -> fonts.medium(context)
243
- layout == "table" -> fonts.regular(context)
244
- variant == "summary" -> fonts.medium(context)
245
- else -> fonts.semibold(context)
241
+ item.json.optString("titleActionKey").isEmpty()) -> NativeListFonts.semibold(context)
242
+ network -> NativeListFonts.medium(context)
243
+ layout == "table" -> NativeListFonts.regular(context)
244
+ variant == "summary" -> NativeListFonts.medium(context)
245
+ else -> NativeListFonts.semibold(context)
246
246
  }
247
247
  TextViewCompat.setLineHeight(
248
248
  title,
@@ -476,13 +476,13 @@ internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts
476
476
  dp(verticalInset),
477
477
  )
478
478
  title.textSize = sp(14f)
479
- title.typeface = fonts.medium(context)
479
+ title.typeface = NativeListFonts.medium(context)
480
480
  TextViewCompat.setLineHeight(title, dp(20))
481
481
  } else if (isHistory) {
482
482
  setPadding(0, 0, 0, 0)
483
483
  title.text = item.json.optString("title").uppercase()
484
484
  title.textSize = sp(12f)
485
- title.typeface = fonts.semibold(context)
485
+ title.typeface = NativeListFonts.semibold(context)
486
486
  title.letterSpacing = 0.8f / sp(12f)
487
487
  TextViewCompat.setLineHeight(title, dp(16))
488
488
  } else if (!isTable && !isGallery && !isSummary) {
@@ -528,7 +528,7 @@ internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts
528
528
  )
529
529
  trailingViews[0].accessibilityDelegate = selectorAccessibilityDelegate
530
530
  trailingViews[0].textSize = sp(16f)
531
- trailingViews[0].typeface = fonts.medium(context)
531
+ trailingViews[0].typeface = NativeListFonts.medium(context)
532
532
  TextViewCompat.setLineHeight(trailingViews[0], dp(24))
533
533
  // OneKey patch: the migrated media button shares the original 24-point text box.
534
534
  if (isExplicitNetworkHeader) trailingViews[0].setPadding(0, 0, 0, 0)
@@ -555,7 +555,7 @@ internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts
555
555
  trailingColumn.gravity = Gravity.END or Gravity.CENTER_VERTICAL
556
556
  trailingViews[0].includeFontPadding = false
557
557
  trailingViews[0].textSize = sp(11f)
558
- trailingViews[0].typeface = fonts.regular(context)
558
+ trailingViews[0].typeface = NativeListFonts.regular(context)
559
559
  trailingViews[0].setTextColor(color(theme, "secondaryText", "#0000009B"))
560
560
  item.json.optJSONObject("valueIcon")?.let { icon ->
561
561
  headerValueIcon.visibility = VISIBLE
@@ -591,7 +591,7 @@ internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts
591
591
  view.text = value
592
592
  view.textSize = sp(if (primary) 16f else 14f)
593
593
  view.typeface =
594
- if (primary) fonts.medium(context) else fonts.regular(context)
594
+ if (primary) NativeListFonts.medium(context) else NativeListFonts.regular(context)
595
595
  view.includeFontPadding = false
596
596
  view.fontFeatureSettings = "tnum"
597
597
  TextViewCompat.setLineHeight(view, dp(if (primary) 24 else 20))
@@ -633,7 +633,7 @@ internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts
633
633
  }
634
634
  view.textSize = sp(fontSize.toFloat())
635
635
  view.typeface =
636
- if (medium) fonts.medium(context) else fonts.regular(context)
636
+ if (medium) NativeListFonts.medium(context) else NativeListFonts.regular(context)
637
637
  TextViewCompat.setLineHeight(view, dp(lineHeight))
638
638
  view.text = value
639
639
  }
@@ -651,10 +651,10 @@ internal class NativeListSectionHeaderRowView(context: ThemedReactContext, fonts
651
651
  style.optString("fontWeight").takeIf(String::isNotEmpty)?.let {
652
652
  view.typeface =
653
653
  when (it) {
654
- "medium" -> fonts.medium(context)
655
- "semibold" -> fonts.semibold(context)
656
- "bold" -> fonts.bold(context)
657
- else -> fonts.regular(context)
654
+ "medium" -> NativeListFonts.medium(context)
655
+ "semibold" -> NativeListFonts.semibold(context)
656
+ "bold" -> NativeListFonts.bold(context)
657
+ else -> NativeListFonts.regular(context)
658
658
  }
659
659
  }
660
660
  style.optString("color").takeIf(String::isNotEmpty)?.let {
@@ -20,8 +20,8 @@ import kotlin.math.roundToInt
20
20
  import org.json.JSONObject
21
21
 
22
22
  /** System owns status content; placement and actions remain in the list host. */
23
- internal class NativeListSystemRowView(context: ThemedReactContext, fonts: NativeListFonts) :
24
- NativeListRendererRowView(context, fonts) {
23
+ internal class NativeListSystemRowView(context: ThemedReactContext) :
24
+ NativeListRendererRowView(context) {
25
25
  private val title = NativeListTextView(context)
26
26
  private val message = NativeListTextView(context)
27
27
  private val action = NativeListTextView(context)
@@ -129,7 +129,7 @@ internal class NativeListSystemRowView(context: ThemedReactContext, fonts: Nativ
129
129
  }
130
130
  var resolved =
131
131
  NativeListResolvedText.resolve(
132
- context, fonts,
132
+ context,
133
133
  value,
134
134
  merged,
135
135
  size,