@@ -152,4 +152,76 @@ SharedDebugStringConvertibleList ParagraphProps::getDebugProps() const {
152
152
}
153
153
#endif
154
154
155
+ #ifdef ANDROID
156
+
157
+ folly::dynamic ParagraphProps::getDiffProps (const Props* prevProps) const {
158
+ static const auto defaultProps = ParagraphProps ();
159
+
160
+ const ParagraphProps* oldProps = prevProps == nullptr
161
+ ? &defaultProps
162
+ : static_cast <const ParagraphProps*>(prevProps);
163
+
164
+ folly::dynamic result = ViewProps::getDiffProps (oldProps);
165
+
166
+ BaseTextProps::appendTextAttributesProps (result, oldProps);
167
+
168
+ if (paragraphAttributes.maximumNumberOfLines !=
169
+ oldProps->paragraphAttributes .maximumNumberOfLines ) {
170
+ result[" numberOfLine" ] = paragraphAttributes.maximumNumberOfLines ;
171
+ }
172
+
173
+ if (paragraphAttributes.ellipsizeMode !=
174
+ oldProps->paragraphAttributes .ellipsizeMode ) {
175
+ result[" ellipsizeMode" ] = toString (paragraphAttributes.ellipsizeMode );
176
+ }
177
+
178
+ if (paragraphAttributes.textBreakStrategy !=
179
+ oldProps->paragraphAttributes .textBreakStrategy ) {
180
+ result[" textBreakStrategy" ] =
181
+ toString (paragraphAttributes.textBreakStrategy );
182
+ }
183
+
184
+ if (paragraphAttributes.adjustsFontSizeToFit !=
185
+ oldProps->paragraphAttributes .adjustsFontSizeToFit ) {
186
+ result[" adjustsFontSizeToFit" ] = paragraphAttributes.adjustsFontSizeToFit ;
187
+ }
188
+
189
+ if (paragraphAttributes.minimumFontScale !=
190
+ oldProps->paragraphAttributes .minimumFontScale ) {
191
+ result[" minimumFontScale" ] = paragraphAttributes.minimumFontScale ;
192
+ }
193
+
194
+ if (paragraphAttributes.minimumFontSize !=
195
+ oldProps->paragraphAttributes .minimumFontSize ) {
196
+ result[" minimumFontSize" ] = paragraphAttributes.minimumFontSize ;
197
+ }
198
+
199
+ if (paragraphAttributes.maximumFontSize !=
200
+ oldProps->paragraphAttributes .maximumFontSize ) {
201
+ result[" maximumFontSize" ] = paragraphAttributes.maximumFontSize ;
202
+ }
203
+
204
+ if (paragraphAttributes.includeFontPadding !=
205
+ oldProps->paragraphAttributes .includeFontPadding ) {
206
+ result[" includeFontPadding" ] = paragraphAttributes.includeFontPadding ;
207
+ }
208
+
209
+ if (paragraphAttributes.android_hyphenationFrequency !=
210
+ oldProps->paragraphAttributes .android_hyphenationFrequency ) {
211
+ result[" android_hyphenationFrequency" ] =
212
+ toString (paragraphAttributes.android_hyphenationFrequency );
213
+ }
214
+
215
+ if (isSelectable != oldProps->isSelectable ) {
216
+ result[" selectable" ] = isSelectable;
217
+ }
218
+
219
+ if (onTextLayout != oldProps->onTextLayout ) {
220
+ result[" onTextLayout" ] = onTextLayout;
221
+ }
222
+
223
+ return result;
224
+ }
225
+
226
+ #endif
155
227
} // namespace facebook::react
0 commit comments