DoBeforeTransition

In package com.nhaarman.acorn.android.transition

class com.nhaarman.acorn.android.transition.DoBeforeTransition

A SceneTransition implementation that can execute an action before a delegate SceneTransition is executed.

This can be used to hide the keyboard before the transition starts, for example.

Methods

fun execute(parent: , callback: Callback)

Executes the transition.

Implementers of this interface have full control over parent and must update its child hierarchy accordingly. That means any old views should be removed and new views must be inflated and added to the parent.

When the transition is done, implementers must always invoke Callback.onComplete. Optionally, Callback.attach can be invoked to attach the resulting Container to the Scene before the transition has finished.

Parameters:
  • parent:

    The ViewGroup that hosts the application UI, with the views from the previous Scene still attached.

  • callback: Callback

    The Callback whose Callback.onComplete method must be invoked when the transition is done.

Extensions

fun SceneTransition.doOnStart(action: ()->Unit): SceneTransition

Returns a SceneTransition that runs action before the receiving SceneTransition instance is started.

Parameters:
  • action: ()->Unit

    The action to run.

fun SceneTransition.hideKeyboardOnStart(): SceneTransition

Returns a new SceneTransition instance that hides the keyboard before the receiving SceneTransition is invoked.

Parameters:
  • No parameters