Back to project page screenplay.
The source code is released under:
MIT License
If you think the Android project screenplay listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.davidstemmer.screenplay.scene.component; // w w w . ja va 2s . c o m import android.content.Context; import android.view.View; import com.davidstemmer.screenplay.scene.Scene; /** * Created by weefbellington on 11/10/14. */ public class CallbackComponent<R> implements Scene.Component { private final SceneCallback<R> callback; private final ResultHandler<R> resultHandler; public CallbackComponent(SceneCallback<R> callback, ResultHandler<R> resultHandler) { this.callback = callback; this.resultHandler = resultHandler; } @Override public void afterSetUp(Context context, Scene scene, View view) {} @Override public void beforeTearDown(Context context, Scene scene, View view) { callback.onExitScene(resultHandler.getResult()); resultHandler.reset(); } }