Update Scene

This commit is contained in:
seven332 committed 2015-03-25 15:25:49 +08:00
1 parent e2d16df66a
commit 29f003724b
2 files changed
+28 -13

No files matched your search

+16 -5
View File
@@ -260,15 +260,24 @@ public abstract class Scene {
}
public void onBackPressed() {
// TODO First click to show finish animation, click again to finish the animation at once and it is finished
if (mCurtain != null && mCurtain.isInAnimation()) {
mCurtain.endAnimation();
} else if (!sSceneManager.endLegacyScene()) {
if (!endCurtainAnimation() && !sSceneManager.endLegacyScene()) {
sSceneManager.finishScene(this);
}
}
/**
* End curtainAnimation if it is running
*
* @return True if curtain animation is running
*/
boolean endCurtainAnimation() {
if (mCurtain != null && mCurtain.isInAnimation()) {
mCurtain.endAnimation();
return true;
}
return false;
}
void openFinished() {
open();
setState(Scene.SCENE_STATE_RUN);
@@ -276,6 +285,8 @@ public abstract class Scene {
void closeFinished() {
sSceneManager.removeLegacyScene(this);
close();
setState(Scene.SCENE_STATE_DESTROY);
detachFromeStage();
}