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
5648f694
Commit
5648f694
authored
Jan 18, 2018
by
ChitiSims
Committed by
Evan W. Patton
Jul 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add WebViewStringChange Event
Closes #1036 Change-Id: I616d845134a42b9f93186d0403d4683c1200af35
parent
784e9b7f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
6 deletions
+30
-6
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/youngandroid/YoungAndroidFormUpgrader.java
...nventor/client/youngandroid/YoungAndroidFormUpgrader.java
+3
-2
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
+6
-2
appinventor/components/src/com/google/appinventor/components/runtime/WebViewer.java
.../com/google/appinventor/components/runtime/WebViewer.java
+13
-1
No files found.
appinventor/appengine/src/com/google/appinventor/client/OdeMessages.java
View file @
5648f694
...
...
@@ -3615,6 +3615,10 @@ public interface OdeMessages extends Messages {
@Description
(
""
)
String
WebViewStringProperties
();
@DefaultMessage
(
"WebViewStringChange"
)
@Description
(
""
)
String
WebViewStringChangeEvents
();
@DefaultMessage
(
"EnableSpeedRegulation"
)
@Description
(
""
)
String
EnableSpeedRegulationProperties
();
...
...
appinventor/appengine/src/com/google/appinventor/client/youngandroid/YoungAndroidFormUpgrader.java
View file @
5648f694
...
...
@@ -1492,7 +1492,7 @@ public final class YoungAndroidFormUpgrader {
private
static
int
upgradeWebViewerProperties
(
Map
<
String
,
JSONValue
>
componentProperties
,
int
srcCompVersion
)
{
if
(
srcCompVersion
<
6
)
{
if
(
srcCompVersion
<
7
)
{
// The CanGoForward and CanGoBack methods were added.
// No properties need to be modified to upgrade to version 2.
// UsesLocation property added.
...
...
@@ -1501,7 +1501,8 @@ public final class YoungAndroidFormUpgrader {
// No properties need to be modified to upgrade to version 4.
// IgnoreSslError property added (version 5)
// ClearCaches method was added (version 6)
srcCompVersion
=
6
;
// WebViewStringChange event was added (version 7)
srcCompVersion
=
7
;
}
return
srcCompVersion
;
}
...
...
appinventor/blocklyeditor/src/versioning.js
View file @
5648f694
...
...
@@ -2547,7 +2547,10 @@ Blockly.Versioning.AllUpgradeMaps =
5
:
"
noUpgrade
"
,
// AI2: Added ClearCaches method
6
:
"
noUpgrade
"
6
:
"
noUpgrade
"
,
// AI2: Added WebViewStringChange
7
:
"
noUpgrade
"
},
// End WebViewer upgraders
...
...
appinventor/components/src/com/google/appinventor/components/common/YaVersion.java
View file @
5648f694
...
...
@@ -429,8 +429,10 @@ public class YaVersion {
// - MAP_COMPONENT_VERSION was incremented to 4
// For YOUNG_ANDROID_VERSION 171:
// - FUSIONTABLESCONTROL_COMPONENT_VERSION was incremented to 4
// For YOUNG_ANDROID_VERSION 172:
// - WEBVIEWER_COMPONENT_VERSION was incremented to 7
public
static
final
int
YOUNG_ANDROID_VERSION
=
17
1
;
public
static
final
int
YOUNG_ANDROID_VERSION
=
17
2
;
// ............................... Blocks Language Version Number ...............................
...
...
@@ -1139,7 +1141,9 @@ public class YaVersion {
// - IgnoreSslError property added
// For WEBVIEWER_COMPONENT_VERSION 6:
// - ClearCaches method was added
public
static
final
int
WEBVIEWER_COMPONENT_VERSION
=
6
;
// For WEBVIEWER_COMPONENT_VERSiON 7:
// - Added WebViewStringChange event
public
static
final
int
WEBVIEWER_COMPONENT_VERSION
=
7
;
// For MEDIASTORE_COMPONENT_VERSION 1:
// - Initial Version.
...
...
appinventor/components/src/com/google/appinventor/components/runtime/WebViewer.java
View file @
5648f694
...
...
@@ -11,6 +11,7 @@ import android.webkit.JavascriptInterface;
import
com.google.appinventor.components.annotations.DesignerComponent
;
import
com.google.appinventor.components.annotations.DesignerProperty
;
import
com.google.appinventor.components.annotations.PropertyCategory
;
import
com.google.appinventor.components.annotations.SimpleEvent
;
import
com.google.appinventor.components.annotations.SimpleFunction
;
import
com.google.appinventor.components.annotations.SimpleObject
;
import
com.google.appinventor.components.annotations.SimpleProperty
;
...
...
@@ -440,6 +441,11 @@ public final class WebViewer extends AndroidViewComponent {
webview
.
clearCache
(
true
);
}
@SimpleEvent
(
description
=
"When the JavaScript calls AppInventor.setWebViewString this event is run."
)
public
void
WebViewStringChange
(
String
value
)
{
EventDispatcher
.
dispatchEvent
(
this
,
"WebViewStringChange"
,
value
);
}
/**
* Allows the setting of properties to be monitored from the javascript
* in the WebView
...
...
@@ -468,8 +474,14 @@ public final class WebViewer extends AndroidViewComponent {
* Sets the web view string
*/
@JavascriptInterface
public
void
setWebViewString
(
String
newString
)
{
public
void
setWebViewString
(
final
String
newString
)
{
webViewString
=
newString
;
container
.
$form
().
runOnUiThread
(
new
Runnable
()
{
public
void
run
()
{
WebViewStringChange
(
newString
);
}
});
}
}
...
...
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