Handle IME selection focus for ENABLE_DEVICE_SEARCH

Bug: 162861289
Change-Id: I15e4eae09be2aa9f89a5157fd74c95e91e64bc53
This commit is contained in:
Hyunyoung Song
2020-08-04 22:22:49 -07:00
parent 70a556da1d
commit 5dd045bec6
11 changed files with 138 additions and 21 deletions

View File

@@ -223,6 +223,25 @@ public class AlphabeticalAppsList implements AllAppsStore.OnUpdateListener {
return mAdapterItems;
}
/**
* Returns the child adapter item with IME launch focus.
*/
public AdapterItem getFocusedChild() {
return mAdapterItems.get(getFocusedChildIndex());
}
/**
* Returns the index of the child with IME launch focus.
*/
public int getFocusedChildIndex() {
for (AdapterItem item : mAdapterItems) {
if (item.isCountedForAccessibility()) {
return mAdapterItems.indexOf(item);
}
}
return -1;
}
/**
* Returns the number of rows of applications
*/