+1
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
I pretty sure the getter method Scene.getCurrentScene() should be promoted to be public. This method is the only option for developers to understand is the sceneRoot already in the scene they need. Otherwise they have to introduce their own states and sync it with all scene changes which is more error-prone. To make it simpler to developers we can just make the method public. As an example of usage:
void displayMessages(List<Message> messages) {
if (!messages.isEmpty()) {
if (Scene.getCurrentScene(root) != messagesScene) {
TransitionManager.go(messagesScene);
MyAnalytics.trackDisplayMessages();
(... more initialization ... )
}
messagesView.display(messages);
}
}
Test: added a cts test for getCurrentScene
Change in AndroidX: aosp/807055
Bug: 118720709
Change-Id: Ic90e3576a82b5ab9a88e38e396efd49875968011