Loading core/java/android/app/assist/AssistStructure.java +41 −43 Original line number Original line Diff line number Diff line Loading @@ -18,7 +18,6 @@ import android.os.PooledStringReader; import android.os.PooledStringWriter; import android.os.PooledStringWriter; import android.os.RemoteException; import android.os.RemoteException; import android.os.SystemClock; import android.os.SystemClock; import android.service.autofill.FillContext; import android.service.autofill.FillRequest; import android.service.autofill.FillRequest; import android.text.TextUtils; import android.text.TextUtils; import android.util.Log; import android.util.Log; Loading @@ -31,7 +30,6 @@ import android.view.ViewStructure.HtmlInfo.Builder; import android.view.WindowManager; import android.view.WindowManager; import android.view.WindowManagerGlobal; import android.view.WindowManagerGlobal; import android.view.autofill.AutofillId; import android.view.autofill.AutofillId; import android.view.autofill.AutofillManager; import android.view.autofill.AutofillValue; import android.view.autofill.AutofillValue; import java.util.ArrayList; import java.util.ArrayList; Loading @@ -39,18 +37,18 @@ import java.util.Arrays; import java.util.List; import java.util.List; /** /** * Assist data automatically created by the platform's implementation of Assist and Autofill. * Assist data automatically created by the platform's implementation of assist and autofill. * * * <p>The structure is used for Assist purposes when created by * <p>The structure is used for assist purposes when created by * {@link android.app.Activity#onProvideAssistData}, {@link View#onProvideStructure(ViewStructure)}, * {@link android.app.Activity#onProvideAssistData}, {@link View#onProvideStructure(ViewStructure)}, * or {@link View#onProvideVirtualStructure(ViewStructure)}. * or {@link View#onProvideVirtualStructure(ViewStructure)}. * * * <p>The structure is used for Autofill purposes when created by * <p>The structure is used for autofill purposes when created by * {@link View#onProvideAutofillStructure(ViewStructure, int)}, * {@link View#onProvideAutofillStructure(ViewStructure, int)}, * or {@link View#onProvideAutofillVirtualStructure(ViewStructure, int)}. * or {@link View#onProvideAutofillVirtualStructure(ViewStructure, int)}. * * * <p>For performance reasons, some properties of the Assist data might be available just for Assist * <p>For performance reasons, some properties of the assist data might be available just for assist * or Autofill purposes; in those case, the property availability will be document in its javadoc. * or autofill purposes; in those case, the property availability will be document in its javadoc. */ */ public class AssistStructure implements Parcelable { public class AssistStructure implements Parcelable { static final String TAG = "AssistStructure"; static final String TAG = "AssistStructure"; Loading Loading @@ -958,10 +956,10 @@ public class AssistStructure implements Parcelable { /** /** * Gets the id that can be used to autofill the view contents. * Gets the id that can be used to autofill the view contents. * * * <p>It's relevant set when the {@link AssistStructure} is used for Autofill purposes. * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes. * * * @return id that can be used to autofill the view contents, or {@code null} if the * @return id that can be used to autofill the view contents, or {@code null} if the * structure was created for Assist purposes. * structure was created for assist purposes. */ */ @Nullable public AutofillId getAutofillId() { @Nullable public AutofillId getAutofillId() { return mAutofillId; return mAutofillId; Loading @@ -970,10 +968,10 @@ public class AssistStructure implements Parcelable { /** /** * Gets the the type of value that can be used to autofill the view contents. * Gets the the type of value that can be used to autofill the view contents. * * * <p>It's only relevant when the {@link AssistStructure} is used for Autofill purposes. * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes. * * * @return autofill type as defined by {@link View#getAutofillType()}, * @return autofill type as defined by {@link View#getAutofillType()}, * or {@link View#AUTOFILL_TYPE_NONE} if the structure was created for Assist purposes. * or {@link View#AUTOFILL_TYPE_NONE} if the structure was created for assist purposes. */ */ public @View.AutofillType int getAutofillType() { public @View.AutofillType int getAutofillType() { return mAutofillType; return mAutofillType; Loading @@ -983,11 +981,11 @@ public class AssistStructure implements Parcelable { * Describes the content of a view so that a autofill service can fill in the appropriate * Describes the content of a view so that a autofill service can fill in the appropriate * data. * data. * * * <p>It's only relevant when the {@link AssistStructure} is used for Autofill purposes, * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes, * not for Assist - see {@link View#getAutofillHints()} for more info. * not for Assist - see {@link View#getAutofillHints()} for more info. * * * @return The autofill hints for this view, or {@code null} if the structure was created * @return The autofill hints for this view, or {@code null} if the structure was created * for Assist purposes. * for assist purposes. */ */ @Nullable public String[] getAutofillHints() { @Nullable public String[] getAutofillHints() { return mAutofillHints; return mAutofillHints; Loading @@ -996,11 +994,11 @@ public class AssistStructure implements Parcelable { /** /** * Gets the the value of this view. * Gets the the value of this view. * * * <p>It's only relevant when the {@link AssistStructure} is used for Autofill purposes, * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes, * not for Assist purposes. * not for assist purposes. * * * @return the autofill value of this view, or {@code null} if the structure was created * @return the autofill value of this view, or {@code null} if the structure was created * for Assist purposes. * for assist purposes. */ */ @Nullable public AutofillValue getAutofillValue() { @Nullable public AutofillValue getAutofillValue() { return mAutofillValue; return mAutofillValue; Loading @@ -1017,11 +1015,11 @@ public class AssistStructure implements Parcelable { * <p>Typically used by nodes whose {@link View#getAutofillType()} is a list to indicate * <p>Typically used by nodes whose {@link View#getAutofillType()} is a list to indicate * the meaning of each possible value in the list. * the meaning of each possible value in the list. * * * <p>It's relevant when the {@link AssistStructure} is used for Autofill purposes, not * <p>It's relevant when the {@link AssistStructure} is used for autofill purposes, not * for Assist purposes. * for assist purposes. * * * @return the options that can be used to autofill this view, or {@code null} if the * @return the options that can be used to autofill this view, or {@code null} if the * structure was created for Assist purposes. * structure was created for assist purposes. */ */ @Nullable public CharSequence[] getAutofillOptions() { @Nullable public CharSequence[] getAutofillOptions() { return mAutofillOptions; return mAutofillOptions; Loading Loading @@ -1106,8 +1104,8 @@ public class AssistStructure implements Parcelable { * or scaling. The returned Matrix object is owned by ViewNode; do not modify it. * or scaling. The returned Matrix object is owned by ViewNode; do not modify it. * Returns null if there is no transformation applied to the view. * Returns null if there is no transformation applied to the view. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public Matrix getTransformation() { public Matrix getTransformation() { return mMatrix; return mMatrix; Loading @@ -1118,8 +1116,8 @@ public class AssistStructure implements Parcelable { * characterstics, as set by {@link ViewStructure#setElevation * characterstics, as set by {@link ViewStructure#setElevation * ViewStructure.setElevation(float)}. * ViewStructure.setElevation(float)}. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public float getElevation() { public float getElevation() { return mElevation; return mElevation; Loading @@ -1130,8 +1128,8 @@ public class AssistStructure implements Parcelable { * of the view's contents, as set by {@link ViewStructure#setAlpha * of the view's contents, as set by {@link ViewStructure#setAlpha * ViewStructure.setAlpha(float)}. * ViewStructure.setAlpha(float)}. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public float getAlpha() { public float getAlpha() { return mAlpha; return mAlpha; Loading Loading @@ -1260,7 +1258,7 @@ public class AssistStructure implements Parcelable { * document. * document. * * * <strong>WARNING:</strong> a {@link android.service.autofill.AutofillService} should only * <strong>WARNING:</strong> a {@link android.service.autofill.AutofillService} should only * use this domain for Autofill purposes when it trusts the app generating it (i.e., the app * use this domain for autofill purposes when it trusts the app generating it (i.e., the app * defined by {@link AssistStructure#getActivityComponent()}). * defined by {@link AssistStructure#getActivityComponent()}). * * * @return domain-only part of the document. For example, if the full URL is * @return domain-only part of the document. For example, if the full URL is Loading @@ -1273,11 +1271,11 @@ public class AssistStructure implements Parcelable { /** /** * Returns the HTML properties associated with this view. * Returns the HTML properties associated with this view. * * * <p>It's only relevant when the {@link AssistStructure} is used for Autofill purposes, * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes, * not for Assist purposes. * not for assist purposes. * * * @return the HTML properties associated with this view, or {@code null} if the * @return the HTML properties associated with this view, or {@code null} if the * structure was created for Assist purposes. * structure was created for assist purposes. */ */ @Nullable public HtmlInfo getHtmlInfo() { @Nullable public HtmlInfo getHtmlInfo() { return mHtmlInfo; return mHtmlInfo; Loading @@ -1301,8 +1299,8 @@ public class AssistStructure implements Parcelable { /** /** * If {@link #getText()} is non-null, this is where the current selection starts. * If {@link #getText()} is non-null, this is where the current selection starts. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int getTextSelectionStart() { public int getTextSelectionStart() { return mText != null ? mText.mTextSelectionStart : -1; return mText != null ? mText.mTextSelectionStart : -1; Loading @@ -1313,8 +1311,8 @@ public class AssistStructure implements Parcelable { * If there is no selection, returns the same value as {@link #getTextSelectionStart()}, * If there is no selection, returns the same value as {@link #getTextSelectionStart()}, * indicating the cursor position. * indicating the cursor position. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int getTextSelectionEnd() { public int getTextSelectionEnd() { return mText != null ? mText.mTextSelectionEnd : -1; return mText != null ? mText.mTextSelectionEnd : -1; Loading @@ -1337,8 +1335,8 @@ public class AssistStructure implements Parcelable { * Note that the text may also contain style spans that modify the color of specific * Note that the text may also contain style spans that modify the color of specific * parts of the text. * parts of the text. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int getTextBackgroundColor() { public int getTextBackgroundColor() { return mText != null ? mText.mTextBackgroundColor : TEXT_COLOR_UNDEFINED; return mText != null ? mText.mTextBackgroundColor : TEXT_COLOR_UNDEFINED; Loading @@ -1350,8 +1348,8 @@ public class AssistStructure implements Parcelable { * Note that the text may also contain style spans that modify the size of specific * Note that the text may also contain style spans that modify the size of specific * parts of the text. * parts of the text. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public float getTextSize() { public float getTextSize() { return mText != null ? mText.mTextSize : 0; return mText != null ? mText.mTextSize : 0; Loading @@ -1365,8 +1363,8 @@ public class AssistStructure implements Parcelable { * Note that the text may also contain style spans that modify the style of specific * Note that the text may also contain style spans that modify the style of specific * parts of the text. * parts of the text. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int getTextStyle() { public int getTextStyle() { return mText != null ? mText.mTextStyle : 0; return mText != null ? mText.mTextStyle : 0; Loading @@ -1378,8 +1376,8 @@ public class AssistStructure implements Parcelable { * into the text string where that line starts. May return null if there is no line * into the text string where that line starts. May return null if there is no line * information. * information. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int[] getTextLineCharOffsets() { public int[] getTextLineCharOffsets() { return mText != null ? mText.mLineCharOffsets : null; return mText != null ? mText.mLineCharOffsets : null; Loading @@ -1391,8 +1389,8 @@ public class AssistStructure implements Parcelable { * where that text appears in the view. May return null if there is no line * where that text appears in the view. May return null if there is no line * information. * information. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int[] getTextLineBaselines() { public int[] getTextLineBaselines() { return mText != null ? mText.mLineBaselines : null; return mText != null ? mText.mLineBaselines : null; Loading core/java/android/view/View.java +261 −109 File changed.Preview size limit exceeded, changes collapsed. Show changes core/java/android/view/ViewStructure.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -269,6 +269,9 @@ public abstract class ViewStructure { * Create a new child {@link ViewStructure} in this view, putting into the list of * Create a new child {@link ViewStructure} in this view, putting into the list of * children at <var>index</var>. * children at <var>index</var>. * * * <p><b>NOTE: </b>you must pre-allocate space for the child first, by calling either * {@link #addChildCount(int)} or {@link #setChildCount(int)}. * * @return Returns an fresh {@link ViewStructure} ready to be filled in. * @return Returns an fresh {@link ViewStructure} ready to be filled in. */ */ public abstract ViewStructure newChild(int index); public abstract ViewStructure newChild(int index); Loading @@ -279,6 +282,10 @@ public abstract class ViewStructure { * to build its content (and children etc). Once done, some thread must call * to build its content (and children etc). Once done, some thread must call * {@link #asyncCommit} to tell the containing {@link ViewStructure} that the async * {@link #asyncCommit} to tell the containing {@link ViewStructure} that the async * population is done. * population is done. * * <p><b>NOTE: </b>you must pre-allocate space for the child first, by calling either * {@link #addChildCount(int)} or {@link #setChildCount(int)}. * * @return Returns an fresh {@link ViewStructure} ready to be filled in. * @return Returns an fresh {@link ViewStructure} ready to be filled in. */ */ public abstract ViewStructure asyncNewChild(int index); public abstract ViewStructure asyncNewChild(int index); Loading Loading
core/java/android/app/assist/AssistStructure.java +41 −43 Original line number Original line Diff line number Diff line Loading @@ -18,7 +18,6 @@ import android.os.PooledStringReader; import android.os.PooledStringWriter; import android.os.PooledStringWriter; import android.os.RemoteException; import android.os.RemoteException; import android.os.SystemClock; import android.os.SystemClock; import android.service.autofill.FillContext; import android.service.autofill.FillRequest; import android.service.autofill.FillRequest; import android.text.TextUtils; import android.text.TextUtils; import android.util.Log; import android.util.Log; Loading @@ -31,7 +30,6 @@ import android.view.ViewStructure.HtmlInfo.Builder; import android.view.WindowManager; import android.view.WindowManager; import android.view.WindowManagerGlobal; import android.view.WindowManagerGlobal; import android.view.autofill.AutofillId; import android.view.autofill.AutofillId; import android.view.autofill.AutofillManager; import android.view.autofill.AutofillValue; import android.view.autofill.AutofillValue; import java.util.ArrayList; import java.util.ArrayList; Loading @@ -39,18 +37,18 @@ import java.util.Arrays; import java.util.List; import java.util.List; /** /** * Assist data automatically created by the platform's implementation of Assist and Autofill. * Assist data automatically created by the platform's implementation of assist and autofill. * * * <p>The structure is used for Assist purposes when created by * <p>The structure is used for assist purposes when created by * {@link android.app.Activity#onProvideAssistData}, {@link View#onProvideStructure(ViewStructure)}, * {@link android.app.Activity#onProvideAssistData}, {@link View#onProvideStructure(ViewStructure)}, * or {@link View#onProvideVirtualStructure(ViewStructure)}. * or {@link View#onProvideVirtualStructure(ViewStructure)}. * * * <p>The structure is used for Autofill purposes when created by * <p>The structure is used for autofill purposes when created by * {@link View#onProvideAutofillStructure(ViewStructure, int)}, * {@link View#onProvideAutofillStructure(ViewStructure, int)}, * or {@link View#onProvideAutofillVirtualStructure(ViewStructure, int)}. * or {@link View#onProvideAutofillVirtualStructure(ViewStructure, int)}. * * * <p>For performance reasons, some properties of the Assist data might be available just for Assist * <p>For performance reasons, some properties of the assist data might be available just for assist * or Autofill purposes; in those case, the property availability will be document in its javadoc. * or autofill purposes; in those case, the property availability will be document in its javadoc. */ */ public class AssistStructure implements Parcelable { public class AssistStructure implements Parcelable { static final String TAG = "AssistStructure"; static final String TAG = "AssistStructure"; Loading Loading @@ -958,10 +956,10 @@ public class AssistStructure implements Parcelable { /** /** * Gets the id that can be used to autofill the view contents. * Gets the id that can be used to autofill the view contents. * * * <p>It's relevant set when the {@link AssistStructure} is used for Autofill purposes. * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes. * * * @return id that can be used to autofill the view contents, or {@code null} if the * @return id that can be used to autofill the view contents, or {@code null} if the * structure was created for Assist purposes. * structure was created for assist purposes. */ */ @Nullable public AutofillId getAutofillId() { @Nullable public AutofillId getAutofillId() { return mAutofillId; return mAutofillId; Loading @@ -970,10 +968,10 @@ public class AssistStructure implements Parcelable { /** /** * Gets the the type of value that can be used to autofill the view contents. * Gets the the type of value that can be used to autofill the view contents. * * * <p>It's only relevant when the {@link AssistStructure} is used for Autofill purposes. * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes. * * * @return autofill type as defined by {@link View#getAutofillType()}, * @return autofill type as defined by {@link View#getAutofillType()}, * or {@link View#AUTOFILL_TYPE_NONE} if the structure was created for Assist purposes. * or {@link View#AUTOFILL_TYPE_NONE} if the structure was created for assist purposes. */ */ public @View.AutofillType int getAutofillType() { public @View.AutofillType int getAutofillType() { return mAutofillType; return mAutofillType; Loading @@ -983,11 +981,11 @@ public class AssistStructure implements Parcelable { * Describes the content of a view so that a autofill service can fill in the appropriate * Describes the content of a view so that a autofill service can fill in the appropriate * data. * data. * * * <p>It's only relevant when the {@link AssistStructure} is used for Autofill purposes, * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes, * not for Assist - see {@link View#getAutofillHints()} for more info. * not for Assist - see {@link View#getAutofillHints()} for more info. * * * @return The autofill hints for this view, or {@code null} if the structure was created * @return The autofill hints for this view, or {@code null} if the structure was created * for Assist purposes. * for assist purposes. */ */ @Nullable public String[] getAutofillHints() { @Nullable public String[] getAutofillHints() { return mAutofillHints; return mAutofillHints; Loading @@ -996,11 +994,11 @@ public class AssistStructure implements Parcelable { /** /** * Gets the the value of this view. * Gets the the value of this view. * * * <p>It's only relevant when the {@link AssistStructure} is used for Autofill purposes, * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes, * not for Assist purposes. * not for assist purposes. * * * @return the autofill value of this view, or {@code null} if the structure was created * @return the autofill value of this view, or {@code null} if the structure was created * for Assist purposes. * for assist purposes. */ */ @Nullable public AutofillValue getAutofillValue() { @Nullable public AutofillValue getAutofillValue() { return mAutofillValue; return mAutofillValue; Loading @@ -1017,11 +1015,11 @@ public class AssistStructure implements Parcelable { * <p>Typically used by nodes whose {@link View#getAutofillType()} is a list to indicate * <p>Typically used by nodes whose {@link View#getAutofillType()} is a list to indicate * the meaning of each possible value in the list. * the meaning of each possible value in the list. * * * <p>It's relevant when the {@link AssistStructure} is used for Autofill purposes, not * <p>It's relevant when the {@link AssistStructure} is used for autofill purposes, not * for Assist purposes. * for assist purposes. * * * @return the options that can be used to autofill this view, or {@code null} if the * @return the options that can be used to autofill this view, or {@code null} if the * structure was created for Assist purposes. * structure was created for assist purposes. */ */ @Nullable public CharSequence[] getAutofillOptions() { @Nullable public CharSequence[] getAutofillOptions() { return mAutofillOptions; return mAutofillOptions; Loading Loading @@ -1106,8 +1104,8 @@ public class AssistStructure implements Parcelable { * or scaling. The returned Matrix object is owned by ViewNode; do not modify it. * or scaling. The returned Matrix object is owned by ViewNode; do not modify it. * Returns null if there is no transformation applied to the view. * Returns null if there is no transformation applied to the view. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public Matrix getTransformation() { public Matrix getTransformation() { return mMatrix; return mMatrix; Loading @@ -1118,8 +1116,8 @@ public class AssistStructure implements Parcelable { * characterstics, as set by {@link ViewStructure#setElevation * characterstics, as set by {@link ViewStructure#setElevation * ViewStructure.setElevation(float)}. * ViewStructure.setElevation(float)}. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public float getElevation() { public float getElevation() { return mElevation; return mElevation; Loading @@ -1130,8 +1128,8 @@ public class AssistStructure implements Parcelable { * of the view's contents, as set by {@link ViewStructure#setAlpha * of the view's contents, as set by {@link ViewStructure#setAlpha * ViewStructure.setAlpha(float)}. * ViewStructure.setAlpha(float)}. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public float getAlpha() { public float getAlpha() { return mAlpha; return mAlpha; Loading Loading @@ -1260,7 +1258,7 @@ public class AssistStructure implements Parcelable { * document. * document. * * * <strong>WARNING:</strong> a {@link android.service.autofill.AutofillService} should only * <strong>WARNING:</strong> a {@link android.service.autofill.AutofillService} should only * use this domain for Autofill purposes when it trusts the app generating it (i.e., the app * use this domain for autofill purposes when it trusts the app generating it (i.e., the app * defined by {@link AssistStructure#getActivityComponent()}). * defined by {@link AssistStructure#getActivityComponent()}). * * * @return domain-only part of the document. For example, if the full URL is * @return domain-only part of the document. For example, if the full URL is Loading @@ -1273,11 +1271,11 @@ public class AssistStructure implements Parcelable { /** /** * Returns the HTML properties associated with this view. * Returns the HTML properties associated with this view. * * * <p>It's only relevant when the {@link AssistStructure} is used for Autofill purposes, * <p>It's only relevant when the {@link AssistStructure} is used for autofill purposes, * not for Assist purposes. * not for assist purposes. * * * @return the HTML properties associated with this view, or {@code null} if the * @return the HTML properties associated with this view, or {@code null} if the * structure was created for Assist purposes. * structure was created for assist purposes. */ */ @Nullable public HtmlInfo getHtmlInfo() { @Nullable public HtmlInfo getHtmlInfo() { return mHtmlInfo; return mHtmlInfo; Loading @@ -1301,8 +1299,8 @@ public class AssistStructure implements Parcelable { /** /** * If {@link #getText()} is non-null, this is where the current selection starts. * If {@link #getText()} is non-null, this is where the current selection starts. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int getTextSelectionStart() { public int getTextSelectionStart() { return mText != null ? mText.mTextSelectionStart : -1; return mText != null ? mText.mTextSelectionStart : -1; Loading @@ -1313,8 +1311,8 @@ public class AssistStructure implements Parcelable { * If there is no selection, returns the same value as {@link #getTextSelectionStart()}, * If there is no selection, returns the same value as {@link #getTextSelectionStart()}, * indicating the cursor position. * indicating the cursor position. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int getTextSelectionEnd() { public int getTextSelectionEnd() { return mText != null ? mText.mTextSelectionEnd : -1; return mText != null ? mText.mTextSelectionEnd : -1; Loading @@ -1337,8 +1335,8 @@ public class AssistStructure implements Parcelable { * Note that the text may also contain style spans that modify the color of specific * Note that the text may also contain style spans that modify the color of specific * parts of the text. * parts of the text. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int getTextBackgroundColor() { public int getTextBackgroundColor() { return mText != null ? mText.mTextBackgroundColor : TEXT_COLOR_UNDEFINED; return mText != null ? mText.mTextBackgroundColor : TEXT_COLOR_UNDEFINED; Loading @@ -1350,8 +1348,8 @@ public class AssistStructure implements Parcelable { * Note that the text may also contain style spans that modify the size of specific * Note that the text may also contain style spans that modify the size of specific * parts of the text. * parts of the text. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public float getTextSize() { public float getTextSize() { return mText != null ? mText.mTextSize : 0; return mText != null ? mText.mTextSize : 0; Loading @@ -1365,8 +1363,8 @@ public class AssistStructure implements Parcelable { * Note that the text may also contain style spans that modify the style of specific * Note that the text may also contain style spans that modify the style of specific * parts of the text. * parts of the text. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int getTextStyle() { public int getTextStyle() { return mText != null ? mText.mTextStyle : 0; return mText != null ? mText.mTextStyle : 0; Loading @@ -1378,8 +1376,8 @@ public class AssistStructure implements Parcelable { * into the text string where that line starts. May return null if there is no line * into the text string where that line starts. May return null if there is no line * information. * information. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int[] getTextLineCharOffsets() { public int[] getTextLineCharOffsets() { return mText != null ? mText.mLineCharOffsets : null; return mText != null ? mText.mLineCharOffsets : null; Loading @@ -1391,8 +1389,8 @@ public class AssistStructure implements Parcelable { * where that text appears in the view. May return null if there is no line * where that text appears in the view. May return null if there is no line * information. * information. * * * <p>It's only relevant when the {@link AssistStructure} is used for Assist purposes, * <p>It's only relevant when the {@link AssistStructure} is used for assist purposes, * not for Autofill purposes. * not for autofill purposes. */ */ public int[] getTextLineBaselines() { public int[] getTextLineBaselines() { return mText != null ? mText.mLineBaselines : null; return mText != null ? mText.mLineBaselines : null; Loading
core/java/android/view/View.java +261 −109 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/java/android/view/ViewStructure.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -269,6 +269,9 @@ public abstract class ViewStructure { * Create a new child {@link ViewStructure} in this view, putting into the list of * Create a new child {@link ViewStructure} in this view, putting into the list of * children at <var>index</var>. * children at <var>index</var>. * * * <p><b>NOTE: </b>you must pre-allocate space for the child first, by calling either * {@link #addChildCount(int)} or {@link #setChildCount(int)}. * * @return Returns an fresh {@link ViewStructure} ready to be filled in. * @return Returns an fresh {@link ViewStructure} ready to be filled in. */ */ public abstract ViewStructure newChild(int index); public abstract ViewStructure newChild(int index); Loading @@ -279,6 +282,10 @@ public abstract class ViewStructure { * to build its content (and children etc). Once done, some thread must call * to build its content (and children etc). Once done, some thread must call * {@link #asyncCommit} to tell the containing {@link ViewStructure} that the async * {@link #asyncCommit} to tell the containing {@link ViewStructure} that the async * population is done. * population is done. * * <p><b>NOTE: </b>you must pre-allocate space for the child first, by calling either * {@link #addChildCount(int)} or {@link #setChildCount(int)}. * * @return Returns an fresh {@link ViewStructure} ready to be filled in. * @return Returns an fresh {@link ViewStructure} ready to be filled in. */ */ public abstract ViewStructure asyncNewChild(int index); public abstract ViewStructure asyncNewChild(int index); Loading