7 package com.google.appinventor.components.runtime;
15 import android.text.InputType;
16 import android.text.method.PasswordTransformationMethod;
17 import android.view.inputmethod.EditorInfo;
18 import android.widget.EditText;
35 @DesignerComponent(version = YaVersion.PASSWORDTEXTBOX_COMPONENT_VERSION,
36 description =
"<p>A box for entering passwords. This is the same as " +
37 "the ordinary <code>TextBox</code> component except this does not " +
38 "display the characters typed by the user.</p><p>The value of the text " +
39 "in the box can be found or set through the <code>Text</code> property. " +
40 "If blank, the <code>Hint</code> property, which appears as faint text " +
41 "in the box, can provide the user with guidance as to what to type.</p> " +
42 "<p>Text boxes are usually used with the <code>Button</code> " +
43 "component, with the user clicking on the button when text entry is " +
45 category = ComponentCategory.USERINTERFACE)
49 private boolean passwordVisible;
60 view.setSingleLine(
true);
63 view.setTransformationMethod(
new PasswordTransformationMethod());
66 view.setImeOptions(EditorInfo.IME_ACTION_DONE);
74 passwordVisible=visible;
76 view.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
78 view.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_VARIATION_PASSWORD);
89 return passwordVisible;