Search in sources :

Example 1 with FlowDelegate

use of flow.FlowDelegate in project mortar by square.

the class MortarDemoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GsonParceler parceler = new GsonParceler(new Gson());
    @SuppressWarnings("deprecation") FlowDelegate.NonConfigurationInstance nonConfig = (FlowDelegate.NonConfigurationInstance) getLastNonConfigurationInstance();
    MortarScope parentScope = MortarScope.getScope(getApplication());
    String scopeName = getLocalClassName() + "-task-" + getTaskId();
    activityScope = parentScope.findChild(scopeName);
    if (activityScope == null) {
        activityScope = parentScope.buildChild().withService(BundleServiceRunner.SERVICE_NAME, new BundleServiceRunner()).build(scopeName);
    }
    ObjectGraphService.inject(this, this);
    getBundleServiceRunner(activityScope).onCreate(savedInstanceState);
    actionBarOwner.takeView(this);
    setContentView(R.layout.root_layout);
    container = (PathContainerView) findViewById(R.id.container);
    containerAsHandlesBack = (HandlesBack) container;
    flowDelegate = FlowDelegate.onCreate(nonConfig, getIntent(), savedInstanceState, parceler, History.single(new ChatListScreen()), this);
}
Also used : BundleServiceRunner(mortar.bundler.BundleServiceRunner) BundleServiceRunner.getBundleServiceRunner(mortar.bundler.BundleServiceRunner.getBundleServiceRunner) FlowDelegate(flow.FlowDelegate) GsonParceler(com.example.mortar.screen.GsonParceler) MortarScope(mortar.MortarScope) ChatListScreen(com.example.mortar.screen.ChatListScreen) Gson(com.google.gson.Gson)

Aggregations

ChatListScreen (com.example.mortar.screen.ChatListScreen)1 GsonParceler (com.example.mortar.screen.GsonParceler)1 Gson (com.google.gson.Gson)1 FlowDelegate (flow.FlowDelegate)1 MortarScope (mortar.MortarScope)1 BundleServiceRunner (mortar.bundler.BundleServiceRunner)1 BundleServiceRunner.getBundleServiceRunner (mortar.bundler.BundleServiceRunner.getBundleServiceRunner)1