SceneViewControllerFactory

In package com.nhaarman.acorn.android.presentation

class com.nhaarman.acorn.android.presentation.SceneViewControllerFactory

A ViewControllerFactory that uses the Scene itself to create ViewController instances.

This class only supports Scenes that implement the ViewControllerFactory interface.

Methods

fun supports(scene: Scene): Boolean

Returns true when this ViewControllerFactory can create a ViewController when viewControllerFor is called. If this method returns false for a specific SceneKey, no calls to viewControllerFor with the same SceneKey must be made.

Parameters:
fun viewControllerFor(scene: Scene, parent: ): ViewController

Creates a ViewController for given Scene key.

Parameters:
  • scene: Scene

    The key of the Scene instance for which the corresponding view should be created.

  • parent:

    This is the parent View that the resulting View should be attached to. The implementation must not add the View to the parent itself, but it can use the parent to generate the LayoutParams of the view.