Announce for accessiblity when taskbar is invoked/closed

Test: Manual
Bug: 265620540
Change-Id: I6660be7716ec59c765f3d54f8fe9889eaaf56e10
This commit is contained in:
Jagrut Desai
2023-03-02 17:27:18 -08:00
parent d0838d3ac1
commit 1dc99f3848
5 changed files with 41 additions and 0 deletions
@@ -29,6 +29,7 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityEvent;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
@@ -78,6 +79,12 @@ public class IconButtonView extends BubbleTextView {
}
}
@Override
public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
super.onPopulateAccessibilityEvent(event);
event.getText().add(this.getContentDescription());
}
/** Sets given Drawable as icon */
public void setIconDrawable(@NonNull Drawable drawable) {
ColorStateList tintList = getBackgroundTintList();