Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a4ae8185 authored by Andrey Kulikov's avatar Andrey Kulikov
Browse files

Make transitions Scene.getCurrentScene() public

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
parent d33b50a6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment