Update sample app to listen to clicks on chip

Test: manual
Bug: 151185482

Change-Id: I85c706c896dacfd499c9e0aa1782f23a3f65e569
This commit is contained in:
Feng Cao
2020-03-10 18:20:21 -07:00
parent b0467a5d48
commit 87225ce7f6

View File

@@ -172,10 +172,12 @@ public class AutofillImeService extends InputMethodService {
if(suggestionView != null) {
suggestionViews[index] = suggestionView;
sizes[index] = size;
suggestionView.setOnTouchListener((v, event) -> {
Toast.makeText(AutofillImeService.this, "hello",
Toast.LENGTH_LONG).show();
return false;
suggestionView.setOnClickListener((v) -> {
Log.d(TAG, "Received click on the suggestion");
});
suggestionView.setOnLongClickListener((v) -> {
Log.d(TAG, "Received long click on the suggestion");
return true;
});
}
if (suggestionsCount.decrementAndGet() == 0) {