Make letterSpacing and fontFeatureSettings public
We added APIs and TextView xml attributes to give access to letter spacing and OpenType features. This patch makes these changes part of the public API. Bug: 15246510 Bug: 15594400 Change-Id: I7a54cb0da2746304a5c72a687612a279cac652e0
This commit is contained in:
@@ -602,6 +602,7 @@ package android {
|
||||
field public static final int focusableInTouchMode = 16842971; // 0x10100db
|
||||
field public static final int focusedMonthDateColor = 16843587; // 0x1010343
|
||||
field public static final int fontFamily = 16843692; // 0x10103ac
|
||||
field public static final int fontFeatureSettings = 16843962; // 0x10104ba
|
||||
field public static final int footerDividersEnabled = 16843311; // 0x101022f
|
||||
field public static final int foreground = 16843017; // 0x1010109
|
||||
field public static final int foregroundGravity = 16843264; // 0x1010200
|
||||
@@ -837,6 +838,7 @@ package android {
|
||||
field public static final int layout_x = 16843135; // 0x101017f
|
||||
field public static final int layout_y = 16843136; // 0x1010180
|
||||
field public static final int left = 16843181; // 0x10101ad
|
||||
field public static final int letterSpacing = 16843961; // 0x10104b9
|
||||
field public static final int lineSpacingExtra = 16843287; // 0x1010217
|
||||
field public static final int lineSpacingMultiplier = 16843288; // 0x1010218
|
||||
field public static final int lines = 16843092; // 0x1010154
|
||||
@@ -11031,12 +11033,14 @@ package android.graphics {
|
||||
method public android.graphics.ColorFilter getColorFilter();
|
||||
method public boolean getFillPath(android.graphics.Path, android.graphics.Path);
|
||||
method public int getFlags();
|
||||
method public java.lang.String getFontFeatureSettings();
|
||||
method public float getFontMetrics(android.graphics.Paint.FontMetrics);
|
||||
method public android.graphics.Paint.FontMetrics getFontMetrics();
|
||||
method public int getFontMetricsInt(android.graphics.Paint.FontMetricsInt);
|
||||
method public android.graphics.Paint.FontMetricsInt getFontMetricsInt();
|
||||
method public float getFontSpacing();
|
||||
method public int getHinting();
|
||||
method public float getLetterSpacing();
|
||||
method public android.graphics.MaskFilter getMaskFilter();
|
||||
method public android.graphics.PathEffect getPathEffect();
|
||||
method public deprecated android.graphics.Rasterizer getRasterizer();
|
||||
@@ -11086,7 +11090,9 @@ package android.graphics {
|
||||
method public void setFakeBoldText(boolean);
|
||||
method public void setFilterBitmap(boolean);
|
||||
method public void setFlags(int);
|
||||
method public void setFontFeatureSettings(java.lang.String);
|
||||
method public void setHinting(int);
|
||||
method public void setLetterSpacing(float);
|
||||
method public void setLinearText(boolean);
|
||||
method public android.graphics.MaskFilter setMaskFilter(android.graphics.MaskFilter);
|
||||
method public android.graphics.PathEffect setPathEffect(android.graphics.PathEffect);
|
||||
@@ -39662,6 +39668,7 @@ package android.widget {
|
||||
method public int getExtendedPaddingBottom();
|
||||
method public int getExtendedPaddingTop();
|
||||
method public android.text.InputFilter[] getFilters();
|
||||
method public java.lang.String getFontFeatureSettings();
|
||||
method public boolean getFreezesText();
|
||||
method public int getGravity();
|
||||
method public int getHighlightColor();
|
||||
@@ -39675,6 +39682,7 @@ package android.widget {
|
||||
method public int getInputType();
|
||||
method public final android.text.method.KeyListener getKeyListener();
|
||||
method public final android.text.Layout getLayout();
|
||||
method public float getLetterSpacing();
|
||||
method public int getLineBounds(int, android.graphics.Rect);
|
||||
method public int getLineCount();
|
||||
method public int getLineHeight();
|
||||
@@ -39758,6 +39766,7 @@ package android.widget {
|
||||
method public void setError(java.lang.CharSequence, android.graphics.drawable.Drawable);
|
||||
method public void setExtractedText(android.view.inputmethod.ExtractedText);
|
||||
method public void setFilters(android.text.InputFilter[]);
|
||||
method public void setFontFeatureSettings(java.lang.String);
|
||||
method protected boolean setFrame(int, int, int, int);
|
||||
method public void setFreezesText(boolean);
|
||||
method public void setGravity(int);
|
||||
@@ -39774,6 +39783,7 @@ package android.widget {
|
||||
method public void setInputExtras(int) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
|
||||
method public void setInputType(int);
|
||||
method public void setKeyListener(android.text.method.KeyListener);
|
||||
method public void setLetterSpacing(float);
|
||||
method public void setLineSpacing(float, float);
|
||||
method public void setLines(int);
|
||||
method public final void setLinkTextColor(int);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.widget;
|
||||
|
||||
import android.R;
|
||||
import android.annotation.Nullable;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
@@ -222,6 +223,8 @@ import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
|
||||
* @attr ref android.R.styleable#TextView_imeActionId
|
||||
* @attr ref android.R.styleable#TextView_editorExtras
|
||||
* @attr ref android.R.styleable#TextView_elegantTextHeight
|
||||
* @attr ref android.R.styleable#TextView_letterSpacing
|
||||
* @attr ref android.R.styleable#TextView_fontFeatureSettings
|
||||
*/
|
||||
@RemoteView
|
||||
public class TextView extends View implements ViewTreeObserver.OnPreDrawListener {
|
||||
@@ -2702,7 +2705,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
*
|
||||
* @see #setLetterSpacing(float)
|
||||
* @see Paint#setLetterSpacing
|
||||
* @hide
|
||||
*/
|
||||
public float getLetterSpacing() {
|
||||
return mTextPaint.getLetterSpacing();
|
||||
@@ -2716,7 +2718,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
* @see Paint#getLetterSpacing
|
||||
*
|
||||
* @attr ref android.R.styleable#TextView_letterSpacing
|
||||
* @hide
|
||||
*/
|
||||
@android.view.RemotableViewMethod
|
||||
public void setLetterSpacing(float letterSpacing) {
|
||||
@@ -2736,8 +2737,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
*
|
||||
* @see #setFontFeatureSettings(String)
|
||||
* @see Paint#setFontFeatureSettings
|
||||
* @hide
|
||||
*/
|
||||
@Nullable
|
||||
public String getFontFeatureSettings() {
|
||||
return mTextPaint.getFontFeatureSettings();
|
||||
}
|
||||
@@ -2747,14 +2748,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
* font-feature-settings attribute:
|
||||
* http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings
|
||||
*
|
||||
* @param fontFeatureSettings font feature settings represented as CSS compatible string
|
||||
* @see #getFontFeatureSettings()
|
||||
* @see Paint#getFontFeatureSettings
|
||||
*
|
||||
* @attr ref android.R.styleable#TextView_fontFeatureSettings
|
||||
* @hide
|
||||
*/
|
||||
@android.view.RemotableViewMethod
|
||||
public void setFontFeatureSettings(String fontFeatureSettings) {
|
||||
public void setFontFeatureSettings(@Nullable String fontFeatureSettings) {
|
||||
if (fontFeatureSettings != mTextPaint.getFontFeatureSettings()) {
|
||||
mTextPaint.setFontFeatureSettings(fontFeatureSettings);
|
||||
|
||||
|
||||
@@ -2273,6 +2273,8 @@
|
||||
<public type="attr" name="datePickerMode"/>
|
||||
<public type="attr" name="timePickerMode"/>
|
||||
<public type="attr" name="inset" />
|
||||
<public type="attr" name="letterSpacing" />
|
||||
<public type="attr" name="fontFeatureSettings" />
|
||||
|
||||
<public-padding type="dimen" name="l_resource_pad" end="0x01050010" />
|
||||
|
||||
@@ -2564,4 +2566,5 @@
|
||||
<public type="raw" name="loaderror" id="0x01100000"/>
|
||||
<!-- WebView error page for when domain lookup fails. @hide @SystemApi -->
|
||||
<public type="raw" name="nodomain"/>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1267,7 +1267,6 @@ public class Paint {
|
||||
* is 0.
|
||||
*
|
||||
* @return the paint's letter-spacing for drawing text.
|
||||
* @hide
|
||||
*/
|
||||
public float getLetterSpacing() {
|
||||
return native_getLetterSpacing(mNativePaint);
|
||||
@@ -1279,7 +1278,6 @@ public class Paint {
|
||||
* expansion will be around 0.05. Negative values tighten text.
|
||||
*
|
||||
* @param letterSpacing set the paint's letter-spacing for drawing text.
|
||||
* @hide
|
||||
*/
|
||||
public void setLetterSpacing(float letterSpacing) {
|
||||
native_setLetterSpacing(mNativePaint, letterSpacing);
|
||||
@@ -1289,7 +1287,6 @@ public class Paint {
|
||||
* Get font feature settings. Default is null.
|
||||
*
|
||||
* @return the paint's currently set font feature settings.
|
||||
* @hide
|
||||
*/
|
||||
public String getFontFeatureSettings() {
|
||||
return mFontFeatureSettings;
|
||||
@@ -1302,7 +1299,6 @@ public class Paint {
|
||||
* http://dev.w3.org/csswg/css-fonts/#propdef-font-feature-settings
|
||||
*
|
||||
* @param settings the font feature settings string to use, may be null.
|
||||
* @hide
|
||||
*/
|
||||
public void setFontFeatureSettings(String settings) {
|
||||
if (settings != null && settings.equals("")) {
|
||||
|
||||
Reference in New Issue
Block a user