Android Open Source - screenplay Scene






From Project

Back to project page screenplay.

License

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.

Java Source Code

package com.davidstemmer.screenplay.scene;
//from   w ww.  j a  va 2 s .  c o  m
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.davidstemmer.screenplay.SceneCut;
import com.davidstemmer.screenplay.flow.Screenplay;

import flow.Flow;

/**
 * Created by weefbellington on 10/2/14.
 */

/**
 * @author  David Stemmer
 * @version 1.0.0
 * @since   1.0.0
 */
public interface Scene {

    /**
     * Create the View, using the layout parameters of the Parent. After this method is called,
     * getView() should return non-null value. The View should not be attached to the parent; that is the
     * responsibility of the Scene.Rigger.
     * @param context current context
     * @param parent the container view
     * @return the created view
     */
    public View setUp(Context context, ViewGroup parent);

    /**
     * Destroy the View. After this method is called, getView() should return null. The View should
     * not be detached from its parent; that is the responsibility of the Scene.Rigger.
     * @param context the current context
     * @param parent the container view
     * @return the destroyed view
     */
    public View tearDown(Context context, ViewGroup parent);

    /**
     * Get the View associated with the Scene
     * @return the view, or null of {@link #setUp setUp} has not yet been called
     */
    public View getView();

    /**
     * @return a non-null {@link com.davidstemmer.screenplay.scene.Scene.Rigger}
     */
    public Rigger getRigger();

    /**
     * @return a non-null {@link com.davidstemmer.screenplay.scene.Scene.Transformer}
     */
    public Transformer getTransformer();

    /**
     * @author  David Stemmer
     * @version 1.0.0
     * @since   1.0.0
     */
    public static interface Component {
        /**
         * Called after {@link Scene#setUp(android.content.Context, android.view.ViewGroup)}
         * @param context the current context
         * @param scene the current scene
         * @param view the view that was set up
         */
        public void afterSetUp(Context context, Scene scene, View view);
        /**
         * Called before {@link Scene#tearDown(android.content.Context, android.view.ViewGroup)}
         * @param context the current context
         * @param scene the current scene
         * @param view the view that will be torn down
         */
        public void beforeTearDown(Context context, Scene scene, View view);
    }

    /**
     * @author  David Stemmer
     * @version 1.0.0
     * @since   1.0.0
     */
    public static interface Rigger {
        /**
         * When this method returns, the incoming scene should be attached to the parent.
         * @param parent the parent that the view should be attached to
         * @param nextView the view to attach to the parent
         * @param direction the direction of the scene transition
         */
        public void layoutIncoming(ViewGroup parent, View nextView, Flow.Direction direction);

        /**
         * When this method returns, the outgoing scene may (optionally) be detached from the parent.
         * @param parent the parent that the view should be attached to
         * @param previousView the view to detach from the parent
         * @param direction the direction of the scene transition
         * @return true if the view was detached, false otherwise
         */
        public boolean layoutOutgoing(ViewGroup parent, View previousView, Flow.Direction direction);
    }

    /**
     * @author  David Stemmer
     * @version 1.0.0
     * @since   1.0.0
     */
    public static interface Transformer {
        /**
         * Apply the animation based on the Flow.Direction. When the animation completes, it is the
         * responsibility of the Transformer to call {@link Screenplay#endCut(com.davidstemmer.screenplay.SceneCut)}
         * @param cut
         * @param listener
         */
        public void applyAnimations(SceneCut cut, Screenplay listener);
    }

}




Java Source Code List

com.davidstemmer.screenplay.MortarActivityDirector.java
com.davidstemmer.screenplay.SceneCut.java
com.davidstemmer.screenplay.SceneState.java
com.davidstemmer.screenplay.SimpleActivityDirector.java
com.davidstemmer.screenplay.flow.LayoutCompat.java
com.davidstemmer.screenplay.flow.Screenplay.java
com.davidstemmer.screenplay.sample.ApplicationTest.java
com.davidstemmer.screenplay.sample.mortar.MainActivity.java
com.davidstemmer.screenplay.sample.mortar.SampleApplication.java
com.davidstemmer.screenplay.sample.mortar.component.DrawerLockingComponent.java
com.davidstemmer.screenplay.sample.mortar.module.ActivityModule.java
com.davidstemmer.screenplay.sample.mortar.module.ApplicationModule.java
com.davidstemmer.screenplay.sample.mortar.presenter.DrawerPresenter.java
com.davidstemmer.screenplay.sample.mortar.presenter.NavigationMenuPresenter.java
com.davidstemmer.screenplay.sample.mortar.scene.ActionDrawerScene.java
com.davidstemmer.screenplay.sample.mortar.scene.DialogScene.java
com.davidstemmer.screenplay.sample.mortar.scene.PagedScene1.java
com.davidstemmer.screenplay.sample.mortar.scene.PagedScene2.java
com.davidstemmer.screenplay.sample.mortar.scene.PagedScene3.java
com.davidstemmer.screenplay.sample.mortar.scene.StackedScene.java
com.davidstemmer.screenplay.sample.mortar.scene.WelcomeScene.java
com.davidstemmer.screenplay.sample.mortar.scene.transformer.ActionDrawerTransformer.java
com.davidstemmer.screenplay.sample.mortar.scene.transformer.CrossfadeTransformer.java
com.davidstemmer.screenplay.sample.mortar.scene.transformer.HorizontalSlideTransformer.java
com.davidstemmer.screenplay.sample.mortar.scene.transformer.NavigationDrawerTransformer.java
com.davidstemmer.screenplay.sample.mortar.scene.transformer.NoAnimationTransformer.java
com.davidstemmer.screenplay.sample.mortar.scene.transformer.PopupTransformer.java
com.davidstemmer.screenplay.sample.mortar.scene.transformer.VerticalSlideTransformer.java
com.davidstemmer.screenplay.sample.mortar.view.ActionDrawerView.java
com.davidstemmer.screenplay.sample.mortar.view.DialogSceneView.java
com.davidstemmer.screenplay.sample.mortar.view.ModalSceneView.java
com.davidstemmer.screenplay.sample.mortar.view.NavigationMenuView.java
com.davidstemmer.screenplay.sample.mortar.view.PagedView1.java
com.davidstemmer.screenplay.sample.mortar.view.PagedView2.java
com.davidstemmer.screenplay.sample.mortar.view.WelcomeView.java
com.davidstemmer.screenplay.sample.simple.DrawerHelper.java
com.davidstemmer.screenplay.sample.simple.MainActivity.java
com.davidstemmer.screenplay.sample.simple.SampleApplication.java
com.davidstemmer.screenplay.sample.simple.component.DrawerLockingComponent.java
com.davidstemmer.screenplay.sample.simple.scene.ActionDrawerResult.java
com.davidstemmer.screenplay.sample.simple.scene.ActionDrawerScene.java
com.davidstemmer.screenplay.sample.simple.scene.DialogScene.java
com.davidstemmer.screenplay.sample.simple.scene.IndexedScene.java
com.davidstemmer.screenplay.sample.simple.scene.PagedScene1.java
com.davidstemmer.screenplay.sample.simple.scene.PagedScene2.java
com.davidstemmer.screenplay.sample.simple.scene.PagedScene3.java
com.davidstemmer.screenplay.sample.simple.scene.StackedScene.java
com.davidstemmer.screenplay.sample.simple.scene.WelcomeScene.java
com.davidstemmer.screenplay.sample.simple.scene.transformer.ActionDrawerTransformer.java
com.davidstemmer.screenplay.sample.simple.scene.transformer.CrossfadeTransformer.java
com.davidstemmer.screenplay.sample.simple.scene.transformer.HorizontalSlideTransformer.java
com.davidstemmer.screenplay.sample.simple.scene.transformer.NavigationDrawerTransformer.java
com.davidstemmer.screenplay.sample.simple.scene.transformer.NoAnimationTransformer.java
com.davidstemmer.screenplay.sample.simple.scene.transformer.PopupTransformer.java
com.davidstemmer.screenplay.sample.simple.scene.transformer.VerticalSlideTransformer.java
com.davidstemmer.screenplay.sample.simple.view.ActionDrawerView.java
com.davidstemmer.screenplay.sample.simple.view.DialogSceneView.java
com.davidstemmer.screenplay.sample.simple.view.ModalSceneView.java
com.davidstemmer.screenplay.sample.simple.view.NavigationMenuView.java
com.davidstemmer.screenplay.sample.simple.view.PagedView1.java
com.davidstemmer.screenplay.sample.simple.view.PagedView2.java
com.davidstemmer.screenplay.scene.Scene.java
com.davidstemmer.screenplay.scene.ScopedScene.java
com.davidstemmer.screenplay.scene.StandardScene.java
com.davidstemmer.screenplay.scene.component.CallbackComponent.java
com.davidstemmer.screenplay.scene.component.PresenterComponent.java
com.davidstemmer.screenplay.scene.component.ResultHandler.java
com.davidstemmer.screenplay.scene.component.SceneCallback.java
com.davidstemmer.screenplay.scene.rigger.PageRigger.java
com.davidstemmer.screenplay.scene.rigger.StackRigger.java
com.davidstemmer.screenplay.scene.transformer.AnimatorTransformer.java
com.davidstemmer.screenplay.scene.transformer.TweenAnimationListener.java
com.davidstemmer.screenplay.scene.transformer.TweenTransformer.java
com.example.weefbellington.screenplay.ApplicationTest.java