Improve ellipsizeMode prop

Summary:
There are a couple of buggy behaviors in the current implementation of the `ellipsizeMode` prop on Android:
  - Setting the `numberOfLines` prop stomps on whatever value you provided for `ellipsizeMode` earlier.
  - The value you've provided for `ellipsizeMode` is used even if you've configured your view to have an unlimited size (i.e. `numberOfLines` is 0 or unspecified).

This change fixes these issues which makes Android's `ellipsizeMode` prop more consistent with iOS's. Additionally, it renames LineBreakMode to EllipsizeMode in a couple of places.

**Test plan (required)**

Verified that the `numberOfLines` and `ellipsizeMode` props work correctly in an Android test app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9594

Differential Revision: D3810166

Pulled By: foghina

fbshipit-source-id: 229c9bfc3ef10670a1090311ea9d095cb2c1121a
This commit is contained in:
Adam Comella
2016-09-02 00:45:28 -07:00
committed by Facebook Github Bot
parent d8abea1bf7
commit cd1a86db36
3 changed files with 37 additions and 15 deletions

View File

@@ -75,7 +75,7 @@ public class ViewProps {
public static final String LINE_HEIGHT = "lineHeight";
public static final String NEEDS_OFFSCREEN_ALPHA_COMPOSITING = "needsOffscreenAlphaCompositing";
public static final String NUMBER_OF_LINES = "numberOfLines";
public static final String LINE_BREAK_MODE = "ellipsizeMode";
public static final String ELLIPSIZE_MODE = "ellipsizeMode";
public static final String ON = "on";
public static final String RESIZE_MODE = "resizeMode";
public static final String TEXT_ALIGN = "textAlign";