7 package com.google.appinventor.components.runtime;
16 import android.Manifest;
17 import android.widget.AutoCompleteTextView;
37 @DesignerComponent(version = YaVersion.EMAILPICKER_COMPONENT_VERSION,
38 description =
"An EmailPicker is a kind of text box. " +
39 "If the user begins entering the name " +
40 "or email address of a contact, the phone will show a dropdown menu of " +
41 "choices that complete the entry. If there are many contacts, the " +
42 "dropdown can take several seconds to appear, and can show intermediate results " +
43 "while the matches are being computed. <p>The initial contents " +
44 "of the text box and the contents< after user entry is in the <code>Text</code> " +
45 "property. If the <code>Text</code> property is initially empty, " +
46 "the contents of the <code>Hint</code> property will be faintly shown " +
47 "in the text box as a hint to the user.</p>\n " +
48 "<p>Other properties affect the appearance of the text box " +
49 "(<code>TextAlignment</code>, <code>BackgroundColor</code>, etc.) and " +
50 "whether it can be used (<code>Enabled</code>).</p>\n" +
51 "<p>Text boxes like this are usually used with <code>Button</code> " +
52 "components, with the user clicking on the button when text entry is " +
54 category = ComponentCategory.SOCIAL)
56 @UsesPermissions(permissionNames =
"android.permission.READ_CONTACTS")
67 super(container,
new AutoCompleteTextView(container.
$context()));
71 @SuppressWarnings(
"unused")
72 public
void Initialize() {
75 public void HandlePermissionResponse(String permission,
boolean granted) {
77 ((AutoCompleteTextView) view).setAdapter(addressAdapter);
79 container.$form().dispatchPermissionDeniedEvent(
EmailPicker.this,
"Initialize", permission);