Skip to content


Browse files Browse the repository at this point in the history
do not call setHyphenationFrequency on AndroidSdk < 23 (#29258)
JoshuaGross This issue fixes #28279 as discussed in #29157 (comment)
Avoid calling [setHyphenationFrequency]( on Android Sdk < 23.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:

[Android] [Fixed] - do not call setHyphenationFrequency on AndroidSdk < 23
Pull Request resolved: #29258

Test Plan:
| **BEFORE** | **AFTER** |
|  <img src=""  width="300" height="" />| <img src="" width="300" height="" /> |

The warning displayed with `adb logcat | grep -P "ReactTextAnchorViewManager"`


I remain available to do improvements. Thanks a lot. Fabrizio.

Reviewed By: JoshuaGross

Differential Revision: D22337095

Pulled By: mdvacca

fbshipit-source-id: d0943397af180929c48044ccbc7a9388549021b8
  • Loading branch information
fabriziobertoglio1987 authored and facebook-github-bot committed Jul 2, 2020
1 parent c6b9cc3 commit 7d8aeb4
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -7,13 +7,15 @@

package com.facebook.react.views.text;

import android.os.Build;
import android.text.Layout;
import android.text.Spannable;
import android.text.TextUtils;
import android.text.util.Linkify;
import android.view.Gravity;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.common.logging.FLog;
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.PixelUtil;
Expand All @@ -39,6 +41,7 @@ public abstract class ReactTextAnchorViewManager<T extends View, C extends React
private static final int[] SPACING_TYPES = {
Spacing.ALL, Spacing.LEFT, Spacing.RIGHT, Spacing.TOP, Spacing.BOTTOM,
private static final String TAG = "ReactTextAnchorViewManager";

// maxLines can only be set in master view (block), doesn't really make sense to set in a span
@ReactProp(name = ViewProps.NUMBER_OF_LINES, defaultInt = ViewDefaults.NUMBER_OF_LINES)
Expand Down Expand Up @@ -99,6 +102,10 @@ public void setSelectionColor(ReactTextView view, @Nullable Integer color) {

@ReactProp(name = "android_hyphenationFrequency")
public void setAndroidHyphenationFrequency(ReactTextView view, @Nullable String frequency) {
FLog.w(TAG, "android_hyphenationFrequency only available since android 23");
if (frequency == null || frequency.equals("none")) {
} else if (frequency.equals("full")) {
Expand Down

0 comments on commit 7d8aeb4

Please sign in to comment.