From f30345869f437db3136c31628b5e028efb9702e5 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Wed, 5 Apr 2017 15:05:28 -0700 Subject: [PATCH 1/2] Fixed a bug where the indeterminate progressbar janky Because we were setting it to gone and to visible, the animation would restart. Test: add notifications with indeterminate progress and update a few times Change-Id: I0d68ad609bac07fc0ab8ea7b0c78bf2e27dd21eb Fixes: 36737710 --- core/java/android/app/Notification.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 161dd2583134b..9887d34cbb8fd 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -3613,7 +3613,6 @@ public class Notification implements Parcelable contentView.setTextViewText(R.id.text, null); contentView.setViewVisibility(R.id.text_line_1, View.GONE); contentView.setTextViewText(R.id.text_line_1, null); - contentView.setViewVisibility(R.id.progress, View.GONE); } /** From aca84c0b2a27e921cc6a77ee61ebad218ac1b4f6 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Wed, 5 Apr 2017 16:28:56 -0700 Subject: [PATCH 2/2] Improved accessibility behavior of the notification shelf The content description of the shelf was hiding the icons, so we removed it again. Also added an expand action to make it clear that you can expand it. Also made scrolling in the normal shade better again by marking it to hide it's children. Test: manual, test accessibility on the lockscreen Change-Id: If96c014609f3fa1b7eedb5e89acd8fe55d5b9c69 Fixes: 36660851 --- .../res/layout/status_bar_notification_shelf.xml | 1 - packages/SystemUI/res/values/strings.xml | 2 +- .../systemui/statusbar/NotificationShelf.java | 16 +++++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/res/layout/status_bar_notification_shelf.xml b/packages/SystemUI/res/layout/status_bar_notification_shelf.xml index 6db16fec54289..7bfbd3c542e1c 100644 --- a/packages/SystemUI/res/layout/status_bar_notification_shelf.xml +++ b/packages/SystemUI/res/layout/status_bar_notification_shelf.xml @@ -19,7 +19,6 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="@dimen/notification_shelf_height" - android:contentDescription="@string/notification_shelf_content_description" android:focusable="true" android:clickable="true" > diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index a8cf3daec41e8..2263f23558e3e 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -412,7 +412,7 @@ Notifications. - Notification overflow container + See all notifications Clear notification. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index a0f2891493e40..6354255d2711b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -22,6 +22,7 @@ import android.os.SystemProperties; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; +import android.view.accessibility.AccessibilityNodeInfo; import com.android.internal.widget.CachingIconView; import com.android.systemui.Interpolators; @@ -580,7 +581,7 @@ public class NotificationShelf extends ActivatableNotificationView implements setClickable(mInteractive); setFocusable(mInteractive); setImportantForAccessibility(mInteractive ? View.IMPORTANT_FOR_ACCESSIBILITY_YES - : View.IMPORTANT_FOR_ACCESSIBILITY_NO); + : View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); } @Override @@ -606,6 +607,19 @@ public class NotificationShelf extends ActivatableNotificationView implements return false; // Shelf only uses alpha for transitions where the difference can't be seen. } + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + if (mInteractive) { + info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_EXPAND); + AccessibilityNodeInfo.AccessibilityAction unlock + = new AccessibilityNodeInfo.AccessibilityAction( + AccessibilityNodeInfo.ACTION_CLICK, + getContext().getString(R.string.accessibility_overflow_action)); + info.addAction(unlock); + } + } + @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {