Skip to content

Commit

Permalink
Better API documentation for new methods
Browse files Browse the repository at this point in the history
Summary: Better API documentation for new methods.

Reviewed By: ahmedre

Differential Revision: D4856222

fbshipit-source-id: 910a2c5f9e30d372aa922231c979e4a983cc3f98
  • Loading branch information
sriramramani authored and facebook-github-bot committed Apr 8, 2017
1 parent 2e351ef commit 428e4ec
Showing 1 changed file with 47 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,22 @@ public TextLayoutBuilder setGlyphWarmer(GlyphWarmer glyphWarmer) {
}

/**
* Sets the min width expressed in ems (equivalent to setMinEms() in TextView)
* Returns the min width expressed in ems.
*
* @return the min width expressed in ems or -1
* @see #setMinEms(int)
*/
public int getMinEms() {
return mMinWidthMode == EMS ? mMinWidth : -1;
}

/**
* Sets the min width expressed in ems.
*
* @param minEms min width expressed in ems
* @return This {@link TextLayoutBuilder} instance
* @see #setMaxEms(int)
* @see #setMinWidth(int)
*/
public TextLayoutBuilder setMinEms(int minEms) {
mMinWidth = minEms;
Expand All @@ -642,18 +655,23 @@ public TextLayoutBuilder setMinEms(int minEms) {
}

/**
* @return the min width expressed in ems (equivalent to getMinEms() in TextView) or -1
* if min width is set in pixels instead by using {@link #setMinWidth(int)}
* Returns the min width expressed in pixels.
*
* @see #setMinEms(int)
* @return the min width expressed in pixels or -1, if the min width was set in ems instead
* @see #setMinWidth(int)
*/
public int getMinEms() {
return mMinWidthMode == EMS ? mMinWidth : -1;
@Px
public int getMinWidth() {
return mMinWidthMode == PIXELS ? mMinWidth : -1;
}

/**
* Sets the min width expressed in pixels
* @param minWidth
* Sets the min width expressed in pixels.
*
* @param minWidth min width expressed in pixels.
* @return This {@link TextLayoutBuilder} instance
* @see #setMaxWidth(int)
* @see #setMinEms(int)
*/
public TextLayoutBuilder setMinWidth(@Px int minWidth) {
mMinWidth = minWidth;
Expand All @@ -662,19 +680,22 @@ public TextLayoutBuilder setMinWidth(@Px int minWidth) {
}

/**
* @return the min width expressed in pixels or -1 if the min width was set in ems instead
* Returns the max width expressed in ems.
*
* @see #setMinWidth(int)
* @return the max width expressed in ems or -1, if max width is set in pixels instead
* @see #setMaxEms(int)
*/
@Px
public int getMinWidth() {
return mMinWidthMode == PIXELS ? mMinWidth : -1;
public int getMaxEms() {
return mMaxWidthMode == EMS ? mMaxWidth : -1;
}

/**
* Sets the max width expressed in ems (equivalent to setMaxEms() in TextView)
* Sets the max width expressed in ems.
*
* @param maxEms max width expressed in ems
* @return This {@link TextLayoutBuilder} instance
* @see #setMaxWidth(int)
* @see #setMinEms(int)
*/
public TextLayoutBuilder setMaxEms(int maxEms) {
mMaxWidth = maxEms;
Expand All @@ -683,35 +704,30 @@ public TextLayoutBuilder setMaxEms(int maxEms) {
}

/**
* @return the max width expressed in ems (equivalent to getMaxEms() in TextView) or -1
* if max width is set in pixels instead by using {@link #setMaxWidth(int)}
* Returns the max width expressed in pixels.
*
* @see #setMaxEms(int)
* @return the max width expressed in pixels or -1, if the max width was set in ems instead
* @see #setMaxWidth(int)
*/
public int getMaxEms() {
return mMaxWidthMode == EMS ? mMaxWidth : -1;
@Px
public int getMaxWidth() {
return mMaxWidthMode == PIXELS ? mMaxWidth : -1;
}

/**
* Sets the max width expressed in pixels
* @param maxWidth
* Sets the max width expressed in pixels.
*
* @param maxWidth max width expressed in pixels
* @return This {@link TextLayoutBuilder} instance
* @see #setMaxEms(int)
* @see #setMinWidth(int)
*/
public TextLayoutBuilder setMaxWidth(@Px int maxWidth) {
mMaxWidth = maxWidth;
mMaxWidthMode = PIXELS;
return this;
}

/**
* @return the max width expressed in pixels or -1 if the max width was set in ems instead
*
* @see #setMaxWidth(int)
*/
@Px
public int getMaxWidth() {
return mMaxWidthMode == PIXELS ? mMaxWidth : -1;
}

/**
* Builds and returns a {@link Layout}.
*
Expand Down

0 comments on commit 428e4ec

Please sign in to comment.