<commit_before>package com.davidstemmer.screenplay.scene;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

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

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

/**
 * @author  <NAME>
 * @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  <NAME>
     * @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  <NAME>
     * @version 1.0.0
     * @since   1.0.0
     */
    public static interface Rigger {
        /**
         * Layout the next (incoming) scene. When this method returns, the next scene should be
         * attached to the parent.
         * @param context the current context
         * @param parent the parent that the view should be attached to
         * @param cut contains the next and previous scene, and the flow direction
         */
        public void layoutNext(Context context, ViewGroup parent, SceneCut cut);

        /**
         * Layout the previous (outgoing) scene. When this method returns, the previous scene may
         * (but is not necessarily) detached from the parent.
         * @param context the current context
         * @param parent the parent that the view should be detached from
         * @param cut contains the next and previous scene, and the flow direction
         */
        public void layoutPrevious(Context context, ViewGroup parent, SceneCut cut);
    }

    /**
     * @author  <NAME>
     * @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);<commit_msg>Simplify the Rigger. It no longer requires a SceneCut or a Context, just a parent, a child and a flow direction.<commit_after>package com.davidstemmer.screenplay.scene;

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  <NAME>
 * @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  <NAME>
     * @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  <NAME>
     * @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
         */
        public void layoutOutgoing(ViewGroup parent, View previousView, Flow.Direction direction);
    }

    /**
     * @author  <NAME>
     * @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);
{'fraction_non_alphanumeric': 0.08682597272613538, 'fraction_numerical': 0.007256349305642437, 'mean_word_length': 2.397365065873353, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2015067', 'n_tokens_mistral': 2176, 'n_tokens_neox': 2095, 'n_words': 819}