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
08ca05e2
Commit
08ca05e2
authored
Nov 04, 2012
by
Ryan Bis
Committed by
Gerrit Review System
Nov 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add BackPressed event.
Change-Id: I18b30064a90d55759f52388c9a413242d1861b85
parent
e06e918d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
6 deletions
+27
-6
appinventor/appengine/src/com/google/appinventor/client/youngandroid/YoungAndroidFormUpgrader.java
...nventor/client/youngandroid/YoungAndroidFormUpgrader.java
+4
-0
appinventor/blockslib/src/openblocks/yacodeblocks/BlockSaveFile.java
.../blockslib/src/openblocks/yacodeblocks/BlockSaveFile.java
+4
-0
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/Form.java
...s/src/com/google/appinventor/components/runtime/Form.java
+13
-4
No files found.
appinventor/appengine/src/com/google/appinventor/client/youngandroid/YoungAndroidFormUpgrader.java
View file @
08ca05e2
...
...
@@ -610,6 +610,10 @@ public final class YoungAndroidFormUpgrader {
// to be modified to upgrade to version 9.
srcCompVersion
=
9
;
}
if
(
srcCompVersion
<
10
)
{
// The BackPressed event was added. No blocks need to be modified to upgrade to version 10.
srcCompVersion
=
10
;
}
return
srcCompVersion
;
}
...
...
appinventor/blockslib/src/openblocks/yacodeblocks/BlockSaveFile.java
View file @
08ca05e2
...
...
@@ -789,6 +789,10 @@ public class BlockSaveFile {
// to be modified to upgrade to version 9.
blkCompVersion
=
9
;
}
if
(
blkCompVersion
<
10
)
{
// The BackPressed event was added. No blocks need to be modified to upgrade to version 10.
blkCompVersion
=
10
;
}
return
blkCompVersion
;
}
...
...
appinventor/components/src/com/google/appinventor/components/common/YaVersion.java
View file @
08ca05e2
...
...
@@ -201,8 +201,10 @@ public class YaVersion {
// - BALL_COMPONENT_VERSION was incremented to 5.
// - CANVAS_COMPONENT_VERSION was incremented to 7.
// - IMAGESPRITE_COMPONENT_VERSION was incremented to 6.
// For YOUNG_ANDROID_VERSION 66:
// - FORM_COMPONENT_VERSION was incremented to 10.
public
static
final
int
YOUNG_ANDROID_VERSION
=
6
5
;
public
static
final
int
YOUNG_ANDROID_VERSION
=
6
6
;
// ............................... Blocks Language Version Number ...............................
...
...
@@ -387,7 +389,9 @@ public class YaVersion {
// For FORM_COMPONENT_VERSION 9:
// - The OpenScreenAnimation property was added
// - The CloseScreenAnimation property was added
public
static
final
int
FORM_COMPONENT_VERSION
=
9
;
// For FORM_COMPONENT_VERSION 10:
// - The BackPressed event was added.
public
static
final
int
FORM_COMPONENT_VERSION
=
10
;
// For FUSIONTABLESCONTROL_COMPONENT_VERSION 2:
// - The Fusiontables API was migrated from SQL to V1
...
...
appinventor/components/src/com/google/appinventor/components/runtime/Form.java
View file @
08ca05e2
...
...
@@ -242,14 +242,23 @@ public class Form extends Activity
*/
@Override
public
boolean
onKeyDown
(
int
keyCode
,
KeyEvent
event
)
{
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
boolean
handled
=
super
.
onKeyDown
(
keyCode
,
event
);
AnimationUtil
.
ApplyCloseScreenAnimation
(
this
,
closeAnimType
);
return
handled
;
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
if
(!
BackPressed
())
{
boolean
handled
=
super
.
onKeyDown
(
keyCode
,
event
);
AnimationUtil
.
ApplyCloseScreenAnimation
(
this
,
closeAnimType
);
return
handled
;
}
else
{
return
true
;
}
}
return
super
.
onKeyDown
(
keyCode
,
event
);
}
@SimpleEvent
(
description
=
"Device back button pressed."
)
public
boolean
BackPressed
()
{
return
EventDispatcher
.
dispatchEvent
(
this
,
"BackPressed"
);
}
// onActivityResult should be triggered in only two cases:
// (1) The result is for some other component in the app, not this Form itself
// (2) This page started another page, and that page is closing, and passing
...
...
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