mirror of
https://github.com/status-im/react-native.git
synced 2025-01-15 03:56:03 +00:00
bdff10b4ea
Summary: The issue here is that on some devices (ie. Nexus 5X), under certain circumstances, the text gets trimmed. A simple example is P56651885, where the text is at the end of the line and some padding is set. Digging further with P56659346, I found that only the paddings that have integer pixel values work correctly: these are the values P56656483, and this is the screenshot of that test: {F63510378}. It turns out that when we set the padding directly on the TextView, we have to convert from float to int, and use `ceil` in the process. We lose some precision here, since the csslayout will use the float values to compute the layout of the views. The ideal solution would be to just set the float values on the TextView, but since we can't do that, we should avoid using `ceil` instead of `floor` since it can have bad side-effects in some scenarios. Going way back to D1881202 and D1710471, we started using `ceil` because that is how android handles non-integer density ratios: "This figure is the factor by which you should multiply the dp units on order to get the actual pixel count for the current screen. (Then add 0.5f to round the figure up to the nearest whole number, when converting to an integer.)", see https://developer.android.com/guide/practices/screens_support.html. Reviewed By: emilsjolander Differential Revision: D3876310 fbshipit-source-id: 701c05a8b1a045d4e06fc89ffe79162c1eecb62c
Building React Native for Android
See the docs on the website.
Running tests
When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing.