Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
87c88bd7
Commit
87c88bd7
authored
Dec 20, 2017
by
ColinTree
Committed by
Evan W. Patton
Dec 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PasswordVisible property to PasswordTextBox (#943)
parent
42ec861c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
5 deletions
+39
-5
appinventor/appengine/src/com/google/appinventor/client/OdeMessages.java
...engine/src/com/google/appinventor/client/OdeMessages.java
+4
-0
appinventor/appengine/src/com/google/appinventor/client/OdeMessages_zh_CN.properties
...om/google/appinventor/client/OdeMessages_zh_CN.properties
+1
-0
appinventor/appengine/src/com/google/appinventor/client/youngandroid/YoungAndroidFormUpgrader.java
...nventor/client/youngandroid/YoungAndroidFormUpgrader.java
+4
-0
appinventor/blocklyeditor/src/versioning.js
appinventor/blocklyeditor/src/versioning.js
+4
-1
appinventor/components/src/com/google/appinventor/components/common/YaVersion.java
...c/com/google/appinventor/components/common/YaVersion.java
+3
-1
appinventor/components/src/com/google/appinventor/components/runtime/PasswordTextBox.java
...oogle/appinventor/components/runtime/PasswordTextBox.java
+21
-3
appinventor/docs/reference/components/userinterface.html
appinventor/docs/reference/components/userinterface.html
+2
-0
No files found.
appinventor/appengine/src/com/google/appinventor/client/OdeMessages.java
View file @
87c88bd7
...
...
@@ -3471,6 +3471,10 @@ public interface OdeMessages extends Messages {
@Description
(
""
)
String
MentionsProperties
();
@DefaultMessage
(
"PasswordVisible"
)
@Description
(
""
)
String
PasswordVisibleProperties
();
@DefaultMessage
(
"ProviderLocked"
)
@Description
(
""
)
String
ProviderLockedProperties
();
...
...
appinventor/appengine/src/com/google/appinventor/client/OdeMessages_zh_CN.properties
View file @
87c88bd7
...
...
@@ -606,6 +606,7 @@ LeaderProperties = 领队
LongitudeProperties
=
经度
MagnitudeProperties
=
力度
MentionsProperties
=
提名信息
PasswordVisibleProperties
=
显示密码
ProviderLockedProperties
=
锁定提供者
ProviderNameProperties
=
提供者名称
PublicInstancesProperties
=
公共对象
...
...
appinventor/appengine/src/com/google/appinventor/client/youngandroid/YoungAndroidFormUpgrader.java
View file @
87c88bd7
...
...
@@ -1155,6 +1155,10 @@ public final class YoungAndroidFormUpgrader {
// Added RequestFocus Function (via TextBoxBase)
srcCompVersion
=
3
;
}
if
(
srcCompVersion
<
4
)
{
// Added PasswordVisible Property
srcCompVersion
=
4
;
}
return
srcCompVersion
;
}
...
...
appinventor/blocklyeditor/src/versioning.js
View file @
87c88bd7
...
...
@@ -1923,7 +1923,10 @@ Blockly.Versioning.AllUpgradeMaps =
2
:
"
ai1CantDoUpgrade
"
,
// Just indicates we couldn't do upgrade even if we wanted to
// RequestFocus was added
3
:
"
noUpgrade
"
3
:
"
noUpgrade
"
,
// PasswordVisible was added
4
:
"
noUpgrade
"
},
// End PasswordTextBox upgraders
...
...
appinventor/components/src/com/google/appinventor/components/common/YaVersion.java
View file @
87c88bd7
...
...
@@ -850,7 +850,9 @@ public class YaVersion {
// - The Alignment property was renamed to TextAlignment.
// For PASSWORDTEXTBOX_COMPONENT_VERSION 3:
// - Added RequestFocus Function (via TextBoxBase)
public
static
final
int
PASSWORDTEXTBOX_COMPONENT_VERSION
=
3
;
// For PASSWORDTEXTBOX_COMPONENT_VERSION 4:
// - Added PasswordVisible property
public
static
final
int
PASSWORDTEXTBOX_COMPONENT_VERSION
=
4
;
// For PEDOMETER_COMPONENT_VERSION 2:
// - The step sensing algorithm was updated to be more accurate.
...
...
appinventor/components/src/com/google/appinventor/components/runtime/PasswordTextBox.java
View file @
87c88bd7
...
...
@@ -8,6 +8,7 @@ package com.google.appinventor.components.runtime;
import
com.google.appinventor.components.annotations.DesignerComponent
;
import
com.google.appinventor.components.annotations.SimpleObject
;
import
com.google.appinventor.components.annotations.SimpleProperty
;
import
com.google.appinventor.components.common.ComponentCategory
;
import
com.google.appinventor.components.common.YaVersion
;
...
...
@@ -33,6 +34,9 @@ import android.widget.EditText;
category
=
ComponentCategory
.
USERINTERFACE
)
@SimpleObject
public
final
class
PasswordTextBox
extends
TextBoxBase
{
private
boolean
passwordVisible
;
/**
* Creates a new PasswordTextBox component.
*
...
...
@@ -41,9 +45,6 @@ public final class PasswordTextBox extends TextBoxBase {
public
PasswordTextBox
(
ComponentContainer
container
)
{
super
(
container
,
new
EditText
(
container
.
$context
()));
// Disable auto-suggestion.
view
.
setRawInputType
(
InputType
.
TYPE_TEXT_VARIATION_PASSWORD
);
// make the box single line
view
.
setSingleLine
(
true
);
// Add a transformation method to hide password text. This must
...
...
@@ -53,5 +54,22 @@ public final class PasswordTextBox extends TextBoxBase {
// make sure the done action is Done and not Next. See comment in Textbox.java
view
.
setImeOptions
(
EditorInfo
.
IME_ACTION_DONE
);
PasswordVisible
(
false
);
}
@SimpleProperty
(
description
=
"Visibility of password."
)
public
void
PasswordVisible
(
boolean
visible
){
passwordVisible
=
visible
;
if
(
visible
){
view
.
setInputType
(
InputType
.
TYPE_CLASS_TEXT
|
InputType
.
TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
);
}
else
{
view
.
setInputType
(
InputType
.
TYPE_CLASS_TEXT
|
InputType
.
TYPE_TEXT_VARIATION_PASSWORD
);
}
}
@SimpleProperty
(
description
=
"Visibility of password."
)
public
boolean
PasswordVisible
(){
return
passwordVisible
;
}
}
appinventor/docs/reference/components/userinterface.html
View file @
87c88bd7
...
...
@@ -926,6 +926,8 @@ none
<dd>
Color for text.
</dd>
<dt>
<code>
Hint
</code>
</dt>
<dd>
Password hint.
</dd>
<dt>
<code>
PasswordVisible
</code>
</dt>
<dd>
Visibility of password.
</dd>
</dl>
<h3>
Events
</h3>
<dl>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment