Skip to content

Commit

Permalink
Add two more version checks for ReactTextView recycling
Browse files Browse the repository at this point in the history
Summary:
setFocusable(int) was added in Android O, and setHyphenationFreqauency was added in M.

Changelog: [Internal]

Reviewed By: kacieb

Differential Revision: D37462117

fbshipit-source-id: e59d2de49dbdcddfdba25def6bb39695c65efe89
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Jun 27, 2022
1 parent 0646551 commit cf0a0ef
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ private void initView() {
// mViewFlags = SOUND_EFFECTS_ENABLED | HAPTIC_FEEDBACK_ENABLED |
// LAYOUT_DIRECTION_INHERIT;
setEnabled(true);
setFocusable(View.FOCUSABLE_AUTO);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
setFocusable(View.FOCUSABLE_AUTO);
}

setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NONE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NONE);
}

updateView(); // call after changing ellipsizeLocation in particular
}
Expand Down

0 comments on commit cf0a0ef

Please sign in to comment.