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
a321f908
Commit
a321f908
authored
Oct 31, 2019
by
Matthew Coufal
Committed by
Susan Rati Lane
Oct 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ReadOnly property to TextBox component (#1886)
parent
bc27297d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
2 deletions
+33
-2
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/TextBox.java
...rc/com/google/appinventor/components/runtime/TextBox.java
+22
-0
No files found.
appinventor/appengine/src/com/google/appinventor/client/youngandroid/YoungAndroidFormUpgrader.java
View file @
a321f908
...
@@ -1538,6 +1538,10 @@ public final class YoungAndroidFormUpgrader {
...
@@ -1538,6 +1538,10 @@ public final class YoungAndroidFormUpgrader {
// RequestFocus method was added
// RequestFocus method was added
srcCompVersion
=
5
;
srcCompVersion
=
5
;
}
}
if
(
srcCompVersion
<
6
)
{
// ReadOnly property was added
srcCompVersion
=
6
;
}
return
srcCompVersion
;
return
srcCompVersion
;
}
}
...
...
appinventor/blocklyeditor/src/versioning.js
View file @
a321f908
...
@@ -2380,7 +2380,10 @@ Blockly.Versioning.AllUpgradeMaps =
...
@@ -2380,7 +2380,10 @@ Blockly.Versioning.AllUpgradeMaps =
4
:
"
noUpgrade
"
,
4
:
"
noUpgrade
"
,
// AI2: Added RequestFocus method
// AI2: Added RequestFocus method
5
:
"
noUpgrade
"
5
:
"
noUpgrade
"
,
// AI3: Added ReadOnly property
6
:
"
noUpgrade
"
},
// End TextBox upgraders
},
// End TextBox upgraders
...
...
appinventor/components/src/com/google/appinventor/components/common/YaVersion.java
View file @
a321f908
...
@@ -1107,7 +1107,9 @@ public class YaVersion {
...
@@ -1107,7 +1107,9 @@ public class YaVersion {
// - The MultiLine property was added.
// - The MultiLine property was added.
// For TEXTBOX_COMPONENT_VERSION 5:
// For TEXTBOX_COMPONENT_VERSION 5:
// - RequestFocus method was added
// - RequestFocus method was added
public
static
final
int
TEXTBOX_COMPONENT_VERSION
=
5
;
// For TEXTBOX_COMPONENT_VERSION 6:
// - ReadOnly property was added
public
static
final
int
TEXTBOX_COMPONENT_VERSION
=
6
;
// For TEXTING_COMPONENT_VERSION 2:
// For TEXTING_COMPONENT_VERSION 2:
// Texting over Wifi was implemented using Google Voice
// Texting over Wifi was implemented using Google Voice
...
...
appinventor/components/src/com/google/appinventor/components/runtime/TextBox.java
View file @
a321f908
...
@@ -79,6 +79,9 @@ public final class TextBox extends TextBoxBase {
...
@@ -79,6 +79,9 @@ public final class TextBox extends TextBoxBase {
// If true, then text box is multiline
// If true, then text box is multiline
private
boolean
multiLine
;
private
boolean
multiLine
;
// If true, then text box is read-only
private
boolean
readOnly
;
/**
/**
* Creates a new TextBox component.
* Creates a new TextBox component.
*
*
...
@@ -88,6 +91,7 @@ public final class TextBox extends TextBoxBase {
...
@@ -88,6 +91,7 @@ public final class TextBox extends TextBoxBase {
super
(
container
,
new
EditText
(
container
.
$context
()));
super
(
container
,
new
EditText
(
container
.
$context
()));
NumbersOnly
(
false
);
NumbersOnly
(
false
);
MultiLine
(
false
);
MultiLine
(
false
);
ReadOnly
(
false
);
// We need to set the IME options here. Otherwise, Android's default
// We need to set the IME options here. Otherwise, Android's default
// behavior is that the action button will be Done or Next, depending on
// behavior is that the action button will be Done or Next, depending on
...
@@ -183,6 +187,24 @@ public final class TextBox extends TextBoxBase {
...
@@ -183,6 +187,24 @@ public final class TextBox extends TextBoxBase {
view
.
setSingleLine
(!
multiLine
);
view
.
setSingleLine
(!
multiLine
);
}
}
@SimpleProperty
(
category
=
PropertyCategory
.
BEHAVIOR
,
description
=
"Whether the %type% is read-only. By default, this is true."
)
public
boolean
ReadOnly
()
{
return
readOnly
;
}
@DesignerProperty
(
editorType
=
PropertyTypeConstants
.
PROPERTY_TYPE_BOOLEAN
,
defaultValue
=
"False"
)
@SimpleProperty
public
void
ReadOnly
(
boolean
readOnly
)
{
this
.
readOnly
=
readOnly
;
view
.
setEnabled
(!
readOnly
);
}
// TODO(halabelson): We might also want a method to show the keyboard.
// TODO(halabelson): We might also want a method to show the keyboard.
// Currently the text box keyboard will open when the text field becomes
// Currently the text box keyboard will open when the text field becomes
// active, and that may be the best simple thing. If we implement show keyboard,
// active, and that may be the best simple thing. If we implement show keyboard,
...
...
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