react-native-advanced-text 0.1.25 → 0.1.26

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.
@@ -20,6 +20,7 @@ import com.facebook.react.bridge.Arguments
20
20
  import com.facebook.react.bridge.ReactContext
21
21
  import com.facebook.react.uimanager.events.RCTEventEmitter
22
22
  import android.text.Selection
23
+ import android.graphics.Typeface
23
24
 
24
25
  class AdvancedTextView : TextView {
25
26
 
@@ -116,12 +117,13 @@ class AdvancedTextView : TextView {
116
117
  fun setAdvancedTextSize(size: Float) {
117
118
  if (fontSize == size) return
118
119
  fontSize = size
119
- updateTextWithHighlights() // ensures size change is applied with highlights
120
+ updateTextWithHighlights()
120
121
  }
121
122
 
122
123
  fun setAdvancedFontWeight(weight: String) {
123
124
  if (fontWeight == weight) return
124
125
  fontWeight = weight
126
+ updateTextWithHighlights()
125
127
  }
126
128
 
127
129
  fun setAdvancedTextAlign(align: String) {
@@ -83,11 +83,11 @@ class AdvancedTextViewManager : SimpleViewManager<AdvancedTextView>() {
83
83
  view?.setIndicatorWordIndex(if (index >= 0) index else -1)
84
84
  }
85
85
 
86
- @ReactProp(name = "color", customType = "Color")
87
- fun setColor(view: AdvancedTextView?, color: Int?) {
86
+ @ReactProp(name = "color")
87
+ fun setColor(view: AdvancedTextView?, color: String?) {
88
88
  android.util.Log.d(NAME, "setColor called with: $color")
89
89
  if (color != null) {
90
- view?.setAdvancedTextColor(color)
90
+ view?.setAdvancedTextColor(Color.parseColor(color))
91
91
  }
92
92
  }
93
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-advanced-text",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": " Advanced text component for React Native with custom select options.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",