ViewControllerFactoryBuilder

In package com.nhaarman.acorn.android.presentation

class com.nhaarman.acorn.android.presentation.ViewControllerFactoryBuilder

A DSL that can create ViewControllerFactory instances by binding Scene keys to inflatable layouts.

Methods

fun bindView(sceneKey: SceneKey, layoutResId: Int, wrapper: ()->ViewController)

Binds Scenes with given sceneKey to the layout with given layoutResId.

Parameters:
  • sceneKey: SceneKey

    The key of the scene, as provided by Scene.key.

  • layoutResId: Int

    The layout resource identifier to inflate for the Scene.

  • wrapper: ()->ViewController

    A function that takes in the inflated layout and returns a ViewController instance that can be passed to the Scene.

fun bindViewGroup(sceneKey: SceneKey, layoutResId: Int, wrapper: ()->ViewController)

Binds Scenes with given sceneKey to the layout with given layoutResId.

Parameters:
  • sceneKey: SceneKey

    The key of the scene, as provided by Scene.key.

  • layoutResId: Int

    The layout resource identifier to inflate for the Scene.

  • wrapper: ()->ViewController

    A function that takes in the inflated layout and returns a ViewController instance that can be passed to the Scene.

fun <V> bind(sceneKey: SceneKey, layoutResId: Int, wrapper: (V)->ViewController)

Binds Scenes with given sceneKey to the layout with given layoutResId.

Parameters:
  • sceneKey: SceneKey

    The key of the scene, as provided by Scene.key.

  • layoutResId: Int

    The layout resource identifier to inflate for the Scene.

  • wrapper: (V)->ViewController

    A function that takes in the inflated layout and returns a ViewController instance that can be passed to the Scene.