Skip to content

Commit

Permalink
Change stroke style set up
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
* support stroke style without modifying TextStyle as it is shared across Bloks and Litho (see comments in D68187778 for more context)

Reviewed By: xzhch1622

Differential Revision: D68587164

fbshipit-source-id: d6c660f4aceca8ed6efc91fa68f435a6c1e8c29a
  • Loading branch information
Ale Van Praag authored and facebook-github-bot committed Jan 24, 2025
1 parent 3f870df commit ce957bb
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ 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 @@ -359,9 +357,4 @@ 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 ce957bb

Please sign in to comment.