diff options
| author | Xin Li <delphij@google.com> | 2021-10-07 23:50:15 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-10-07 23:50:15 +0000 |
| commit | c03b0fa033117c03430e361d561aa910e95a0478 (patch) | |
| tree | 9c6aaee5a3023a6c237394b44e06a3fdb46f6747 /core/java/android/widget/RadioButton.java | |
| parent | 8cc0f40cf250d9c66dc15d0e8bc3a41db9a7cfa1 (diff) | |
| parent | 531b8f4f2605c44cf73e8421f674a1c7a9c277ff (diff) | |
Merge "Merge Android 12"
Diffstat (limited to 'core/java/android/widget/RadioButton.java')
| -rw-r--r-- | core/java/android/widget/RadioButton.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/widget/RadioButton.java b/core/java/android/widget/RadioButton.java index 3e26f6369747..9b3503433e56 100644 --- a/core/java/android/widget/RadioButton.java +++ b/core/java/android/widget/RadioButton.java @@ -16,9 +16,13 @@ package android.widget; +import android.annotation.NonNull; import android.content.Context; import android.util.AttributeSet; import android.view.accessibility.AccessibilityNodeInfo; +import android.widget.RemoteViews.RemoteView; + +import com.android.internal.R; /** @@ -46,6 +50,7 @@ import android.view.accessibility.AccessibilityNodeInfo; * {@link android.R.styleable#View View Attributes} * </p> */ +@RemoteView public class RadioButton extends CompoundButton { public RadioButton(Context context) { @@ -98,4 +103,15 @@ public class RadioButton extends CompoundButton { } } } + + /** @hide **/ + @Override + @NonNull + protected CharSequence getButtonStateDescription() { + if (isChecked()) { + return getResources().getString(R.string.selected); + } else { + return getResources().getString(R.string.not_selected); + } + } } |
