diff --git a/java/res/values/strings-talkback-descriptions.xml b/java/res/values/strings-talkback-descriptions.xml
index 09cc088a0..80c7bdbf0 100644
--- a/java/res/values/strings-talkback-descriptions.xml
+++ b/java/res/values/strings-talkback-descriptions.xml
@@ -144,4 +144,9 @@
Alternative characters are available
Alternative characters are dismissed
+
+
+ Alternative suggestions are available
+
+ Alternative suggestions are dismissed
diff --git a/java/src/com/android/inputmethod/accessibility/MoreSuggestionsAccessibilityDelegate.java b/java/src/com/android/inputmethod/accessibility/MoreSuggestionsAccessibilityDelegate.java
new file mode 100644
index 000000000..dfc866113
--- /dev/null
+++ b/java/src/com/android/inputmethod/accessibility/MoreSuggestionsAccessibilityDelegate.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+package com.android.inputmethod.accessibility;
+
+import android.view.MotionEvent;
+
+import com.android.inputmethod.keyboard.KeyDetector;
+import com.android.inputmethod.keyboard.MoreKeysKeyboardView;
+
+public final class MoreSuggestionsAccessibilityDelegate
+ extends MoreKeysKeyboardAccessibilityDelegate {
+ public MoreSuggestionsAccessibilityDelegate(final MoreKeysKeyboardView moreKeysKeyboardView,
+ final KeyDetector keyDetector) {
+ super(moreKeysKeyboardView, keyDetector);
+ }
+
+ @Override
+ protected void simulateTouchEvent(final int touchAction, final MotionEvent hoverEvent) {
+ final MotionEvent touchEvent = synthesizeTouchEvent(touchAction, hoverEvent);
+ mKeyboardView.onTouchEvent(touchEvent);
+ touchEvent.recycle();
+ }
+}
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
index adb92d335..4ca4abec6 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java
@@ -44,7 +44,7 @@ public class MoreKeysKeyboardView extends KeyboardView implements MoreKeysPanel
private int mActivePointerId;
- private MoreKeysKeyboardAccessibilityDelegate mAccessibilityDelegate;
+ protected MoreKeysKeyboardAccessibilityDelegate mAccessibilityDelegate;
public MoreKeysKeyboardView(final Context context, final AttributeSet attrs) {
this(context, attrs, R.attr.moreKeysKeyboardViewStyle);
diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
index aa59db678..79a735ad6 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestionsView.java
@@ -20,6 +20,8 @@ import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
+import com.android.inputmethod.accessibility.AccessibilityUtils;
+import com.android.inputmethod.accessibility.MoreSuggestionsAccessibilityDelegate;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardActionListener;
@@ -49,6 +51,18 @@ public final class MoreSuggestionsView extends MoreKeysKeyboardView {
super(context, attrs, defStyle);
}
+ @Override
+ public void setKeyboard(final Keyboard keyboard) {
+ super.setKeyboard(keyboard);
+ // With accessibility mode off, {@link #mAccessibilityDelegate} is set to null at the
+ // above {@link MoreKeysKeyboardView#setKeyboard(Keyboard)} call.
+ if (AccessibilityUtils.getInstance().isAccessibilityEnabled()) {
+ mAccessibilityDelegate = new MoreSuggestionsAccessibilityDelegate(this, mKeyDetector);
+ mAccessibilityDelegate.setOpenAnnounce(R.string.spoken_open_more_suggestions);
+ mAccessibilityDelegate.setCloseAnnounce(R.string.spoken_close_more_suggestions);
+ }
+ }
+
@Override
protected int getDefaultCoordX() {
final MoreSuggestions pane = (MoreSuggestions)getKeyboard();