Skip to content

Commit bde19d4

Browse files
Ale Van Praagfacebook-github-bot
Ale Van Praag
authored andcommitted
Support stroke text style
Summary: # Context We are working on migrating showreel bloks ads to native implementation and one important feature is TextOverlay. In showreel bloks, the text overlay rendering heavily rely on RichTextView. We tried using TextView instead (See diff stack D63923873) but experiment shows large frame drop regressions (https://fburl.com/gdoc/fcnxfgzs) which is likely caused by the dynamic text sizing logic. To make the native implementation as close as showreel bloks, we plan to switch to RichText litho component so we can reuse similar dynamic text sizing logic from showreel bloks. Tech spec: https://fburl.com/gdoc/myn5fzc0 # This diff * We will need the text outline for native text overlay for 9:16 video ads in M2. This diff adds the capability of the feature. By default the effect is off. We will integrate it with the server when backend is ready. Reviewed By: adityasharat, xzhch1622 Differential Revision: D67874677 fbshipit-source-id: 2b1eeaec66f616999a1082a4ce0ee92a6359e9fc
1 parent 1ebd5ff commit bde19d4

File tree

1 file changed

+7
-0
lines changed
  • litho-rendercore-text/src/main/java/com/facebook/rendercore/text

1 file changed

+7
-0
lines changed

litho-rendercore-text/src/main/java/com/facebook/rendercore/text/TextStyle.java

+7
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public class TextStyle implements Cloneable {
7171
int highlightEndOffset = UNSET;
7272
int highlightCornerRadius = 0;
7373
boolean shouldLayoutEmptyText = false;
74+
int strokeColor = Color.TRANSPARENT;
75+
int strokeWidth = 0;
7476

7577
boolean shouldTruncateTextUsingConstraints = false;
7678
int manualBaselineSpacing = Integer.MIN_VALUE;
@@ -357,4 +359,9 @@ public RoundedBackgroundProps(RectF padding, float cornerRadius, int backgroundC
357359
this.backgroundColor = backgroundColor;
358360
}
359361
}
362+
363+
public void setStrokeStyle(int strokeColor, int strokeWidth) {
364+
this.strokeColor = strokeColor;
365+
this.strokeWidth = strokeWidth;
366+
}
360367
}

0 commit comments

Comments
 (0)