mirror of
https://github.com/seven332/EhViewer
synced 2026-11-26 17:18:06 +08:00
Add getTopController() and popTopController() to ControllerActivity
This commit is contained in:
1 parent
fffa300d47
commit
2890cbd732
1 file changed
+24
@@ -64,6 +64,30 @@ public abstract class ControllerActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the top {@code Controller}.
|
||||
*/
|
||||
@Nullable
|
||||
public Controller getTopController() {
|
||||
if (router != null) {
|
||||
return router.getCurrentController();
|
||||
} else {
|
||||
Log.e(LOG_TAG, "router == null, can't get top controller");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pops the top {@code Controller} in this {@code ControllerActivity}.
|
||||
*/
|
||||
public void popTopController() {
|
||||
if (router != null) {
|
||||
router.popCurrentController();
|
||||
} else {
|
||||
Log.e(LOG_TAG, "router == null, can't pop top controller");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a {@code Controller} to this {@code ControllerActivity}.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user