-
Notifications
You must be signed in to change notification settings - Fork 24.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rendering of FB emoji in RN Android
Summary: This diff ensures the measurement and rendering of FB emojis is correnct in RN Android. Before this commit we were customizing Spannable object with FB emojis right before rendering the text into the TextView, this diff ensures that the Spannable is "customized" as soon as it is created, ensuring the measurement of the Text. changelog: [internal] Reviewed By: JoshuaGross Differential Revision: D19354107 fbshipit-source-id: 92e07cf30503404f7820f25eaa9efdc02f6bddbd
- Loading branch information
1 parent
bef845f
commit 475df06
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManagerCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.react.views.text; | ||
|
||
import android.text.Spannable; | ||
|
||
/** | ||
* This interface allows clients of {@link ReactTextViewManager} to customize or prepare {@link | ||
* Spannable} object that represent text that will be rendered on the screen. | ||
*/ | ||
public interface ReactTextViewManagerCallback { | ||
|
||
/** | ||
* Callback executed right after the {@link Spannable} object is created by React. | ||
* | ||
* <p>This callback can be used by different implementations of ReactTextViewManager to customize | ||
* Spannable or extend managed created by React. | ||
*/ | ||
void onPostProcessSpannable(Spannable text); | ||
} |