Merge "Set accessibility action label for smart replies." into pi-dev
This commit is contained in:
@@ -240,6 +240,8 @@
|
|||||||
<string name="accessibility_waiting_for_fingerprint">Waiting for fingerprint</string>
|
<string name="accessibility_waiting_for_fingerprint">Waiting for fingerprint</string>
|
||||||
<!-- Accessibility action of the unlock button when fingerpint is on (not shown on the screen). [CHAR LIMIT=NONE] -->
|
<!-- Accessibility action of the unlock button when fingerpint is on (not shown on the screen). [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_unlock_without_fingerprint">Unlock without using your fingerprint</string>
|
<string name="accessibility_unlock_without_fingerprint">Unlock without using your fingerprint</string>
|
||||||
|
<!-- Click action label for accessibility for the smart reply buttons (not shown on-screen).". [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="accessibility_send_smart_reply">Send</string>
|
||||||
<!-- Click action label for accessibility for the unlock button. [CHAR LIMIT=NONE] -->
|
<!-- Click action label for accessibility for the unlock button. [CHAR LIMIT=NONE] -->
|
||||||
<string name="unlock_label">unlock</string>
|
<string name="unlock_label">unlock</string>
|
||||||
<!-- Click action label for accessibility for the phone button. [CHAR LIMIT=NONE] -->
|
<!-- Click action label for accessibility for the phone button. [CHAR LIMIT=NONE] -->
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import android.util.Log;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.accessibility.AccessibilityNodeInfo;
|
||||||
|
import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
@@ -179,6 +181,15 @@ public class SmartReplyView extends ViewGroup {
|
|||||||
mKeyguardDismissUtil.dismissKeyguardThenExecute(
|
mKeyguardDismissUtil.dismissKeyguardThenExecute(
|
||||||
action, null /* cancelAction */, false /* afterKeyguardGone */);
|
action, null /* cancelAction */, false /* afterKeyguardGone */);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
b.setAccessibilityDelegate(new AccessibilityDelegate() {
|
||||||
|
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
|
||||||
|
super.onInitializeAccessibilityNodeInfo(host, info);
|
||||||
|
String label = getResources().getString(R.string.accessibility_send_smart_reply);
|
||||||
|
info.addAction(new AccessibilityAction(AccessibilityNodeInfo.ACTION_CLICK, label));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user