These changes add access to some status values in widgets listed below:
widget/CheckedTextView.java: report if the item is checked or not.
widget/CompoundButton.java: report if the item is checked or not.
widget/ProgressBar.java: isIndeterminate(), getProgress(), getSecondaryProgress(), and getMax() report what
sliders and progress bars are showing
widget/TextView.java: report the current selection: getSelectionStart() and getSelectionEnd()
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index fd590ed..f956df6 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -24,6 +24,7 @@
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.Gravity;
+import android.view.ViewDebug;
import android.view.accessibility.AccessibilityEvent;
@@ -73,7 +74,8 @@
public void toggle() {
setChecked(!mChecked);
}
-
+
+ @ViewDebug.ExportedProperty
public boolean isChecked() {
return mChecked;
}
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index 98b0976..bf02ad3 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -26,6 +26,7 @@
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.Gravity;
+import android.view.ViewDebug;
import android.view.accessibility.AccessibilityEvent;
/**
@@ -98,6 +99,7 @@
return super.performClick();
}
+ @ViewDebug.ExportedProperty
public boolean isChecked() {
return mChecked;
}
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index 1dcb203..6dc9f78 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -36,6 +36,7 @@
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
+import android.view.ViewDebug;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
@@ -335,6 +336,7 @@
*
* @return true if the progress bar is in indeterminate mode
*/
+ @ViewDebug.ExportedProperty
public synchronized boolean isIndeterminate() {
return mIndeterminate;
}
@@ -607,6 +609,7 @@
* @see #setMax(int)
* @see #getMax()
*/
+ @ViewDebug.ExportedProperty
public synchronized int getProgress() {
return mIndeterminate ? 0 : mProgress;
}
@@ -623,6 +626,7 @@
* @see #setMax(int)
* @see #getMax()
*/
+ @ViewDebug.ExportedProperty
public synchronized int getSecondaryProgress() {
return mIndeterminate ? 0 : mSecondaryProgress;
}
@@ -636,6 +640,7 @@
* @see #getProgress()
* @see #getSecondaryProgress()
*/
+ @ViewDebug.ExportedProperty
public synchronized int getMax() {
return mMax;
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index f55ca3f..8980c17 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -5726,6 +5726,7 @@
/**
* Convenience for {@link Selection#getSelectionStart}.
*/
+ @ViewDebug.ExportedProperty
public int getSelectionStart() {
return Selection.getSelectionStart(getText());
}
@@ -5733,6 +5734,7 @@
/**
* Convenience for {@link Selection#getSelectionEnd}.
*/
+ @ViewDebug.ExportedProperty
public int getSelectionEnd() {
return Selection.getSelectionEnd(getText());
}