Skip to content

Commit

Permalink
Support stroke text style
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ale Van Praag authored and facebook-github-bot committed Jan 9, 2025
1 parent 1ebd5ff commit bde19d4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public class TextStyle implements Cloneable {
int highlightEndOffset = UNSET;
int highlightCornerRadius = 0;
boolean shouldLayoutEmptyText = false;
int strokeColor = Color.TRANSPARENT;
int strokeWidth = 0;

boolean shouldTruncateTextUsingConstraints = false;
int manualBaselineSpacing = Integer.MIN_VALUE;
Expand Down Expand Up @@ -357,4 +359,9 @@ public RoundedBackgroundProps(RectF padding, float cornerRadius, int backgroundC
this.backgroundColor = backgroundColor;
}
}

public void setStrokeStyle(int strokeColor, int strokeWidth) {
this.strokeColor = strokeColor;
this.strokeWidth = strokeWidth;
}
}

0 comments on commit bde19d4

Please sign in to comment.