Search in sources :

Example 1 with BaseKey

use of com.example.mortar.util.BaseKey in project simple-stack by Zhuinden.

the class MortarDemoActivity method handleStateChange.

@Override
public void handleStateChange(StateChange stateChange, Callback completionCallback) {
    BaseKey newScreen = stateChange.topNewState();
    String title = newScreen.title();
    ActionBarOwner.MenuAction menu = new ActionBarOwner.MenuAction("Friends", new Action() {

        @Override
        public void run() throws Exception {
            Navigator.getBackstack(MortarDemoActivity.this).goTo(FriendListScreen.create());
        }
    });
    actionBarOwner.setConfig(new ActionBarOwner.Config(false, !(newScreen instanceof ChatListScreen), title, menu));
    completionCallback.stateChangeComplete();
}
Also used : Action(io.reactivex.functions.Action) ChatListScreen(com.example.mortar.screen.ChatListScreen) BaseKey(com.example.mortar.util.BaseKey) ActionBarOwner(com.example.mortar.android.ActionBarOwner)

Aggregations

ActionBarOwner (com.example.mortar.android.ActionBarOwner)1 ChatListScreen (com.example.mortar.screen.ChatListScreen)1 BaseKey (com.example.mortar.util.BaseKey)1 Action (io.reactivex.functions.Action)1