Set accessibility pane title for right pane on updating content.
This will let users know that content appeared on right when they
selected an option on left.
Note: This is announced _only_ when content changes.
Bug: 324073588
Test: Manual with talkback
Flag: N/A
Change-Id: Icec3242d8f250f6d19e082a39927165c7b8fc86a
diff --git a/res/layout/widgets_two_pane_sheet.xml b/res/layout/widgets_two_pane_sheet.xml
index cd7f2e1..f692e24 100644
--- a/res/layout/widgets_two_pane_sheet.xml
+++ b/res/layout/widgets_two_pane_sheet.xml
@@ -116,6 +116,7 @@
android:clipToOutline="true"
android:paddingBottom="36dp"
android:background="@drawable/widgets_surface_background"
+ android:importantForAccessibility="yes"
android:id="@+id/right_pane">
<com.android.launcher3.widget.picker.WidgetsRecommendationTableLayout
android:id="@+id/recommended_widget_table"
diff --git a/res/values-ldrtl/strings.xml b/res/values-ldrtl/strings.xml
new file mode 100644
index 0000000..118b499
--- /dev/null
+++ b/res/values-ldrtl/strings.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+/*
+* Copyright (C) 2008 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- General -->
+ <skip />
+
+ <!-- accessibilityPaneTitle for the right pane when showing suggested widgets. -->
+ <string name="widget_picker_right_pane_accessibility_title"><xliff:g id="selected_header" example="Calendar">%1$s</xliff:g> widgets on left, search and options on right</string>
+</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 5cc4616..a4e7ec4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -77,6 +77,8 @@
<string name="fitness_widget_recommendation_category_label">Reach Your Fitness Goals</string>
<string name="weather_widget_recommendation_category_label">Stay Ahead of the Weather</string>
<string name="others_widget_recommendation_category_label">You Might Also Like</string>
+ <!-- accessibilityPaneTitle for the right pane when showing suggested widgets. -->
+ <string name="widget_picker_right_pane_accessibility_title"><xliff:g id="selected_header" example="Calendar">%1$s</xliff:g> widgets on right, search and options on left</string>
<!-- Label for showing the number of widgets an app has in the full widgets picker.
[CHAR_LIMIT=25][ICU SYNTAX] -->
<string name="widgets_count">
diff --git a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java
index 5a1ec87..3e4d289 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java
@@ -200,10 +200,14 @@
return false;
}
};
- packageItemInfo.title = getContext().getString(R.string.suggested_widgets_header_title);
+ String suggestionsHeaderTitle = getContext().getString(
+ R.string.suggested_widgets_header_title);
+ String suggestionsRightPaneTitle = getContext().getString(
+ R.string.widget_picker_right_pane_accessibility_title, suggestionsHeaderTitle);
+ packageItemInfo.title = suggestionsHeaderTitle;
WidgetsListHeaderEntry widgetsListHeaderEntry = WidgetsListHeaderEntry.create(
packageItemInfo,
- getContext().getString(R.string.suggested_widgets_header_title),
+ suggestionsHeaderTitle,
mActivityContext.getPopupDataProvider().getRecommendedWidgets())
.withWidgetListShown();
@@ -216,10 +220,12 @@
mRightPane.removeAllViews();
mRightPane.addView(mRecommendedWidgetsTable);
mRightPaneScrollView.setScrollY(0);
+ mRightPane.setAccessibilityPaneTitle(suggestionsRightPaneTitle);
mSuggestedWidgetsPackageUserKey = PackageUserKey.fromPackageItemInfo(packageItemInfo);
mSelectedHeader = mSuggestedWidgetsPackageUserKey;
});
mSuggestedWidgetsContainer.addView(mSuggestedWidgetsHeader);
+ mRightPane.setAccessibilityPaneTitle(suggestionsRightPaneTitle);
}
@Override
@@ -322,6 +328,10 @@
mRightPane.removeAllViews();
mRightPane.addView(widgetsRowViewHolder.itemView);
mRightPaneScrollView.setScrollY(0);
+ mRightPane.setAccessibilityPaneTitle(
+ getContext().getString(
+ R.string.widget_picker_right_pane_accessibility_title,
+ contentEntry.mPkgItem.title));
}
};
}