Skip to content

Commit 7a36788

Browse files
committed
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()
1 parent b81b144 commit 7a36788

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

core/java/android/widget/CheckedTextView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.graphics.drawable.Drawable;
2525
import android.util.AttributeSet;
2626
import android.view.Gravity;
27+
import android.view.ViewDebug;
2728
import android.view.accessibility.AccessibilityEvent;
2829

2930

@@ -73,7 +74,8 @@ public CheckedTextView(Context context, AttributeSet attrs, int defStyle) {
7374
public void toggle() {
7475
setChecked(!mChecked);
7576
}
76-
77+
78+
@ViewDebug.ExportedProperty
7779
public boolean isChecked() {
7880
return mChecked;
7981
}

core/java/android/widget/CompoundButton.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import android.os.Parcelable;
2727
import android.util.AttributeSet;
2828
import android.view.Gravity;
29+
import android.view.ViewDebug;
2930
import android.view.accessibility.AccessibilityEvent;
3031

3132
/**
@@ -98,6 +99,7 @@ public boolean performClick() {
9899
return super.performClick();
99100
}
100101

102+
@ViewDebug.ExportedProperty
101103
public boolean isChecked() {
102104
return mChecked;
103105
}

core/java/android/widget/ProgressBar.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import android.util.AttributeSet;
3737
import android.view.Gravity;
3838
import android.view.View;
39+
import android.view.ViewDebug;
3940
import android.view.animation.AlphaAnimation;
4041
import android.view.animation.Animation;
4142
import android.view.animation.AnimationUtils;
@@ -335,6 +336,7 @@ private void initProgressBar() {
335336
*
336337
* @return true if the progress bar is in indeterminate mode
337338
*/
339+
@ViewDebug.ExportedProperty
338340
public synchronized boolean isIndeterminate() {
339341
return mIndeterminate;
340342
}
@@ -607,6 +609,7 @@ public synchronized void setSecondaryProgress(int secondaryProgress) {
607609
* @see #setMax(int)
608610
* @see #getMax()
609611
*/
612+
@ViewDebug.ExportedProperty
610613
public synchronized int getProgress() {
611614
return mIndeterminate ? 0 : mProgress;
612615
}
@@ -623,6 +626,7 @@ public synchronized int getProgress() {
623626
* @see #setMax(int)
624627
* @see #getMax()
625628
*/
629+
@ViewDebug.ExportedProperty
626630
public synchronized int getSecondaryProgress() {
627631
return mIndeterminate ? 0 : mSecondaryProgress;
628632
}
@@ -636,6 +640,7 @@ public synchronized int getSecondaryProgress() {
636640
* @see #getProgress()
637641
* @see #getSecondaryProgress()
638642
*/
643+
@ViewDebug.ExportedProperty
639644
public synchronized int getMax() {
640645
return mMax;
641646
}

core/java/android/widget/TextView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5726,13 +5726,15 @@ public void debug(int depth) {
57265726
/**
57275727
* Convenience for {@link Selection#getSelectionStart}.
57285728
*/
5729+
@ViewDebug.ExportedProperty
57295730
public int getSelectionStart() {
57305731
return Selection.getSelectionStart(getText());
57315732
}
57325733

57335734
/**
57345735
* Convenience for {@link Selection#getSelectionEnd}.
57355736
*/
5737+
@ViewDebug.ExportedProperty
57365738
public int getSelectionEnd() {
57375739
return Selection.getSelectionEnd(getText());
57385740
}

0 commit comments

Comments
 (0)