summaryrefslogtreecommitdiffstats
path: root/tests/VoiceInteraction
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-03-20 15:05:35 -0700
committerDianne Hackborn <hackbod@google.com>2015-03-23 13:59:47 -0700
commit0b071a08d8dec3e68937590938199273f3b123cc (patch)
treeefa185352b9d5f4fca62dbfb35cf259fed1b3c5b /tests/VoiceInteraction
parent79ec42e6a3c6a6f6a00ef3ad92221a5ad2149aa9 (diff)
downloadframeworks_base-0b071a08d8dec3e68937590938199273f3b123cc.zip
frameworks_base-0b071a08d8dec3e68937590938199273f3b123cc.tar.gz
frameworks_base-0b071a08d8dec3e68937590938199273f3b123cc.tar.bz2
Add view ID, rework assist API.
Add view ID information to the assist structure. Also rework the API to simplify how it works by removing the ViewNode wrapper around ViewNodeImpl -- these are now just the same thing. And then add complexity by introducing a formal WindowNode object that contains the top-level window information (so I can add in some more window-specific info in the future). Change-Id: I5d525cf61ab6a73193e5cceb4c09d2d21cc27bae
Diffstat (limited to 'tests/VoiceInteraction')
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java
index 2ad23ed..bdc1276 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/AssistVisualizer.java
@@ -47,12 +47,12 @@ public class AssistVisualizer extends View {
public void setAssistStructure(AssistStructure as) {
mAssistStructure = as;
mTextRects.clear();
- final int N = as.getWindowCount();
+ final int N = as.getWindowNodeCount();
if (N > 0) {
- AssistStructure.ViewNode window = new AssistStructure.ViewNode();
for (int i=0; i<N; i++) {
- as.getWindowAt(i, window);
- buildTextRects(window, 0, 0);
+ AssistStructure.WindowNode windowNode = as.getWindowNodeAt(i);
+ buildTextRects(windowNode.getRootViewNode(), windowNode.getLeft(),
+ windowNode.getTop());
}
}
invalidate();
@@ -79,9 +79,8 @@ public class AssistVisualizer extends View {
if (N > 0) {
left -= root.getScrollX();
top -= root.getScrollY();
- AssistStructure.ViewNode child = new AssistStructure.ViewNode();
for (int i=0; i<N; i++) {
- root.getChildAt(i, child);
+ AssistStructure.ViewNode child = root.getChildAt(i);
buildTextRects(child, left, top);
}
}