Fix scene back press inherit

This commit is contained in:
seven332 committed 2015-05-02 15:29:24 +08:00
1 parent 3578477121
commit 5916e57bc8
2 files changed
+10 -10

No files matched your search

+9 -9
View File
@@ -167,10 +167,6 @@ public abstract class Scene {
onResume();
}
void out() {
onOut();
}
void setFitPaddingBottom(int b) {
onGetFitPaddingBottom(b);
}
@@ -237,9 +233,6 @@ public abstract class Scene {
protected void onResume() {
}
protected void onOut() {
}
/**
* It will be called if nav bar is transparent.
* @param b the nav bar's height
@@ -307,12 +300,19 @@ public abstract class Scene {
getStageActivity().detachSceneFromStage(this);
}
public void onBackPressed() {
void onBackPressedInternal() {
if (!endCurtainAnimation() && !sSceneManager.endLegacyScene()) {
sSceneManager.finishScene(this);
onBackPressed();
}
}
/**
* Not all back press will call it
*/
public void onBackPressed() {
finish();
}
/**
* End curtainAnimation if it is running
*
@@ -192,7 +192,7 @@ class SceneManager {
boolean onBackPressed() {
Scene scene = getTopState();
if (scene != null) {
scene.onBackPressed();
scene.onBackPressedInternal();
return true;
} else {
Log.w(TAG, "There is no scene in the stage");