{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/11007","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/11007/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/11007/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/11007/events","html_url":"https://github.com/facebook/react-native/pull/11007","id":190206817,"number":11007,"title":"Android: Expose textBreakStrategy on Text and TextInput","user":{"login":"rigdern","id":199935,"avatar_url":"https://avatars.githubusercontent.com/u/199935?v=3","gravatar_id":"","url":"https://api.github.com/users/rigdern","html_url":"https://github.com/rigdern","followers_url":"https://api.github.com/users/rigdern/followers","following_url":"https://api.github.com/users/rigdern/following{/other_user}","gists_url":"https://api.github.com/users/rigdern/gists{/gist_id}","starred_url":"https://api.github.com/users/rigdern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rigdern/subscriptions","organizations_url":"https://api.github.com/users/rigdern/orgs","repos_url":"https://api.github.com/users/rigdern/repos","events_url":"https://api.github.com/users/rigdern/events{/privacy}","received_events_url":"https://api.github.com/users/rigdern/received_events","type":"User","site_admin":false},"labels":[{"id":196858975,"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7","default":false},{"id":172167414,"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20accepted","name":"GH Review: accepted","color":"009800","default":false},{"id":302755315,"url":"https://api.github.com/repos/facebook/react-native/labels/Import%20Failed","name":"Import Failed","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-11-18T00:40:53Z","updated_at":"2016-11-25T14:23:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/11007","html_url":"https://github.com/facebook/react-native/pull/11007","diff_url":"https://github.com/facebook/react-native/pull/11007.diff","patch_url":"https://github.com/facebook/react-native/pull/11007.patch"},"body":"Android has a text API called breakStrategy for controlling how paragraphs are broken up into lines. For example, some modes support automatically hyphenating words so a word can be split across lines while others do not.\r\n\r\nOne source of complexity is that Android provides different defaults for `breakStrategy` for `TextView` vs `EditText`. `TextView`'s default is `BREAK_STRATEGY_HIGH_QUALITY` while `EditText`'s default is `BREAK_STRATEGY_SIMPLE`.\r\n\r\nIn addition to exposing `textBreakStrategy`, this change also fixes a couple of rendering glitches with `Text` and `TextInput`. `TextView` and `EditText` have different default values for `breakStrategy` and `hyphenationFrequency` than `StaticLayout`. Consequently, we were using different parameters for measuring and rendering. Whenever measuring and rendering parameters are inconsistent, it can result in visual glitches such as the text taking up too much space or being clipped.\r\n\r\nThis change fixes these inconsistencies by setting `breakStrategy` and `hyphenationFrequency` to the appropriate values during measuring.\r\n\r\n**Test plan (required)**\r\n\r\nVerified the `textBreakStrategy` prop works in a test app. Also, my team's app uses this change.\r\n\r\nAdam Comella\r\nMicrosoft Corp."},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/262966153","html_url":"https://github.com/facebook/react-native/pull/11007#issuecomment-262966153","issue_url":"https://api.github.com/repos/facebook/react-native/issues/11007","id":262966153,"user":{"login":"mkonicek","id":346214,"avatar_url":"https://avatars.githubusercontent.com/u/346214?v=3","gravatar_id":"","url":"https://api.github.com/users/mkonicek","html_url":"https://github.com/mkonicek","followers_url":"https://api.github.com/users/mkonicek/followers","following_url":"https://api.github.com/users/mkonicek/following{/other_user}","gists_url":"https://api.github.com/users/mkonicek/gists{/gist_id}","starred_url":"https://api.github.com/users/mkonicek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkonicek/subscriptions","organizations_url":"https://api.github.com/users/mkonicek/orgs","repos_url":"https://api.github.com/users/mkonicek/repos","events_url":"https://api.github.com/users/mkonicek/events{/privacy}","received_events_url":"https://api.github.com/users/mkonicek/received_events","type":"User","site_admin":false},"created_at":"2016-11-25T14:23:17Z","updated_at":"2016-11-25T14:23:17Z","body":"Thanks @rigdern!\r\n\r\nThe [Circle CI test failure](https://circleci.com/gh/facebook/react-native/13558?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link) looks related:\r\n\r\n`TextInputTestCase` failed:\r\n\r\n    E/AndroidRuntime( 2456): Process: com.facebook.react.tests, PID: 2456\r\n    E/AndroidRuntime( 2456): java.lang.NoSuchMethodError: android.widget.EditText.getBreakStrategy\r\n    E/AndroidRuntime( 2456): \tat com.facebook.react.views.textinput.ReactTextInputShadowNode.measure(ReactTextInputShadowNode.java:109)\r\n    ...\r\n\r\nI'm hoping the documented way to run tests locally still works? http://facebook.github.io/react-native/docs/testing.html#integration-tests-android"}}
{"actor":{"display_login":"mkonicek"}}