@InspectableProperty coverage for android.widget
A few getters for view properties have been added where they were
missing. CTS tests for the new APIs are pending in b/123894719.
Test: m framework
Bug: 120492712
Change-Id: I743ce693d384eaf749ced3db7f81bda7d19ed275
diff --git a/api/current.txt b/api/current.txt
index abe215f..7b89b61 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -54718,6 +54718,7 @@
method public int getCheckedItemPosition();
method public android.util.SparseBooleanArray getCheckedItemPositions();
method public int getChoiceMode();
+ method public boolean getDrawSelectorOnTop();
method public int getListPaddingBottom();
method public int getListPaddingLeft();
method public int getListPaddingRight();
@@ -56332,6 +56333,7 @@
ctor public RelativeLayout(android.content.Context, android.util.AttributeSet, int, int);
method public android.widget.RelativeLayout.LayoutParams generateLayoutParams(android.util.AttributeSet);
method public int getGravity();
+ method public int getIgnoreGravity();
method public void setGravity(int);
method public void setHorizontalGravity(int);
method public void setIgnoreGravity(int);
@@ -56548,8 +56550,9 @@
method public CharSequence getQuery();
method @Nullable public CharSequence getQueryHint();
method public android.widget.CursorAdapter getSuggestionsAdapter();
- method public boolean isIconfiedByDefault();
+ method @Deprecated public boolean isIconfiedByDefault();
method public boolean isIconified();
+ method public boolean isIconifiedByDefault();
method public boolean isQueryRefinementEnabled();
method public boolean isSubmitButtonEnabled();
method public void onActionViewCollapsed();
@@ -57272,6 +57275,7 @@
ctor public ToggleButton(android.content.Context, android.util.AttributeSet, int);
ctor public ToggleButton(android.content.Context, android.util.AttributeSet);
ctor public ToggleButton(android.content.Context);
+ method public float getDisabledAlpha();
method public CharSequence getTextOff();
method public CharSequence getTextOn();
method public void setBackgroundDrawable(android.graphics.drawable.Drawable);
@@ -57432,6 +57436,7 @@
@android.widget.RemoteViews.RemoteView public class ViewFlipper extends android.widget.ViewAnimator {
ctor public ViewFlipper(android.content.Context);
ctor public ViewFlipper(android.content.Context, android.util.AttributeSet);
+ method public int getFlipInterval();
method public boolean isAutoStart();
method public boolean isFlipping();
method public void setAutoStart(boolean);
diff --git a/api/test-current.txt b/api/test-current.txt
index e32b71b..ac55ac7a2 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -2527,7 +2527,7 @@
}
public class DatePicker extends android.widget.FrameLayout {
- method public int getMode();
+ method @android.view.inspector.InspectableProperty(name="datePickerMode", enumMapping={@android.view.inspector.InspectableProperty.EnumMap(value=android.widget.DatePicker.MODE_SPINNER, name="spinner"), @android.view.inspector.InspectableProperty.EnumMap(value=android.widget.DatePicker.MODE_CALENDAR, name="calendar")}) public int getMode();
field public static final int MODE_CALENDAR = 2; // 0x2
field public static final int MODE_SPINNER = 1; // 0x1
}
@@ -2563,7 +2563,7 @@
method public android.view.View getAmView();
method public android.view.View getHourView();
method public android.view.View getMinuteView();
- method public int getMode();
+ method @android.view.inspector.InspectableProperty(name="timePickerMode", enumMapping={@android.view.inspector.InspectableProperty.EnumMap(name="clock", value=android.widget.TimePicker.MODE_CLOCK), @android.view.inspector.InspectableProperty.EnumMap(name="spinner", value=android.widget.TimePicker.MODE_SPINNER)}) public int getMode();
method public android.view.View getPmView();
field public static final int MODE_CLOCK = 2; // 0x2
field public static final int MODE_SPINNER = 1; // 0x1
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a17a188..74ae01b 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -21615,6 +21615,7 @@
* @return The known solid color background for this view, or 0 if the color may vary
*/
@ViewDebug.ExportedProperty(category = "drawing")
+ @InspectableProperty
@ColorInt
public int getSolidColor() {
return 0;
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 0986cfa..7cc6348 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -60,6 +60,8 @@
import android.view.animation.LayoutAnimationController;
import android.view.animation.Transformation;
import android.view.autofill.Helper;
+import android.view.inspector.InspectableProperty;
+import android.view.inspector.InspectableProperty.EnumMap;
import com.android.internal.R;
@@ -773,6 +775,11 @@
@ViewDebug.IntToString(from = FOCUS_AFTER_DESCENDANTS, to = "FOCUS_AFTER_DESCENDANTS"),
@ViewDebug.IntToString(from = FOCUS_BLOCK_DESCENDANTS, to = "FOCUS_BLOCK_DESCENDANTS")
})
+ @InspectableProperty(enumMapping = {
+ @EnumMap(value = FOCUS_BEFORE_DESCENDANTS, name = "beforeDescendants"),
+ @EnumMap(value = FOCUS_AFTER_DESCENDANTS, name = "afterDescendants"),
+ @EnumMap(value = FOCUS_BLOCK_DESCENDANTS, name = "blocksDescendants")
+ })
public int getDescendantFocusability() {
return mGroupFlags & FLAG_MASK_FOCUSABILITY;
}
@@ -1391,6 +1398,7 @@
* Check whether this ViewGroup should ignore focus requests for itself and its children.
*/
@ViewDebug.ExportedProperty(category = "focus")
+ @InspectableProperty
public boolean getTouchscreenBlocksFocus() {
return (mGroupFlags & FLAG_TOUCHSCREEN_BLOCKS_FOCUS) != 0;
}
@@ -3116,6 +3124,7 @@
* Returns true if MotionEvents dispatched to this ViewGroup can be split to multiple children.
* @return true if MotionEvents dispatched to this ViewGroup can be split to multiple children.
*/
+ @InspectableProperty(name = "splitMotionEvents")
public boolean isMotionEventSplittingEnabled() {
return (mGroupFlags & FLAG_SPLIT_MOTION_EVENTS) == FLAG_SPLIT_MOTION_EVENTS;
}
@@ -3132,6 +3141,7 @@
* {@link android.view.ViewOutlineProvider#BACKGROUND} was given to
* {@link #setOutlineProvider(ViewOutlineProvider)} and false otherwise.
*/
+ @InspectableProperty
public boolean isTransitionGroup() {
if ((mGroupFlags & FLAG_IS_TRANSITION_GROUP_SET) != 0) {
return ((mGroupFlags & FLAG_IS_TRANSITION_GROUP) != 0);
@@ -4390,6 +4400,7 @@
* false otherwise.
*/
@ViewDebug.ExportedProperty(category = "drawing")
+ @InspectableProperty
public boolean getClipChildren() {
return ((mGroupFlags & FLAG_CLIP_CHILDREN) != 0);
}
@@ -4447,6 +4458,7 @@
* @attr ref android.R.styleable#ViewGroup_clipToPadding
*/
@ViewDebug.ExportedProperty(category = "drawing")
+ @InspectableProperty
public boolean getClipToPadding() {
return hasBooleanFlag(FLAG_CLIP_TO_PADDING);
}
@@ -6294,6 +6306,7 @@
*
* @return the current animation controller
*/
+ @InspectableProperty
public LayoutAnimationController getLayoutAnimation() {
return mLayoutAnimationController;
}
@@ -6313,6 +6326,7 @@
* Caching behavior of children may be controlled through {@link View#setLayerType(int, Paint)}.
*/
@Deprecated
+ @InspectableProperty(name = "animationCache")
public boolean isAnimationCacheEnabled() {
return (mGroupFlags & FLAG_ANIMATION_CACHE) == FLAG_ANIMATION_CACHE;
}
@@ -6350,6 +6364,7 @@
* Child views may no longer have their caching behavior disabled by parents.
*/
@Deprecated
+ @InspectableProperty(name = "alwaysDrawnWithCache")
public boolean isAlwaysDrawnWithCacheEnabled() {
return (mGroupFlags & FLAG_ALWAYS_DRAWN_WITH_CACHE) == FLAG_ALWAYS_DRAWN_WITH_CACHE;
}
@@ -6493,6 +6508,12 @@
@ViewDebug.IntToString(from = PERSISTENT_SCROLLING_CACHE, to = "SCROLLING"),
@ViewDebug.IntToString(from = PERSISTENT_ALL_CACHES, to = "ALL")
})
+ @InspectableProperty(enumMapping = {
+ @EnumMap(value = PERSISTENT_NO_CACHE, name = "none"),
+ @EnumMap(value = PERSISTENT_ANIMATION_CACHE, name = "animation"),
+ @EnumMap(value = PERSISTENT_SCROLLING_CACHE, name = "scrolling"),
+ @EnumMap(value = PERSISTENT_ALL_CACHES, name = "all"),
+ })
public int getPersistentDrawingCache() {
return mPersistentDrawingCache;
}
@@ -6570,6 +6591,10 @@
*
* @see #setLayoutMode(int)
*/
+ @InspectableProperty(enumMapping = {
+ @EnumMap(value = LAYOUT_MODE_CLIP_BOUNDS, name = "clipBounds"),
+ @EnumMap(value = LAYOUT_MODE_OPTICAL_BOUNDS, name = "opticalBounds")
+ })
public int getLayoutMode() {
if (mLayoutMode == LAYOUT_MODE_UNDEFINED) {
int inheritedLayoutMode = (mParent instanceof ViewGroup) ?
@@ -7261,6 +7286,7 @@
* make a group appear to be focused when its child EditText or button
* is focused.
*/
+ @InspectableProperty
public boolean addStatesFromChildren() {
return (mGroupFlags & FLAG_ADD_STATES_FROM_CHILDREN) != 0;
}
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 99895bd..4dd7d3a 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -82,6 +82,8 @@
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputContentInfo;
import android.view.inputmethod.InputMethodManager;
+import android.view.inspector.InspectableProperty;
+import android.view.inspector.InspectableProperty.EnumMap;
import android.widget.RemoteViews.OnClickHandler;
import com.android.internal.R;
@@ -1221,6 +1223,12 @@
*
* @return The current choice mode
*/
+ @InspectableProperty(enumMapping = {
+ @EnumMap(value = CHOICE_MODE_NONE, name = "none"),
+ @EnumMap(value = CHOICE_MODE_SINGLE, name = "singleChoice"),
+ @EnumMap(value = CHOICE_MODE_MULTIPLE, name = "multipleChoice"),
+ @EnumMap(value = CHOICE_MODE_MULTIPLE_MODAL, name = "multipleChoiceModal")
+ })
public int getChoiceMode() {
return mChoiceMode;
}
@@ -1421,6 +1429,7 @@
* @return true if fast scroll is enabled, false otherwise
*/
@ViewDebug.ExportedProperty
+ @InspectableProperty
public boolean isFastScrollEnabled() {
if (mFastScroll == null) {
return mFastScrollEnabled;
@@ -1485,6 +1494,7 @@
* @see #setSmoothScrollbarEnabled(boolean)
*/
@ViewDebug.ExportedProperty
+ @InspectableProperty(name = "smoothScrollbar")
public boolean isSmoothScrollbarEnabled() {
return mSmoothScrollbarEnabled;
}
@@ -1620,6 +1630,7 @@
* @see View#setDrawingCacheEnabled(boolean)
*/
@ViewDebug.ExportedProperty
+ @InspectableProperty(name = "scrollingCache")
public boolean isScrollingCacheEnabled() {
return mScrollingCacheEnabled;
}
@@ -1667,6 +1678,7 @@
* @see Filterable
*/
@ViewDebug.ExportedProperty
+ @InspectableProperty
public boolean isTextFilterEnabled() {
return mTextFilterEnabled;
}
@@ -1697,6 +1709,7 @@
* @return true if the content is stacked from the bottom edge, false otherwise
*/
@ViewDebug.ExportedProperty
+ @InspectableProperty
public boolean isStackFromBottom() {
return mStackFromBottom;
}
@@ -2813,6 +2826,18 @@
}
/**
+ * Returns whether the selection highlight drawable should be drawn on top of the item or
+ * behind it.
+ *
+ * @return true if selector is drawn on top, false otherwise
+ * @attr ref android.R.styleable#AbsListView_drawSelectorOnTop
+ */
+ @InspectableProperty
+ public boolean getDrawSelectorOnTop() {
+ return mDrawSelectorOnTop;
+ }
+
+ /**
* Set a Drawable that should be used to highlight the currently selected item.
*
* @param resID A Drawable resource to use as the selection highlight.
@@ -2845,6 +2870,7 @@
*
* @return the drawable used to display the selector
*/
+ @InspectableProperty(name = "listSelector")
public Drawable getSelector() {
return mSelector;
}
@@ -6272,6 +6298,11 @@
* @return {@link #TRANSCRIPT_MODE_DISABLED}, {@link #TRANSCRIPT_MODE_NORMAL} or
* {@link #TRANSCRIPT_MODE_ALWAYS_SCROLL}
*/
+ @InspectableProperty(enumMapping = {
+ @EnumMap(value = TRANSCRIPT_MODE_DISABLED, name = "disabled"),
+ @EnumMap(value = TRANSCRIPT_MODE_NORMAL, name = "normal"),
+ @EnumMap(value = TRANSCRIPT_MODE_ALWAYS_SCROLL, name = "alwaysScroll")
+ })
public int getTranscriptMode() {
return mTranscriptMode;
}
@@ -6309,6 +6340,7 @@
* @return The cache color hint
*/
@ViewDebug.ExportedProperty(category = "drawing")
+ @InspectableProperty
@ColorInt
public int getCacheColorHint() {
return mCacheColorHint;
diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java
index a85c585..c8be1d6 100644
--- a/core/java/android/widget/AbsSeekBar.java
+++ b/core/java/android/widget/AbsSeekBar.java
@@ -34,6 +34,7 @@
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -252,6 +253,7 @@
* @attr ref android.R.styleable#SeekBar_thumbTint
* @see #setThumbTintList(ColorStateList)
*/
+ @InspectableProperty(name = "thumbTint")
@Nullable
public ColorStateList getThumbTintList() {
return mThumbTintList;
@@ -284,6 +286,7 @@
* @attr ref android.R.styleable#SeekBar_thumbTintMode
* @see #setThumbTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getThumbTintMode() {
return mThumbTintMode;
@@ -406,6 +409,7 @@
* @attr ref android.R.styleable#SeekBar_tickMarkTint
* @see #setTickMarkTintList(ColorStateList)
*/
+ @InspectableProperty(name = "tickMarkTint")
@Nullable
public ColorStateList getTickMarkTintList() {
return mTickMarkTintList;
@@ -438,6 +442,7 @@
* @attr ref android.R.styleable#SeekBar_tickMarkTintMode
* @see #setTickMarkTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getTickMarkTintMode() {
return mTickMarkTintMode;
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 7d6564f..9bc055e 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -35,12 +35,12 @@
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.view.inputmethod.CompletionInfo;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -362,27 +362,33 @@
*
* @attr ref android.R.styleable#AutoCompleteTextView_completionHint
*/
+ @InspectableProperty
public CharSequence getCompletionHint() {
return mHintText;
}
/**
- * <p>Returns the current width for the auto-complete drop down list. This can
- * be a fixed width, or {@link ViewGroup.LayoutParams#MATCH_PARENT} to fill the screen, or
- * {@link ViewGroup.LayoutParams#WRAP_CONTENT} to fit the width of its anchor view.</p>
+ * Returns the current width for the auto-complete drop down list.
+ *
+ * This can be a fixed width, or {@link android.view.ViewGroup.LayoutParams#MATCH_PARENT}
+ * to fill the screen, or {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}
+ * to fit the width of its anchor view.
*
* @return the width for the drop down list
*
* @attr ref android.R.styleable#AutoCompleteTextView_dropDownWidth
*/
+ @InspectableProperty
public int getDropDownWidth() {
return mPopup.getWidth();
}
/**
- * <p>Sets the current width for the auto-complete drop down list. This can
- * be a fixed width, or {@link ViewGroup.LayoutParams#MATCH_PARENT} to fill the screen, or
- * {@link ViewGroup.LayoutParams#WRAP_CONTENT} to fit the width of its anchor view.</p>
+ * Sets the current width for the auto-complete drop down list.
+ *
+ * This can be a fixed width, or {@link android.view.ViewGroup.LayoutParams#MATCH_PARENT}
+ * to fill the screen, or {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}
+ * to fit the width of its anchor view.
*
* @param width the width to use
*
@@ -393,24 +399,27 @@
}
/**
- * <p>Returns the current height for the auto-complete drop down list. This can
- * be a fixed height, or {@link ViewGroup.LayoutParams#MATCH_PARENT} to fill
- * the screen, or {@link ViewGroup.LayoutParams#WRAP_CONTENT} to fit the height
- * of the drop down's content.</p>
+ * <p>Returns the current height for the auto-complete drop down list.
+ *
+ * This can be a fixed width, or {@link android.view.ViewGroup.LayoutParams#MATCH_PARENT}
+ * to fill the screen, or {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}
+ * to fit the width of its anchor view.
*
* @return the height for the drop down list
*
* @attr ref android.R.styleable#AutoCompleteTextView_dropDownHeight
*/
+ @InspectableProperty
public int getDropDownHeight() {
return mPopup.getHeight();
}
/**
- * <p>Sets the current height for the auto-complete drop down list. This can
- * be a fixed height, or {@link ViewGroup.LayoutParams#MATCH_PARENT} to fill
- * the screen, or {@link ViewGroup.LayoutParams#WRAP_CONTENT} to fit the height
- * of the drop down's content.</p>
+ * Sets the current height for the auto-complete drop down list.
+ *
+ * This can be a fixed width, or {@link android.view.ViewGroup.LayoutParams#MATCH_PARENT}
+ * to fill the screen, or {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}
+ * to fit the width of its anchor view.
*
* @param height the height to use
*
@@ -452,6 +461,7 @@
*
* @attr ref android.R.styleable#PopupWindow_popupBackground
*/
+ @InspectableProperty(name = "popupBackground")
public Drawable getDropDownBackground() {
return mPopup.getBackground();
}
@@ -496,6 +506,7 @@
*
* @attr ref android.R.styleable#ListPopupWindow_dropDownVerticalOffset
*/
+ @InspectableProperty
public int getDropDownVerticalOffset() {
return mPopup.getVerticalOffset();
}
@@ -518,6 +529,7 @@
*
* @attr ref android.R.styleable#ListPopupWindow_dropDownHorizontalOffset
*/
+ @InspectableProperty
public int getDropDownHorizontalOffset() {
return mPopup.getHorizontalOffset();
}
@@ -610,6 +622,7 @@
*
* @attr ref android.R.styleable#AutoCompleteTextView_completionThreshold
*/
+ @InspectableProperty(name = "completionThreshold")
public int getThreshold() {
return mThreshold;
}
diff --git a/core/java/android/widget/CalendarView.java b/core/java/android/widget/CalendarView.java
index 2ff815d..6c74c8c 100644
--- a/core/java/android/widget/CalendarView.java
+++ b/core/java/android/widget/CalendarView.java
@@ -34,6 +34,7 @@
import android.icu.util.TimeZone;
import android.util.AttributeSet;
import android.util.Log;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -149,6 +150,7 @@
* @attr ref android.R.styleable#CalendarView_shownWeekCount
* @deprecated No longer used by Material-style CalendarView.
*/
+ @InspectableProperty
@Deprecated
public int getShownWeekCount() {
return mDelegate.getShownWeekCount();
@@ -175,6 +177,7 @@
* @attr ref android.R.styleable#CalendarView_selectedWeekBackgroundColor
* @deprecated No longer used by Material-style CalendarView.
*/
+ @InspectableProperty
@ColorInt
@Deprecated
public int getSelectedWeekBackgroundColor() {
@@ -202,6 +205,7 @@
* @attr ref android.R.styleable#CalendarView_focusedMonthDateColor
* @deprecated No longer used by Material-style CalendarView.
*/
+ @InspectableProperty
@ColorInt
@Deprecated
public int getFocusedMonthDateColor() {
@@ -229,6 +233,7 @@
* @attr ref android.R.styleable#CalendarView_unfocusedMonthDateColor
* @deprecated No longer used by Material-style CalendarView.
*/
+ @InspectableProperty
@ColorInt
@Deprecated
public int getUnfocusedMonthDateColor() {
@@ -256,6 +261,7 @@
* @attr ref android.R.styleable#CalendarView_weekNumberColor
* @deprecated No longer used by Material-style CalendarView.
*/
+ @InspectableProperty
@ColorInt
@Deprecated
public int getWeekNumberColor() {
@@ -285,6 +291,7 @@
*/
@ColorInt
@Deprecated
+ @InspectableProperty
public int getWeekSeparatorLineColor() {
return mDelegate.getWeekSeparatorLineColor();
}
@@ -324,6 +331,7 @@
* @return The vertical bar drawable.
* @deprecated No longer used by Material-style CalendarView.
*/
+ @InspectableProperty
@Deprecated
public Drawable getSelectedDateVerticalBar() {
return mDelegate.getSelectedDateVerticalBar();
@@ -347,6 +355,7 @@
*
* @attr ref android.R.styleable#CalendarView_weekDayTextAppearance
*/
+ @InspectableProperty
public @StyleRes int getWeekDayTextAppearance() {
return mDelegate.getWeekDayTextAppearance();
}
@@ -369,6 +378,7 @@
*
* @attr ref android.R.styleable#CalendarView_dateTextAppearance
*/
+ @InspectableProperty
public @StyleRes int getDateTextAppearance() {
return mDelegate.getDateTextAppearance();
}
@@ -385,6 +395,7 @@
*
* @attr ref android.R.styleable#CalendarView_minDate
*/
+ @InspectableProperty
public long getMinDate() {
return mDelegate.getMinDate();
}
@@ -414,6 +425,7 @@
*
* @attr ref android.R.styleable#CalendarView_maxDate
*/
+ @InspectableProperty
public long getMaxDate() {
return mDelegate.getMaxDate();
}
@@ -452,6 +464,7 @@
*
* @attr ref android.R.styleable#CalendarView_showWeekNumber
*/
+ @InspectableProperty
@Deprecated
public boolean getShowWeekNumber() {
return mDelegate.getShowWeekNumber();
@@ -472,6 +485,7 @@
*
* @attr ref android.R.styleable#CalendarView_firstDayOfWeek
*/
+ @InspectableProperty
public int getFirstDayOfWeek() {
return mDelegate.getFirstDayOfWeek();
}
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 1472b01..b7fdcbe 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -35,6 +35,7 @@
import android.view.ViewHierarchyEncoder;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -121,6 +122,7 @@
}
@ViewDebug.ExportedProperty
+ @InspectableProperty
public boolean isChecked() {
return mChecked;
}
@@ -237,6 +239,7 @@
* @attr ref android.R.styleable#CheckedTextView_checkMarkTint
* @see #setCheckMarkTintList(ColorStateList)
*/
+ @InspectableProperty(name = "checkMarkTint")
@Nullable
public ColorStateList getCheckMarkTintList() {
return mCheckMarkTintList;
@@ -269,6 +272,7 @@
* @attr ref android.R.styleable#CheckedTextView_checkMarkTintMode
* @see #setCheckMarkTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getCheckMarkTintMode() {
return mCheckMarkTintMode;
@@ -328,6 +332,7 @@
*
* @attr ref android.R.styleable#CheckedTextView_checkMark
*/
+ @InspectableProperty(name = "checkMark")
public Drawable getCheckMarkDrawable() {
return mCheckMarkDrawable;
}
diff --git a/core/java/android/widget/Chronometer.java b/core/java/android/widget/Chronometer.java
index d11c03a..66c35d9 100644
--- a/core/java/android/widget/Chronometer.java
+++ b/core/java/android/widget/Chronometer.java
@@ -29,6 +29,7 @@
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -145,6 +146,7 @@
*
* @see #setCountDown(boolean)
*/
+ @InspectableProperty
public boolean isCountDown() {
return mCountDown;
}
@@ -206,6 +208,7 @@
/**
* Returns the current format string as set through {@link #setFormat}.
*/
+ @InspectableProperty
public String getFormat() {
return mFormat;
}
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index d35bec8..a0f93da 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -39,6 +39,7 @@
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -145,6 +146,7 @@
return handled;
}
+ @InspectableProperty
@ViewDebug.ExportedProperty
@Override
public boolean isChecked() {
@@ -282,6 +284,7 @@
* @see #setButtonDrawable(Drawable)
* @see #setButtonDrawable(int)
*/
+ @InspectableProperty(name = "button")
@Nullable
public Drawable getButtonDrawable() {
return mButtonDrawable;
@@ -314,6 +317,7 @@
* @attr ref android.R.styleable#CompoundButton_buttonTint
* @see #setButtonTintList(ColorStateList)
*/
+ @InspectableProperty(name = "buttonTint")
@Nullable
public ColorStateList getButtonTintList() {
return mButtonTintList;
@@ -342,6 +346,7 @@
* @attr ref android.R.styleable#CompoundButton_buttonTintMode
* @see #setButtonTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getButtonTintMode() {
return mButtonTintMode;
diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java
index df53795..cca951c 100644
--- a/core/java/android/widget/DatePicker.java
+++ b/core/java/android/widget/DatePicker.java
@@ -37,6 +37,7 @@
import android.view.accessibility.AccessibilityEvent;
import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -212,6 +213,10 @@
* @attr ref android.R.styleable#DatePicker_datePickerMode
* @hide Visible for testing only.
*/
+ @InspectableProperty(name = "datePickerMode", enumMapping = {
+ @InspectableProperty.EnumMap(value = MODE_SPINNER, name = "spinner"),
+ @InspectableProperty.EnumMap(value = MODE_CALENDAR, name = "calendar")
+ })
@DatePickerMode
@TestApi
public int getMode() {
@@ -257,6 +262,7 @@
/**
* @return The selected year.
*/
+ @InspectableProperty(hasAttributeId = false)
public int getYear() {
return mDelegate.getYear();
}
@@ -264,6 +270,7 @@
/**
* @return The selected month.
*/
+ @InspectableProperty(hasAttributeId = false)
public int getMonth() {
return mDelegate.getMonth();
}
@@ -271,6 +278,7 @@
/**
* @return The selected day of month.
*/
+ @InspectableProperty(hasAttributeId = false)
public int getDayOfMonth() {
return mDelegate.getDayOfMonth();
}
@@ -285,6 +293,7 @@
*
* @return The minimal supported date.
*/
+ @InspectableProperty
public long getMinDate() {
return mDelegate.getMinDate().getTimeInMillis();
}
@@ -310,6 +319,7 @@
*
* @return The maximal supported date.
*/
+ @InspectableProperty
public long getMaxDate() {
return mDelegate.getMaxDate().getTimeInMillis();
}
@@ -411,6 +421,7 @@
*
* @attr ref android.R.styleable#DatePicker_firstDayOfWeek
*/
+ @InspectableProperty
public int getFirstDayOfWeek() {
return mDelegate.getFirstDayOfWeek();
}
@@ -426,6 +437,7 @@
* @see #getCalendarView()
* @deprecated Not supported by Material-style {@code calendar} mode
*/
+ @InspectableProperty
@Deprecated
public boolean getCalendarViewShown() {
return mDelegate.getCalendarViewShown();
@@ -476,6 +488,7 @@
* @return {@code true} if the spinners are shown
* @deprecated Not supported by Material-style {@code calendar} mode
*/
+ @InspectableProperty
@Deprecated
public boolean getSpinnersShown() {
return mDelegate.getSpinnersShown();
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java
index bf2762a..0469dbd 100644
--- a/core/java/android/widget/DateTimeView.java
+++ b/core/java/android/widget/DateTimeView.java
@@ -35,6 +35,7 @@
import android.text.format.Time;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -142,6 +143,16 @@
update();
}
+ /**
+ * Returns whether this view shows relative time
+ *
+ * @return True if it shows relative time, false otherwise
+ */
+ @InspectableProperty(name = "showReleative", hasAttributeId = false)
+ public boolean isShowRelativeTime() {
+ return mShowRelativeTime;
+ }
+
@Override
@android.view.RemotableViewMethod
public void setVisibility(@Visibility int visibility) {
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index 865f520..5723b94 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -31,6 +31,7 @@
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.ViewHierarchyEncoder;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -367,6 +368,7 @@
*
* @return Whether all children are considered when measuring.
*/
+ @InspectableProperty
public boolean getMeasureAllChildren() {
return mMeasureAllChildren;
}
diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java
index 13c086c..c8abf18 100644
--- a/core/java/android/widget/GridLayout.java
+++ b/core/java/android/widget/GridLayout.java
@@ -46,6 +46,7 @@
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -327,6 +328,10 @@
* @attr ref android.R.styleable#GridLayout_orientation
*/
@Orientation
+ @InspectableProperty(enumMapping = {
+ @InspectableProperty.EnumMap(value = HORIZONTAL, name = "horizontal"),
+ @InspectableProperty.EnumMap(value = VERTICAL, name = "vertical")
+ })
public int getOrientation() {
return mOrientation;
}
@@ -387,6 +392,7 @@
*
* @attr ref android.R.styleable#GridLayout_rowCount
*/
+ @InspectableProperty
public int getRowCount() {
return mVerticalAxis.getCount();
}
@@ -420,6 +426,7 @@
*
* @attr ref android.R.styleable#GridLayout_columnCount
*/
+ @InspectableProperty
public int getColumnCount() {
return mHorizontalAxis.getCount();
}
@@ -451,6 +458,7 @@
*
* @attr ref android.R.styleable#GridLayout_useDefaultMargins
*/
+ @InspectableProperty
public boolean getUseDefaultMargins() {
return mUseDefaultMargins;
}
@@ -499,6 +507,10 @@
* @attr ref android.R.styleable#GridLayout_alignmentMode
*/
@AlignmentMode
+ @InspectableProperty(enumMapping = {
+ @InspectableProperty.EnumMap(value = ALIGN_BOUNDS, name = "alignBounds"),
+ @InspectableProperty.EnumMap(value = ALIGN_MARGINS, name = "alignMargins"),
+ })
public int getAlignmentMode() {
return mAlignmentMode;
}
@@ -533,6 +545,7 @@
*
* @attr ref android.R.styleable#GridLayout_rowOrderPreserved
*/
+ @InspectableProperty
public boolean isRowOrderPreserved() {
return mVerticalAxis.isOrderPreserved();
}
@@ -569,6 +582,7 @@
*
* @attr ref android.R.styleable#GridLayout_columnOrderPreserved
*/
+ @InspectableProperty
public boolean isColumnOrderPreserved() {
return mHorizontalAxis.isOrderPreserved();
}
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java
index f781802..bf65ec0 100644
--- a/core/java/android/widget/GridView.java
+++ b/core/java/android/widget/GridView.java
@@ -42,6 +42,7 @@
import android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo;
import android.view.accessibility.AccessibilityNodeProvider;
import android.view.animation.GridLayoutAnimationController;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -2061,6 +2062,7 @@
*
* @attr ref android.R.styleable#GridView_gravity
*/
+ @InspectableProperty(valueType = InspectableProperty.ValueType.GRAVITY)
public int getGravity() {
return mGravity;
}
@@ -2096,6 +2098,7 @@
*
* @attr ref android.R.styleable#GridView_horizontalSpacing
*/
+ @InspectableProperty
public int getHorizontalSpacing() {
return mHorizontalSpacing;
}
@@ -2147,6 +2150,7 @@
*
* @attr ref android.R.styleable#GridView_verticalSpacing
*/
+ @InspectableProperty
public int getVerticalSpacing() {
return mVerticalSpacing;
}
@@ -2167,6 +2171,13 @@
}
@StretchMode
+ @InspectableProperty(enumMapping = {
+ @InspectableProperty.EnumMap(value = NO_STRETCH, name = "none"),
+ @InspectableProperty.EnumMap(value = STRETCH_SPACING, name = "spacingWidth"),
+ @InspectableProperty.EnumMap(
+ value = STRETCH_SPACING_UNIFORM, name = "spacingWidthUniform"),
+ @InspectableProperty.EnumMap(value = STRETCH_COLUMN_WIDTH, name = "columnWidth"),
+ })
public int getStretchMode() {
return mStretchMode;
}
@@ -2197,6 +2208,7 @@
*
* @attr ref android.R.styleable#GridView_columnWidth
*/
+ @InspectableProperty
public int getColumnWidth() {
return mColumnWidth;
}
@@ -2241,6 +2253,7 @@
* @see #setNumColumns(int)
*/
@ViewDebug.ExportedProperty
+ @InspectableProperty
public int getNumColumns() {
return mNumColumns;
}
diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java
index bf9dffd..1c5f837 100644
--- a/core/java/android/widget/HorizontalScrollView.java
+++ b/core/java/android/widget/HorizontalScrollView.java
@@ -43,6 +43,7 @@
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.AnimationUtils;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -293,6 +294,7 @@
*
* @attr ref android.R.styleable#HorizontalScrollView_fillViewport
*/
+ @InspectableProperty
public boolean isFillViewport() {
return mFillViewport;
}
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index c21182c..e9c31db 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -51,6 +51,7 @@
import android.view.ViewDebug;
import android.view.ViewHierarchyEncoder;
import android.view.accessibility.AccessibilityEvent;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -326,6 +327,7 @@
*
* @attr ref android.R.styleable#ImageView_adjustViewBounds
*/
+ @InspectableProperty
public boolean getAdjustViewBounds() {
return mAdjustViewBounds;
}
@@ -364,6 +366,7 @@
*
* @attr ref android.R.styleable#ImageView_maxWidth
*/
+ @InspectableProperty
public int getMaxWidth() {
return mMaxWidth;
}
@@ -402,6 +405,7 @@
*
* @attr ref android.R.styleable#ImageView_maxHeight
*/
+ @InspectableProperty
public int getMaxHeight() {
return mMaxHeight;
}
@@ -438,6 +442,7 @@
* @return the view's drawable, or null if no drawable has been
* assigned.
*/
+ @InspectableProperty(name = "src")
public Drawable getDrawable() {
if (mDrawable == mRecycleableBitmapDrawable) {
// Consider our cached version dirty since app code now has a reference to it
@@ -650,6 +655,7 @@
* @see #setImageTintList(ColorStateList)
*/
@Nullable
+ @InspectableProperty(name = "tint")
public ColorStateList getImageTintList() {
return mDrawableTintList;
}
@@ -679,6 +685,7 @@
* @see #setImageTintMode(PorterDuff.Mode)
*/
@Nullable
+ @InspectableProperty(name = "tintMode")
public PorterDuff.Mode getImageTintMode() {
return mDrawableTintMode;
}
@@ -844,6 +851,7 @@
* @see ImageView.ScaleType
* @attr ref android.R.styleable#ImageView_scaleType
*/
+ @InspectableProperty
public ScaleType getScaleType() {
return mScaleType;
}
@@ -893,6 +901,7 @@
*
* @attr ref android.R.styleable#ImageView_cropToPadding
*/
+ @InspectableProperty
public boolean getCropToPadding() {
return mCropToPadding;
}
@@ -1404,6 +1413,7 @@
* if baseline alignment is not supported.
*/
@Override
+ @InspectableProperty
@ViewDebug.ExportedProperty(category = "layout")
public int getBaseline() {
if (mBaselineAlignBottom) {
@@ -1451,6 +1461,7 @@
* @return True if the ImageView's baseline is considered the bottom of the view, false if otherwise.
* @see #setBaselineAlignBottom(boolean)
*/
+ @InspectableProperty
public boolean getBaselineAlignBottom() {
return mBaselineAlignBottom;
}
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java
index 15910bb..64769b5 100644
--- a/core/java/android/widget/LinearLayout.java
+++ b/core/java/android/widget/LinearLayout.java
@@ -31,6 +31,7 @@
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.ViewHierarchyEncoder;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -342,6 +343,7 @@
*
* @attr ref android.R.styleable#LinearLayout_divider
*/
+ @InspectableProperty(name = "divider")
public Drawable getDividerDrawable() {
return mDivider;
}
@@ -526,6 +528,7 @@
*
* @return true when widgets are baseline-aligned, false otherwise
*/
+ @InspectableProperty
public boolean isBaselineAligned() {
return mBaselineAligned;
}
@@ -554,6 +557,7 @@
*
* @attr ref android.R.styleable#LinearLayout_measureWithLargestChild
*/
+ @InspectableProperty(name = "measureWithLargestChild")
public boolean isMeasureWithLargestChildEnabled() {
return mUseLargestChild;
}
@@ -633,6 +637,7 @@
* part of a larger layout that is baseline aligned, or -1 if none has
* been set.
*/
+ @InspectableProperty
public int getBaselineAlignedChildIndex() {
return mBaselineAlignedChildIndex;
}
@@ -686,6 +691,7 @@
* a number lower than or equals to 0.0f if not weight sum is
* to be used.
*/
+ @InspectableProperty
public float getWeightSum() {
return mWeightSum;
}
@@ -1841,6 +1847,10 @@
* @return either {@link #HORIZONTAL} or {@link #VERTICAL}
*/
@OrientationMode
+ @InspectableProperty(enumMapping = {
+ @InspectableProperty.EnumMap(value = HORIZONTAL, name = "horizontal"),
+ @InspectableProperty.EnumMap(value = VERTICAL, name = "vertical")
+ })
public int getOrientation() {
return mOrientation;
}
@@ -1877,6 +1887,7 @@
* @return the current gravity.
* @see #setGravity
*/
+ @InspectableProperty(valueType = InspectableProperty.ValueType.GRAVITY)
public int getGravity() {
return mGravity;
}
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 9b49786..311f896 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -49,6 +49,7 @@
import android.view.accessibility.AccessibilityNodeInfo.CollectionInfo;
import android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo;
import android.view.accessibility.AccessibilityNodeProvider;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -3637,6 +3638,7 @@
* @return the current drawable drawn between list elements
* @attr ref R.styleable#ListView_divider
*/
+ @InspectableProperty
@Nullable
public Drawable getDivider() {
return mDivider;
@@ -3666,6 +3668,7 @@
/**
* @return Returns the height of the divider that will be drawn between each item in the list.
*/
+ @InspectableProperty
public int getDividerHeight() {
return mDividerHeight;
}
@@ -3701,6 +3704,7 @@
*
* @see #setHeaderDividersEnabled(boolean)
*/
+ @InspectableProperty(name = "headerDividersEnabled")
public boolean areHeaderDividersEnabled() {
return mHeaderDividersEnabled;
}
@@ -3724,6 +3728,7 @@
*
* @see #setFooterDividersEnabled(boolean)
*/
+ @InspectableProperty(name = "footerDividersEnabled")
public boolean areFooterDividersEnabled() {
return mFooterDividersEnabled;
}
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index 1fc72f5..3519afd 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -58,6 +58,7 @@
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.Transformation;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -556,6 +557,7 @@
*
* @return true if the progress bar is in indeterminate mode
*/
+ @InspectableProperty
@ViewDebug.ExportedProperty(category = "progress")
public synchronized boolean isIndeterminate() {
return mIndeterminate;
@@ -610,6 +612,7 @@
* @see #setIndeterminateDrawable(android.graphics.drawable.Drawable)
* @see #setIndeterminate(boolean)
*/
+ @InspectableProperty
public Drawable getIndeterminateDrawable() {
return mIndeterminateDrawable;
}
@@ -677,6 +680,7 @@
* @attr ref android.R.styleable#ProgressBar_indeterminateTint
* @see #setIndeterminateTintList(ColorStateList)
*/
+ @InspectableProperty(name = "indeterminateTint")
@Nullable
public ColorStateList getIndeterminateTintList() {
return mProgressTintInfo != null ? mProgressTintInfo.mIndeterminateTintList : null;
@@ -712,6 +716,7 @@
* @attr ref android.R.styleable#ProgressBar_indeterminateTintMode
* @see #setIndeterminateTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getIndeterminateTintMode() {
return mProgressTintInfo != null ? mProgressTintInfo.mIndeterminateTintMode : null;
@@ -768,6 +773,7 @@
* @see #setProgressDrawable(android.graphics.drawable.Drawable)
* @see #setIndeterminate(boolean)
*/
+ @InspectableProperty
public Drawable getProgressDrawable() {
return mProgressDrawable;
}
@@ -821,6 +827,7 @@
/**
* @hide
*/
+ @InspectableProperty
public boolean getMirrorForRtl() {
return mMirrorForRtl;
}
@@ -951,6 +958,7 @@
* @attr ref android.R.styleable#ProgressBar_progressTint
* @see #setProgressTintList(ColorStateList)
*/
+ @InspectableProperty(name = "progressTint")
@Nullable
public ColorStateList getProgressTintList() {
return mProgressTintInfo != null ? mProgressTintInfo.mProgressTintList : null;
@@ -988,6 +996,7 @@
* @attr ref android.R.styleable#ProgressBar_progressTintMode
* @see #setProgressTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getProgressTintMode() {
return mProgressTintInfo != null ? mProgressTintInfo.mProgressTintMode : null;
@@ -1033,6 +1042,7 @@
* @attr ref android.R.styleable#ProgressBar_progressBackgroundTint
* @see #setProgressBackgroundTintList(ColorStateList)
*/
+ @InspectableProperty(name = "progressBackgroundTint")
@Nullable
public ColorStateList getProgressBackgroundTintList() {
return mProgressTintInfo != null ? mProgressTintInfo.mProgressBackgroundTintList : null;
@@ -1067,6 +1077,7 @@
* @attr ref android.R.styleable#ProgressBar_progressBackgroundTintMode
* @see #setProgressBackgroundTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getProgressBackgroundTintMode() {
return mProgressTintInfo != null ? mProgressTintInfo.mProgressBackgroundTintMode : null;
@@ -1112,6 +1123,7 @@
* @attr ref android.R.styleable#ProgressBar_secondaryProgressTint
* @see #setSecondaryProgressTintList(ColorStateList)
*/
+ @InspectableProperty(name = "secondaryProgressTint")
@Nullable
public ColorStateList getSecondaryProgressTintList() {
return mProgressTintInfo != null ? mProgressTintInfo.mSecondaryProgressTintList : null;
@@ -1150,6 +1162,7 @@
* @attr ref android.R.styleable#ProgressBar_secondaryProgressTintMode
* @see #setSecondaryProgressTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getSecondaryProgressTintMode() {
return mProgressTintInfo != null ? mProgressTintInfo.mSecondaryProgressTintMode : null;
@@ -1477,6 +1490,7 @@
* @see #getMax()
*/
@ViewDebug.ExportedProperty(category = "progress")
+ @InspectableProperty
public synchronized int getProgress() {
return mIndeterminate ? 0 : mProgress;
}
@@ -1494,6 +1508,7 @@
* @see #getMax()
*/
@ViewDebug.ExportedProperty(category = "progress")
+ @InspectableProperty
public synchronized int getSecondaryProgress() {
return mIndeterminate ? 0 : mSecondaryProgress;
}
@@ -1508,6 +1523,7 @@
* @see #getSecondaryProgress()
*/
@ViewDebug.ExportedProperty(category = "progress")
+ @InspectableProperty
public synchronized int getMin() {
return mMin;
}
@@ -1522,6 +1538,7 @@
* @see #getSecondaryProgress()
*/
@ViewDebug.ExportedProperty(category = "progress")
+ @InspectableProperty
public synchronized int getMax() {
return mMax;
}
@@ -1687,6 +1704,7 @@
*
* @return the {@link Interpolator} associated to this animation
*/
+ @InspectableProperty
public Interpolator getInterpolator() {
return mInterpolator;
}
diff --git a/core/java/android/widget/RatingBar.java b/core/java/android/widget/RatingBar.java
index d343d49..9f9fdee 100644
--- a/core/java/android/widget/RatingBar.java
+++ b/core/java/android/widget/RatingBar.java
@@ -23,6 +23,7 @@
import android.graphics.drawable.shapes.Shape;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -164,6 +165,7 @@
*
* @attr ref android.R.styleable#RatingBar_isIndicator
*/
+ @InspectableProperty(name = "isIndicator")
public boolean isIndicator() {
return !mIsUserSeekable;
}
@@ -190,6 +192,7 @@
* Returns the number of stars shown.
* @return The number of stars shown.
*/
+ @InspectableProperty
public int getNumStars() {
return mNumStars;
}
@@ -208,6 +211,7 @@
*
* @return The current rating.
*/
+ @InspectableProperty
public float getRating() {
return getProgress() / getProgressPerStar();
}
@@ -234,6 +238,7 @@
*
* @return The step size.
*/
+ @InspectableProperty
public float getStepSize() {
return (float) getNumStars() / getMax();
}
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index 506d615..556bfd1 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -34,6 +34,7 @@
import android.view.ViewGroup;
import android.view.ViewHierarchyEncoder;
import android.view.accessibility.AccessibilityEvent;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
import com.android.internal.R;
@@ -289,6 +290,16 @@
}
/**
+ * Get the id of the View to be ignored by gravity
+ *
+ * @attr ref android.R.styleable#RelativeLayout_ignoreGravity
+ */
+ @InspectableProperty
+ public int getIgnoreGravity() {
+ return mIgnoreGravity;
+ }
+
+ /**
* Describes how the child views are positioned.
*
* @return the gravity.
@@ -298,6 +309,7 @@
*
* @attr ref android.R.styleable#RelativeLayout_gravity
*/
+ @InspectableProperty(valueType = InspectableProperty.ValueType.GRAVITY)
public int getGravity() {
return mGravity;
}
diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java
index 4658d73..fc4e9ec 100644
--- a/core/java/android/widget/ScrollView.java
+++ b/core/java/android/widget/ScrollView.java
@@ -45,6 +45,7 @@
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.AnimationUtils;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -324,6 +325,7 @@
*
* @attr ref android.R.styleable#ScrollView_fillViewport
*/
+ @InspectableProperty
public boolean isFillViewport() {
return mFillViewport;
}
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index 10e1dfb..af3b8c0 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -62,6 +62,7 @@
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
+import android.view.inspector.InspectableProperty;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.TextView.OnEditorActionListener;
@@ -563,6 +564,7 @@
*
* @return the query string
*/
+ @InspectableProperty(hasAttributeId = false)
public CharSequence getQuery() {
return mSearchSrcTextView.getText();
}
@@ -620,6 +622,7 @@
* @return the displayed query hint text, or {@code null} if none set
* @attr ref android.R.styleable#SearchView_queryHint
*/
+ @InspectableProperty
@Nullable
public CharSequence getQueryHint() {
final CharSequence hint;
@@ -656,13 +659,25 @@
* Returns the default iconified state of the search field.
* @return
*
+ * @deprecated use {@link #isIconifiedByDefault()}
* @attr ref android.R.styleable#SearchView_iconifiedByDefault
*/
+ @Deprecated
public boolean isIconfiedByDefault() {
return mIconifiedByDefault;
}
/**
+ * Returns the default iconified state of the search field.
+ *
+ * @attr ref android.R.styleable#SearchView_iconifiedByDefault
+ */
+ @InspectableProperty
+ public boolean isIconifiedByDefault() {
+ return mIconifiedByDefault;
+ }
+
+ /**
* Iconifies or expands the SearchView. Any query text is cleared when iconified. This is
* a temporary state and does not override the default iconified state set by
* {@link #setIconifiedByDefault(boolean)}. If the default state is iconified, then
@@ -686,6 +701,7 @@
* @return true if the SearchView is currently iconified, false if the search field is
* fully visible.
*/
+ @InspectableProperty(hasAttributeId = false)
public boolean isIconified() {
return mIconified;
}
@@ -780,6 +796,7 @@
*
* @attr ref android.R.styleable#SearchView_maxWidth
*/
+ @InspectableProperty
public int getMaxWidth() {
return mMaxWidth;
}
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index 1705ba8..fb56d97 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -45,6 +45,7 @@
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.inspector.InspectableProperty;
import android.widget.PopupWindow.OnDismissListener;
import com.android.internal.R;
@@ -360,6 +361,7 @@
*
* @attr ref android.R.styleable#Spinner_popupBackground
*/
+ @InspectableProperty
public Drawable getPopupBackground() {
return mPopup.getBackground();
}
@@ -392,6 +394,7 @@
*
* @attr ref android.R.styleable#ListPopupWindow_dropDownVerticalOffset
*/
+ @InspectableProperty
public int getDropDownVerticalOffset() {
return mPopup.getVerticalOffset();
}
@@ -416,6 +419,7 @@
*
* @attr ref android.R.styleable#ListPopupWindow_dropDownHorizontalOffset
*/
+ @InspectableProperty
public int getDropDownHorizontalOffset() {
return mPopup.getHorizontalOffset();
}
@@ -452,6 +456,7 @@
*
* @attr ref android.R.styleable#Spinner_dropDownWidth
*/
+ @InspectableProperty
public int getDropDownWidth() {
return mDropDownWidth;
}
@@ -491,6 +496,7 @@
*
* @return A {@link android.view.Gravity Gravity} value
*/
+ @InspectableProperty(valueType = InspectableProperty.ValueType.GRAVITY)
public int getGravity() {
return mGravity;
}
@@ -828,6 +834,7 @@
/**
* @return The prompt to display when the dialog is shown
*/
+ @InspectableProperty
public CharSequence getPrompt() {
return mPopup.getHintText();
}
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index 79dc670..af4f0202 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -52,6 +52,7 @@
import android.view.ViewStructure;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -444,6 +445,7 @@
*
* @attr ref android.R.styleable#Switch_switchPadding
*/
+ @InspectableProperty
public int getSwitchPadding() {
return mSwitchPadding;
}
@@ -469,6 +471,7 @@
*
* @attr ref android.R.styleable#Switch_switchMinWidth
*/
+ @InspectableProperty
public int getSwitchMinWidth() {
return mSwitchMinWidth;
}
@@ -492,6 +495,7 @@
*
* @attr ref android.R.styleable#Switch_thumbTextPadding
*/
+ @InspectableProperty
public int getThumbTextPadding() {
return mThumbTextPadding;
}
@@ -532,6 +536,7 @@
*
* @attr ref android.R.styleable#Switch_track
*/
+ @InspectableProperty(name = "track")
public Drawable getTrackDrawable() {
return mTrackDrawable;
}
@@ -562,6 +567,7 @@
* @attr ref android.R.styleable#Switch_trackTint
* @see #setTrackTintList(ColorStateList)
*/
+ @InspectableProperty(name = "trackTint")
@Nullable
public ColorStateList getTrackTintList() {
return mTrackTintList;
@@ -591,6 +597,7 @@
* @attr ref android.R.styleable#Switch_trackTintMode
* @see #setTrackTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getTrackTintMode() {
return mTrackTintMode;
@@ -655,6 +662,7 @@
*
* @attr ref android.R.styleable#Switch_thumb
*/
+ @InspectableProperty(name = "thumb")
public Drawable getThumbDrawable() {
return mThumbDrawable;
}
@@ -685,6 +693,7 @@
* @attr ref android.R.styleable#Switch_thumbTint
* @see #setThumbTintList(ColorStateList)
*/
+ @InspectableProperty(name = "thumbTint")
@Nullable
public ColorStateList getThumbTintList() {
return mThumbTintList;
@@ -714,6 +723,7 @@
* @attr ref android.R.styleable#Switch_thumbTintMode
* @see #setThumbTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty
@Nullable
public PorterDuff.Mode getThumbTintMode() {
return mThumbTintMode;
@@ -758,6 +768,7 @@
*
* @attr ref android.R.styleable#Switch_splitTrack
*/
+ @InspectableProperty
public boolean getSplitTrack() {
return mSplitTrack;
}
@@ -767,6 +778,7 @@
*
* @attr ref android.R.styleable#Switch_textOn
*/
+ @InspectableProperty
public CharSequence getTextOn() {
return mTextOn;
}
@@ -786,6 +798,7 @@
*
* @attr ref android.R.styleable#Switch_textOff
*/
+ @InspectableProperty
public CharSequence getTextOff() {
return mTextOff;
}
@@ -817,6 +830,7 @@
* @return whether the on/off text should be displayed
* @attr ref android.R.styleable#Switch_showText
*/
+ @InspectableProperty
public boolean getShowText() {
return mShowText;
}
diff --git a/core/java/android/widget/TextClock.java b/core/java/android/widget/TextClock.java
index 4865808..7f462cb 100644
--- a/core/java/android/widget/TextClock.java
+++ b/core/java/android/widget/TextClock.java
@@ -39,6 +39,7 @@
import android.util.AttributeSet;
import android.view.RemotableViewMethod;
import android.view.ViewHierarchyEncoder;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -285,6 +286,7 @@
* @see #setFormat12Hour(CharSequence)
* @see #is24HourModeEnabled()
*/
+ @InspectableProperty
@ExportedProperty
public CharSequence getFormat12Hour() {
return mFormat12;
@@ -344,6 +346,7 @@
* @see #setFormat24Hour(CharSequence)
* @see #is24HourModeEnabled()
*/
+ @InspectableProperty
@ExportedProperty
public CharSequence getFormat24Hour() {
return mFormat24;
@@ -435,6 +438,7 @@
* @see #setFormat24Hour(CharSequence)
* @see #getFormat24Hour()
*/
+ @InspectableProperty(hasAttributeId = false)
public boolean is24HourModeEnabled() {
if (mShowCurrentUserTime) {
return DateFormat.is24HourFormat(getContext(), ActivityManager.getCurrentUser());
@@ -453,6 +457,7 @@
* @see java.util.TimeZone#getAvailableIDs()
* @see #setTimeZone(String)
*/
+ @InspectableProperty
public String getTimeZone() {
return mTimeZone;
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 780fe8d..90c70bb 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -172,6 +172,9 @@
import android.view.inputmethod.ExtractedTextRequest;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
+import android.view.inspector.InspectableProperty;
+import android.view.inspector.InspectableProperty.EnumMap;
+import android.view.inspector.InspectableProperty.FlagMap;
import android.view.textclassifier.TextClassification;
import android.view.textclassifier.TextClassificationContext;
import android.view.textclassifier.TextClassificationManager;
@@ -1888,6 +1891,10 @@
* @see #setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int)
* @see #setAutoSizeTextTypeUniformWithPresetSizes(int[], int)
*/
+ @InspectableProperty(enumMapping = {
+ @EnumMap(name = "none", value = AUTO_SIZE_TEXT_TYPE_NONE),
+ @EnumMap(name = "uniform", value = AUTO_SIZE_TEXT_TYPE_UNIFORM)
+ })
@AutoSizeTextType
public int getAutoSizeTextType() {
return mAutoSizeTextType;
@@ -1900,6 +1907,7 @@
*
* @see #setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int)
*/
+ @InspectableProperty
public int getAutoSizeStepGranularity() {
return Math.round(mAutoSizeStepGranularityInPx);
}
@@ -1913,6 +1921,7 @@
* @see #setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int)
* @see #setAutoSizeTextTypeUniformWithPresetSizes(int[], int)
*/
+ @InspectableProperty
public int getAutoSizeMinTextSize() {
return Math.round(mAutoSizeMinTextSizeInPx);
}
@@ -1926,6 +1935,7 @@
* @see #setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int)
* @see #setAutoSizeTextTypeUniformWithPresetSizes(int[], int)
*/
+ @InspectableProperty
public int getAutoSizeMaxTextSize() {
return Math.round(mAutoSizeMaxTextSizeInPx);
}
@@ -2270,6 +2280,7 @@
* @attr ref android.R.styleable#TextView_text
*/
@ViewDebug.CapturedViewProperty
+ @InspectableProperty
public CharSequence getText() {
return mText;
}
@@ -2307,6 +2318,7 @@
* contain additional first-or last-line padding.
* @return The height of one standard line in pixels.
*/
+ @InspectableProperty
public int getLineHeight() {
return FastMath.round(mTextPaint.getFontMetricsInt(null) * mSpacingMult + mSpacingAdd);
}
@@ -3230,6 +3242,7 @@
*
* @attr ref android.R.styleable#TextView_drawablePadding
*/
+ @InspectableProperty(name = "drawablePadding")
public int getCompoundDrawablePadding() {
final Drawables dr = mDrawables;
return dr != null ? dr.mDrawablePadding : 0;
@@ -3266,6 +3279,7 @@
* @attr ref android.R.styleable#TextView_drawableTint
* @see #setCompoundDrawableTintList(ColorStateList)
*/
+ @InspectableProperty(name = "drawableTint")
public ColorStateList getCompoundDrawableTintList() {
return mDrawables != null ? mDrawables.mTintList : null;
}
@@ -3300,6 +3314,7 @@
* @attr ref android.R.styleable#TextView_drawableTintMode
* @see #setCompoundDrawableTintMode(PorterDuff.Mode)
*/
+ @InspectableProperty(name = "drawableTintMode")
public PorterDuff.Mode getCompoundDrawableTintMode() {
return mDrawables != null ? mDrawables.mTintMode : null;
}
@@ -3480,6 +3495,7 @@
* @see #setFirstBaselineToTopHeight(int)
* @attr ref android.R.styleable#TextView_firstBaselineToTopHeight
*/
+ @InspectableProperty
public int getFirstBaselineToTopHeight() {
return getPaddingTop() - getPaint().getFontMetricsInt().top;
}
@@ -3490,17 +3506,24 @@
* @see #setLastBaselineToBottomHeight(int)
* @attr ref android.R.styleable#TextView_lastBaselineToBottomHeight
*/
+ @InspectableProperty
public int getLastBaselineToBottomHeight() {
return getPaddingBottom() + getPaint().getFontMetricsInt().bottom;
}
/**
- * Gets the autolink mask of the text. See {@link
- * android.text.util.Linkify#ALL Linkify.ALL} and peers for
- * possible values.
+ * Gets the autolink mask of the text.
+ *
+ * See {@link Linkify#ALL} and peers for possible values.
*
* @attr ref android.R.styleable#TextView_autoLink
*/
+ @InspectableProperty(name = "autoLink", flagMapping = {
+ @FlagMap(name = "web", target = Linkify.WEB_URLS),
+ @FlagMap(name = "email", target = Linkify.EMAIL_ADDRESSES),
+ @FlagMap(name = "phone", target = Linkify.PHONE_NUMBERS),
+ @FlagMap(name = "map", target = Linkify.MAP_ADDRESSES)
+ })
public final int getAutoLinkMask() {
return mAutoLinkMask;
}
@@ -4149,6 +4172,7 @@
/**
* @return the size (in pixels) of the default text size in this TextView.
*/
+ @InspectableProperty
@ViewDebug.ExportedProperty(category = "text")
public float getTextSize() {
return mTextPaint.getTextSize();
@@ -4242,6 +4266,7 @@
* This will usually be 1.0.
* @return The horizontal scale factor.
*/
+ @InspectableProperty
public float getTextScaleX() {
return mTextPaint.getTextScaleX();
}
@@ -4302,6 +4327,7 @@
* @attr ref android.R.styleable#TextView_typeface
* @attr ref android.R.styleable#TextView_textStyle
*/
+ @InspectableProperty
public Typeface getTypeface() {
return mTextPaint.getTypeface();
}
@@ -4362,6 +4388,7 @@
*
* @attr ref android.R.styleable#TextView_fallbackLineSpacing
*/
+ @InspectableProperty
public boolean isFallbackLineSpacing() {
return mUseFallbackLineSpacing;
}
@@ -4375,6 +4402,7 @@
* @see #setElegantTextHeight(boolean)
* @see Paint#setElegantTextHeight(boolean)
*/
+ @InspectableProperty
public boolean isElegantTextHeight() {
return mTextPaint.isElegantTextHeight();
}
@@ -4387,6 +4415,7 @@
* @see #setLetterSpacing(float)
* @see Paint#setLetterSpacing
*/
+ @InspectableProperty
public float getLetterSpacing() {
return mTextPaint.getLetterSpacing();
}
@@ -4425,6 +4454,7 @@
* @see #setFontFeatureSettings(String)
* @see Paint#setFontFeatureSettings(String) Paint.setFontFeatureSettings(String)
*/
+ @InspectableProperty
@Nullable
public String getFontFeatureSettings() {
return mTextPaint.getFontFeatureSettings();
@@ -4476,6 +4506,11 @@
* @attr ref android.R.styleable#TextView_breakStrategy
* @see #setBreakStrategy(int)
*/
+ @InspectableProperty(enumMapping = {
+ @EnumMap(name = "simple", value = Layout.BREAK_STRATEGY_SIMPLE),
+ @EnumMap(name = "high_quality", value = Layout.BREAK_STRATEGY_HIGH_QUALITY),
+ @EnumMap(name = "balanced", value = Layout.BREAK_STRATEGY_BALANCED)
+ })
@Layout.BreakStrategy
public int getBreakStrategy() {
return mBreakStrategy;
@@ -4522,6 +4557,11 @@
* @attr ref android.R.styleable#TextView_hyphenationFrequency
* @see #setHyphenationFrequency(int)
*/
+ @InspectableProperty(enumMapping = {
+ @EnumMap(name = "none", value = Layout.HYPHENATION_FREQUENCY_NONE),
+ @EnumMap(name = "normal", value = Layout.HYPHENATION_FREQUENCY_NORMAL),
+ @EnumMap(name = "full", value = Layout.HYPHENATION_FREQUENCY_FULL)
+ })
@Layout.HyphenationFrequency
public int getHyphenationFrequency() {
return mHyphenationFrequency;
@@ -4579,6 +4619,10 @@
*
* @see #setJustificationMode(int)
*/
+ @InspectableProperty(enumMapping = {
+ @EnumMap(name = "none", value = Layout.JUSTIFICATION_MODE_NONE),
+ @EnumMap(name = "inter_word", value = Layout.JUSTIFICATION_MODE_INTER_WORD)
+ })
public @Layout.JustificationMode int getJustificationMode() {
return mJustificationMode;
}
@@ -4719,6 +4763,7 @@
*
* @attr ref android.R.styleable#TextView_textColor
*/
+ @InspectableProperty(name = "textColor")
public final ColorStateList getTextColors() {
return mTextColor;
}
@@ -4753,6 +4798,7 @@
*
* @attr ref android.R.styleable#TextView_textColorHighlight
*/
+ @InspectableProperty(name = "textColorHighlight")
@ColorInt
public int getHighlightColor() {
return mHighlightColor;
@@ -4818,6 +4864,7 @@
*
* @attr ref android.R.styleable#TextView_shadowRadius
*/
+ @InspectableProperty
public float getShadowRadius() {
return mShadowRadius;
}
@@ -4829,6 +4876,7 @@
*
* @attr ref android.R.styleable#TextView_shadowDx
*/
+ @InspectableProperty
public float getShadowDx() {
return mShadowDx;
}
@@ -4841,6 +4889,7 @@
*
* @attr ref android.R.styleable#TextView_shadowDy
*/
+ @InspectableProperty
public float getShadowDy() {
return mShadowDy;
}
@@ -4853,6 +4902,7 @@
*
* @attr ref android.R.styleable#TextView_shadowColor
*/
+ @InspectableProperty
@ColorInt
public int getShadowColor() {
return mShadowColor;
@@ -4900,6 +4950,7 @@
*
* @attr ref android.R.styleable#TextView_linksClickable
*/
+ @InspectableProperty
public final boolean getLinksClickable() {
return mLinksClickable;
}
@@ -4960,6 +5011,7 @@
*
* @attr ref android.R.styleable#TextView_textColorHint
*/
+ @InspectableProperty(name = "textColorHint")
public final ColorStateList getHintTextColors() {
return mHintTextColor;
}
@@ -5012,6 +5064,7 @@
*
* @attr ref android.R.styleable#TextView_textColorLink
*/
+ @InspectableProperty(name = "textColorLink")
public final ColorStateList getLinkTextColors() {
return mLinkTextColor;
}
@@ -5061,6 +5114,7 @@
* @see android.view.Gravity
* @attr ref android.R.styleable#TextView_gravity
*/
+ @InspectableProperty(valueType = InspectableProperty.ValueType.GRAVITY)
public int getGravity() {
return mGravity;
}
@@ -5117,6 +5171,7 @@
* @attr ref android.R.styleable#TextView_scrollHorizontally
* @see #setHorizontallyScrolling(boolean)
*/
+ @InspectableProperty(name = "scrollHorizontally")
public final boolean isHorizontallyScrollable() {
return mHorizontallyScrolling;
}
@@ -5169,6 +5224,7 @@
*
* @attr ref android.R.styleable#TextView_minLines
*/
+ @InspectableProperty
public int getMinLines() {
return mMinMode == LINES ? mMinimum : -1;
}
@@ -5251,6 +5307,7 @@
*
* @attr ref android.R.styleable#TextView_maxLines
*/
+ @InspectableProperty
public int getMaxLines() {
return mMaxMode == LINES ? mMaximum : -1;
}
@@ -5290,6 +5347,7 @@
*
* @attr ref android.R.styleable#TextView_maxHeight
*/
+ @InspectableProperty
public int getMaxHeight() {
return mMaxMode == PIXELS ? mMaximum : -1;
}
@@ -5374,6 +5432,7 @@
*
* @attr ref android.R.styleable#TextView_minEms
*/
+ @InspectableProperty
public int getMinEms() {
return mMinWidthMode == EMS ? mMinWidth : -1;
}
@@ -5417,6 +5476,7 @@
*
* @attr ref android.R.styleable#TextView_minWidth
*/
+ @InspectableProperty
public int getMinWidth() {
return mMinWidthMode == PIXELS ? mMinWidth : -1;
}
@@ -5456,6 +5516,7 @@
*
* @attr ref android.R.styleable#TextView_maxEms
*/
+ @InspectableProperty
public int getMaxEms() {
return mMaxWidthMode == EMS ? mMaxWidth : -1;
}
@@ -5495,6 +5556,7 @@
*
* @attr ref android.R.styleable#TextView_maxWidth
*/
+ @InspectableProperty
public int getMaxWidth() {
return mMaxWidthMode == PIXELS ? mMaxWidth : -1;
}
@@ -5578,6 +5640,7 @@
*
* @attr ref android.R.styleable#TextView_lineSpacingMultiplier
*/
+ @InspectableProperty
public float getLineSpacingMultiplier() {
return mSpacingMult;
}
@@ -5592,6 +5655,7 @@
*
* @attr ref android.R.styleable#TextView_lineSpacingExtra
*/
+ @InspectableProperty
public float getLineSpacingExtra() {
return mSpacingAdd;
}
@@ -5876,6 +5940,7 @@
*
* @see #setFreezesText
*/
+ @InspectableProperty
public boolean getFreezesText() {
return mFreezesText;
}
@@ -6339,6 +6404,7 @@
*
* @attr ref android.R.styleable#TextView_hint
*/
+ @InspectableProperty
@ViewDebug.CapturedViewProperty
public CharSequence getHint() {
return mHint;
@@ -6350,6 +6416,7 @@
*
* @attr ref android.R.styleable#TextView_singleLine
*/
+ @InspectableProperty
public boolean isSingleLine() {
return mSingleLine;
}
@@ -6591,6 +6658,147 @@
* @see #setInputType(int)
* @see android.text.InputType
*/
+ @InspectableProperty(flagMapping = {
+ @FlagMap(name = "none", mask = 0xffffffff, target = InputType.TYPE_NULL),
+ @FlagMap(
+ name = "text",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL),
+ @FlagMap(
+ name = "textUri",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI),
+ @FlagMap(
+ name = "textEmailAddress",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS),
+ @FlagMap(
+ name = "textEmailSubject",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_EMAIL_SUBJECT),
+ @FlagMap(
+ name = "textShortMessage",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE),
+ @FlagMap(
+ name = "textLongMessage",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_LONG_MESSAGE),
+ @FlagMap(
+ name = "textPersonName",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_PERSON_NAME),
+ @FlagMap(
+ name = "textPostalAddress",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS),
+ @FlagMap(
+ name = "textPassword",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD),
+ @FlagMap(
+ name = "textVisiblePassword",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD),
+ @FlagMap(
+ name = "textWebEditText",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT),
+ @FlagMap(
+ name = "textFilter",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_FILTER),
+ @FlagMap(
+ name = "textPhonetic",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PHONETIC),
+ @FlagMap(
+ name = "textWebEmailAddress",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS),
+ @FlagMap(
+ name = "textWebPassword",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_TEXT
+ | InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD),
+ @FlagMap(
+ name = "number",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_NORMAL),
+ @FlagMap(
+ name = "numberPassword",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_NUMBER
+ | InputType.TYPE_NUMBER_VARIATION_PASSWORD),
+ @FlagMap(
+ name = "phone",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_PHONE),
+ @FlagMap(
+ name = "datetime",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_DATETIME
+ | InputType.TYPE_DATETIME_VARIATION_NORMAL),
+ @FlagMap(
+ name = "date",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_DATETIME
+ | InputType.TYPE_DATETIME_VARIATION_DATE),
+ @FlagMap(
+ name = "time",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION,
+ target = InputType.TYPE_CLASS_DATETIME
+ | InputType.TYPE_DATETIME_VARIATION_TIME),
+ @FlagMap(
+ name = "textCapCharacters",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS),
+ @FlagMap(
+ name = "textCapWords",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_WORDS),
+ @FlagMap(
+ name = "textCapSentences",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES),
+ @FlagMap(
+ name = "textAutoCorrect",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT),
+ @FlagMap(
+ name = "textAutoComplete",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE),
+ @FlagMap(
+ name = "textMultiLine",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE),
+ @FlagMap(
+ name = "textImeMultiLine",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE),
+ @FlagMap(
+ name = "textNoSuggestions",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS),
+ @FlagMap(
+ name = "numberSigned",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED),
+ @FlagMap(
+ name = "numberDecimal",
+ mask = InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_FLAGS,
+ target = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL),
+ })
public int getInputType() {
return mEditor == null ? EditorInfo.TYPE_NULL : mEditor.mInputType;
}
@@ -6613,8 +6821,55 @@
* Get the type of the Input Method Editor (IME).
* @return the type of the IME
* @see #setImeOptions(int)
- * @see android.view.inputmethod.EditorInfo
+ * @see EditorInfo
*/
+ @InspectableProperty(flagMapping = {
+ @FlagMap(name = "normal", mask = 0xffffffff, target = EditorInfo.IME_NULL),
+ @FlagMap(
+ name = "actionUnspecified",
+ mask = EditorInfo.IME_MASK_ACTION,
+ target = EditorInfo.IME_ACTION_UNSPECIFIED),
+ @FlagMap(
+ name = "actionNone",
+ mask = EditorInfo.IME_MASK_ACTION,
+ target = EditorInfo.IME_ACTION_NONE),
+ @FlagMap(
+ name = "actionGo",
+ mask = EditorInfo.IME_MASK_ACTION,
+ target = EditorInfo.IME_ACTION_GO),
+ @FlagMap(
+ name = "actionSearch",
+ mask = EditorInfo.IME_MASK_ACTION,
+ target = EditorInfo.IME_ACTION_SEARCH),
+ @FlagMap(
+ name = "actionSend",
+ mask = EditorInfo.IME_MASK_ACTION,
+ target = EditorInfo.IME_ACTION_SEND),
+ @FlagMap(
+ name = "actionNext",
+ mask = EditorInfo.IME_MASK_ACTION,
+ target = EditorInfo.IME_ACTION_NEXT),
+ @FlagMap(
+ name = "actionDone",
+ mask = EditorInfo.IME_MASK_ACTION,
+ target = EditorInfo.IME_ACTION_DONE),
+ @FlagMap(
+ name = "actionPrevious",
+ mask = EditorInfo.IME_MASK_ACTION,
+ target = EditorInfo.IME_ACTION_PREVIOUS),
+ @FlagMap(name = "flagForceAscii", target = EditorInfo.IME_FLAG_FORCE_ASCII),
+ @FlagMap(name = "flagNavigateNext", target = EditorInfo.IME_FLAG_NAVIGATE_NEXT),
+ @FlagMap(name = "flagNavigatePrevious", target = EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS),
+ @FlagMap(
+ name = "flagNoAccessoryAction",
+ target = EditorInfo.IME_FLAG_NO_ACCESSORY_ACTION),
+ @FlagMap(name = "flagNoEnterAction", target = EditorInfo.IME_FLAG_NO_ENTER_ACTION),
+ @FlagMap(name = "flagNoExtractUi", target = EditorInfo.IME_FLAG_NO_EXTRACT_UI),
+ @FlagMap(name = "flagNoFullscreen", target = EditorInfo.IME_FLAG_NO_FULLSCREEN),
+ @FlagMap(
+ name = "flagNoPersonalizedLearning",
+ target = EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING),
+ })
public int getImeOptions() {
return mEditor != null && mEditor.mInputContentType != null
? mEditor.mInputContentType.imeOptions : EditorInfo.IME_NULL;
@@ -6643,6 +6898,7 @@
* @see #setImeActionLabel
* @see android.view.inputmethod.EditorInfo
*/
+ @InspectableProperty
public CharSequence getImeActionLabel() {
return mEditor != null && mEditor.mInputContentType != null
? mEditor.mInputContentType.imeActionLabel : null;
@@ -6654,6 +6910,7 @@
* @see #setImeActionLabel
* @see android.view.inputmethod.EditorInfo
*/
+ @InspectableProperty
public int getImeActionId() {
return mEditor != null && mEditor.mInputContentType != null
? mEditor.mInputContentType.imeActionId : 0;
@@ -6776,6 +7033,7 @@
* @see #setPrivateImeOptions(String)
* @see EditorInfo#privateImeOptions
*/
+ @InspectableProperty
public String getPrivateImeOptions() {
return mEditor != null && mEditor.mInputContentType != null
? mEditor.mInputContentType.privateImeOptions : null;
@@ -7384,6 +7642,7 @@
*
* @attr ref android.R.styleable#TextView_textIsSelectable
*/
+ @InspectableProperty(name = "textIsSelectable")
public boolean isTextSelectable() {
return mEditor == null ? false : mEditor.mTextIsSelectable;
}
@@ -8923,6 +9182,7 @@
*
* @attr ref android.R.styleable#TextView_includeFontPadding
*/
+ @InspectableProperty
public boolean getIncludeFontPadding() {
return mIncludePad;
}
@@ -9869,6 +10129,7 @@
* @see #setAllCaps(boolean)
* @see #setTransformationMethod(TransformationMethod)
*/
+ @InspectableProperty(name = "textAllCaps")
public boolean isAllCaps() {
final TransformationMethod method = getTransformationMethod();
return method != null && method instanceof AllCapsTransformationMethod;
@@ -9978,6 +10239,7 @@
*
* @attr ref android.R.styleable#TextView_marqueeRepeatLimit
*/
+ @InspectableProperty
public int getMarqueeRepeatLimit() {
return mMarqueeRepeatLimit;
}
@@ -9986,6 +10248,7 @@
* Returns where, if anywhere, words that are longer than the view
* is wide should be ellipsized.
*/
+ @InspectableProperty
@ViewDebug.ExportedProperty
public TextUtils.TruncateAt getEllipsize() {
return mEllipsize;
@@ -10037,6 +10300,7 @@
*
* @attr ref android.R.styleable#TextView_cursorVisible
*/
+ @InspectableProperty
public boolean isCursorVisible() {
// true is the default value
return mEditor == null ? true : mEditor.mCursorVisible;
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java
index 6a5c8cc..b239ce6 100644
--- a/core/java/android/widget/TimePicker.java
+++ b/core/java/android/widget/TimePicker.java
@@ -35,6 +35,7 @@
import android.view.accessibility.AccessibilityEvent;
import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
@@ -165,6 +166,10 @@
*/
@TimePickerMode
@TestApi
+ @InspectableProperty(name = "timePickerMode", enumMapping = {
+ @InspectableProperty.EnumMap(name = "clock", value = MODE_CLOCK),
+ @InspectableProperty.EnumMap(name = "spinner", value = MODE_SPINNER)
+ })
public int getMode() {
return mMode;
}
@@ -185,6 +190,7 @@
* @return the currently selected hour, in the range (0-23)
* @see #setHour(int)
*/
+ @InspectableProperty(hasAttributeId = false)
public int getHour() {
return mDelegate.getHour();
}
@@ -205,6 +211,7 @@
* @return the currently selected minute, in the range (0-59)
* @see #setMinute(int)
*/
+ @InspectableProperty(hasAttributeId = false)
public int getMinute() {
return mDelegate.getMinute();
}
@@ -272,6 +279,7 @@
* {@code false} otherwise}
* @see #setIs24HourView(Boolean)
*/
+ @InspectableProperty(hasAttributeId = false, name = "24Hour")
public boolean is24HourView() {
return mDelegate.is24Hour();
}
diff --git a/core/java/android/widget/ToggleButton.java b/core/java/android/widget/ToggleButton.java
index 6a8449e..bba6da6 100644
--- a/core/java/android/widget/ToggleButton.java
+++ b/core/java/android/widget/ToggleButton.java
@@ -21,6 +21,7 @@
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.util.AttributeSet;
+import android.view.inspector.InspectableProperty;
/**
* Displays checked/unchecked states as a button
@@ -87,6 +88,7 @@
*
* @return The text.
*/
+ @InspectableProperty
public CharSequence getTextOn() {
return mTextOn;
}
@@ -105,6 +107,7 @@
*
* @return The text.
*/
+ @InspectableProperty
public CharSequence getTextOff() {
return mTextOff;
}
@@ -118,6 +121,16 @@
mTextOff = textOff;
}
+ /**
+ * Returns the alpha value of the button when it is disabled
+ *
+ * @return the alpha value, 0.0-1.0
+ */
+ @InspectableProperty
+ public float getDisabledAlpha() {
+ return mDisabledAlpha;
+ }
+
@Override
protected void onFinishInflate() {
super.onFinishInflate();
diff --git a/core/java/android/widget/Toolbar.java b/core/java/android/widget/Toolbar.java
index adb7f2f..a33c47d8 100644
--- a/core/java/android/widget/Toolbar.java
+++ b/core/java/android/widget/Toolbar.java
@@ -45,6 +45,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
+import android.view.inspector.InspectableProperty;
import com.android.internal.R;
import com.android.internal.view.menu.MenuBuilder;
@@ -383,6 +384,7 @@
* 0 if menus are inflated against the toolbar theme
* @see #setPopupTheme(int)
*/
+ @InspectableProperty
public int getPopupTheme() {
return mPopupTheme;
}
@@ -414,6 +416,7 @@
* @see #setTitleMarginStart(int)
* @attr ref android.R.styleable#Toolbar_titleMarginStart
*/
+ @InspectableProperty
public int getTitleMarginStart() {
return mTitleMarginStart;
}
@@ -436,6 +439,7 @@
* @see #setTitleMarginTop(int)
* @attr ref android.R.styleable#Toolbar_titleMarginTop
*/
+ @InspectableProperty
public int getTitleMarginTop() {
return mTitleMarginTop;
}
@@ -458,6 +462,7 @@
* @see #setTitleMarginEnd(int)
* @attr ref android.R.styleable#Toolbar_titleMarginEnd
*/
+ @InspectableProperty
public int getTitleMarginEnd() {
return mTitleMarginEnd;
}
@@ -480,6 +485,7 @@
* @see #setTitleMarginBottom(int)
* @attr ref android.R.styleable#Toolbar_titleMarginBottom
*/
+ @InspectableProperty
public int getTitleMarginBottom() {
return mTitleMarginBottom;
}
@@ -650,6 +656,7 @@
* @see #setLogo(int)
* @see #setLogo(android.graphics.drawable.Drawable)
*/
+ @InspectableProperty
public Drawable getLogo() {
return mLogoView != null ? mLogoView.getDrawable() : null;
}
@@ -688,6 +695,7 @@
*
* @return A description of the logo
*/
+ @InspectableProperty
public CharSequence getLogoDescription() {
return mLogoView != null ? mLogoView.getContentDescription() : null;
}
@@ -735,6 +743,7 @@
*
* @return The current title.
*/
+ @InspectableProperty
public CharSequence getTitle() {
return mTitleText;
}
@@ -791,6 +800,7 @@
*
* @return The current subtitle
*/
+ @InspectableProperty
public CharSequence getSubtitle() {
return mSubtitleText;
}
@@ -895,6 +905,7 @@
*
* @attr ref android.R.styleable#Toolbar_navigationContentDescription
*/
+ @InspectableProperty
@Nullable
public CharSequence getNavigationContentDescription() {
return mNavButtonView != null ? mNavButtonView.getContentDescription() : null;
@@ -987,6 +998,7 @@
*
* @attr ref android.R.styleable#Toolbar_navigationIcon
*/
+ @InspectableProperty
@Nullable
public Drawable getNavigationIcon() {
return mNavButtonView != null ? mNavButtonView.getDrawable() : null;
@@ -1024,6 +1036,7 @@
*
* @attr ref android.R.styleable#Toolbar_collapseContentDescription
*/
+ @InspectableProperty
@Nullable
public CharSequence getCollapseContentDescription() {
return mCollapseButtonView != null ? mCollapseButtonView.getContentDescription() : null;
@@ -1069,6 +1082,7 @@
*
* @attr ref android.R.styleable#Toolbar_collapseIcon
*/
+ @InspectableProperty
@Nullable
public Drawable getCollapseIcon() {
return mCollapseButtonView != null ? mCollapseButtonView.getDrawable() : null;
@@ -1234,6 +1248,7 @@
* @see #getContentInsetRight()
* @attr ref android.R.styleable#Toolbar_contentInsetStart
*/
+ @InspectableProperty
public int getContentInsetStart() {
return mContentInsets != null ? mContentInsets.getStart() : 0;
}
@@ -1254,6 +1269,7 @@
* @see #getContentInsetRight()
* @attr ref android.R.styleable#Toolbar_contentInsetEnd
*/
+ @InspectableProperty
public int getContentInsetEnd() {
return mContentInsets != null ? mContentInsets.getEnd() : 0;
}
@@ -1297,6 +1313,7 @@
* @see #getContentInsetRight()
* @attr ref android.R.styleable#Toolbar_contentInsetLeft
*/
+ @InspectableProperty
public int getContentInsetLeft() {
return mContentInsets != null ? mContentInsets.getLeft() : 0;
}
@@ -1317,6 +1334,7 @@
* @see #getContentInsetLeft()
* @attr ref android.R.styleable#Toolbar_contentInsetRight
*/
+ @InspectableProperty
public int getContentInsetRight() {
return mContentInsets != null ? mContentInsets.getRight() : 0;
}
@@ -1333,6 +1351,7 @@
* @see #setContentInsetStartWithNavigation(int)
* @attr ref android.R.styleable#Toolbar_contentInsetStartWithNavigation
*/
+ @InspectableProperty
public int getContentInsetStartWithNavigation() {
return mContentInsetStartWithNavigation != RtlSpacingHelper.UNDEFINED
? mContentInsetStartWithNavigation
@@ -1376,6 +1395,7 @@
* @see #setContentInsetEndWithActions(int)
* @attr ref android.R.styleable#Toolbar_contentInsetEndWithActions
*/
+ @InspectableProperty
public int getContentInsetEndWithActions() {
return mContentInsetEndWithActions != RtlSpacingHelper.UNDEFINED
? mContentInsetEndWithActions
diff --git a/core/java/android/widget/ViewAnimator.java b/core/java/android/widget/ViewAnimator.java
index 598a407..80ea363 100644
--- a/core/java/android/widget/ViewAnimator.java
+++ b/core/java/android/widget/ViewAnimator.java
@@ -26,6 +26,7 @@
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
+import android.view.inspector.InspectableProperty;
/**
* Base class for a {@link FrameLayout} container that will perform animations
@@ -265,6 +266,7 @@
* @see #setInAnimation(android.view.animation.Animation)
* @see #setInAnimation(android.content.Context, int)
*/
+ @InspectableProperty
public Animation getInAnimation() {
return mInAnimation;
}
@@ -289,6 +291,7 @@
* @see #setOutAnimation(android.view.animation.Animation)
* @see #setOutAnimation(android.content.Context, int)
*/
+ @InspectableProperty
public Animation getOutAnimation() {
return mOutAnimation;
}
@@ -340,6 +343,7 @@
*
* @see #setAnimateFirstView(boolean)
*/
+ @InspectableProperty
public boolean getAnimateFirstView() {
return mAnimateFirstTime;
}
diff --git a/core/java/android/widget/ViewFlipper.java b/core/java/android/widget/ViewFlipper.java
index 5e72b2e..414b136 100644
--- a/core/java/android/widget/ViewFlipper.java
+++ b/core/java/android/widget/ViewFlipper.java
@@ -25,6 +25,7 @@
import android.os.Message;
import android.util.AttributeSet;
import android.util.Log;
+import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
/**
@@ -134,6 +135,16 @@
}
/**
+ * Get the delay before flipping to the next view.
+ *
+ * @return delay time in milliseconds
+ */
+ @InspectableProperty
+ public int getFlipInterval() {
+ return mFlipInterval;
+ }
+
+ /**
* Start a timer to cycle through child views
*/
public void startFlipping() {
@@ -191,6 +202,7 @@
/**
* Returns true if the child views are flipping.
*/
+ @InspectableProperty(hasAttributeId = false)
public boolean isFlipping() {
return mStarted;
}
@@ -207,6 +219,7 @@
* Returns true if this view automatically calls {@link #startFlipping()}
* when it becomes attached to a window.
*/
+ @InspectableProperty
public boolean isAutoStart() {
return mAutoStart;
}