Skip to content

Commit

Permalink
Merge pull request #36875 from facebook/kelset/070-backport-textinput…
Browse files Browse the repository at this point in the history
…-fixes
  • Loading branch information
kelset authored Apr 17, 2023
2 parents 7b14417 + 5339e95 commit 124547e
Show file tree
Hide file tree
Showing 12 changed files with 324 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public void updateMeasureState(TextPaint paint) {
apply(paint);
}

public float getSpacing() {
return mLetterSpacing;
}

private void apply(TextPaint paint) {
if (!Float.isNaN(mLetterSpacing)) {
paint.setLetterSpacing(mLetterSpacing);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public int getWeight() {
return mFontFamily;
}

public @Nullable String getFontFeatureSettings() {
return mFeatureSettings;
}

private static void apply(
Paint paint,
int style,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public class ReactTextUpdate {
private final int mSelectionEnd;
private final int mJustificationMode;

public boolean mContainsMultipleFragments;

/**
* @deprecated Use a non-deprecated constructor for ReactTextUpdate instead. This one remains
* because it's being used by a unit test that isn't currently open source.
Expand Down Expand Up @@ -142,13 +140,11 @@ public static ReactTextUpdate buildReactTextUpdateFromState(
int jsEventCounter,
int textAlign,
int textBreakStrategy,
int justificationMode,
boolean containsMultipleFragments) {
int justificationMode) {

ReactTextUpdate reactTextUpdate =
new ReactTextUpdate(
text, jsEventCounter, false, textAlign, textBreakStrategy, justificationMode);
reactTextUpdate.mContainsMultipleFragments = containsMultipleFragments;
return reactTextUpdate;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ public static boolean isRTL(MapBuffer attributedString) {

MapBuffer fragment = fragments.getMapBuffer((short) 0);
MapBuffer textAttributes = fragment.getMapBuffer(FR_KEY_TEXT_ATTRIBUTES);

if (!textAttributes.contains(TextAttributeProps.TA_KEY_LAYOUT_DIRECTION)) {
return false;
}

return TextAttributeProps.getLayoutDirection(
textAttributes.getString(TextAttributeProps.TA_KEY_LAYOUT_DIRECTION))
== LayoutDirection.RTL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ rn_android_library(
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"supermodule:xplat/default/public.react_native.infra",
],
language = "JAVA",
language = "KOTLIN",
pure_kotlin = False,
required_for_source_only_abi = True,
visibility = [
"PUBLIC",
Expand All @@ -29,7 +30,9 @@ rn_android_library(
react_native_target("java/com/facebook/react/views/imagehelper:imagehelper"),
react_native_target("java/com/facebook/react/views/scroll:scroll"),
react_native_target("java/com/facebook/react/views/text:text"),
react_native_target("java/com/facebook/react/common/mapbuffer:mapbuffer"),
react_native_target("java/com/facebook/react/views/view:view"),
react_native_target("java/com/facebook/react/config:config"),
],
exported_deps = [
react_native_dep("third-party/android/androidx:appcompat"),
Expand Down
Loading

0 comments on commit 124547e

Please sign in to comment.