package com.jimulabs.mirrorsandbox;

import android.view.View;

/**
 * MirrorSandbox classes are considered "design mode" code for quick experiments or populating views
 * with mock data. Think of it as a REPL for Android UI (layouts and animations) when used in
 * combination with the Java code hot-swapping of Mirror.
 * <p/>
 * Mirror uses classes that implement this interface and set the "sandbox" attribute of
 * a mirror screen file:
 * <p/>
 * &lt;screen sandbox="foo.bar.BarBox"&gt;
 * <p/>
 * In most cases, you can subclass {@link com.jimulabs.mirrorsandbox.MirrorSandboxBase} which
 * provides some base implementations.
 * <p/>
 * Created by lintonye on 2014-12-23.
 */
public interface MirrorSandbox {
    /**
     * Mirror calls this method from the UI thread right after the sandbox object is created, BEFORE
     * the layout pass is done.
     * <p/>
     * Methods with the prefix '$' are considered as "design mode" methods used for quick experiments
     * or populating views with mock data. Do not call from production code.
     *
     * @param rootView the root view that can be used to find child views in the layout
     */
    void $onCreate(View rootView);

    /**
     * Mirror calls this method from the UI thread after the layout pass for the entire screen finishes.
     * Methods such as View#getMeasuredWidth() will return proper values.
     * <p/>
     * Methods with the prefix '$' are considered as "design mode" methods used for quick experiments
     * or populating views with mock data. Do not call from production code.
     *
     * @param rootView the root view that can be used to find child views in the layout
     */
    void $onLayoutDone(View rootView);

    /**
     * Mirror calls this method from the UI thread in the Activity#onDestroy() call back.
     * This method can be used to release things that are not supposed to be persist across refreshes.
     * <p/>
     * Methods with the prefix '$' are considered as "design mode" methods used for quick experiments
     * or populating views with mock data. Do not call from production code.
     */
    void $onDestroy();
}

@@ -850,17 +850,79 @@
 is done.
+ This method can be used for sandbox-only initialization code.
 %0A
-
      * %3C
@@ -1095,32 +1095,179 @@
 production code.
+ However, it is encouraged%0A     * to call other methods in the sandbox class from production code to reuse the code written in%0A     * sandbox mode.
 %0A     *%0A     * @
@@ -1763,24 +1763,171 @@
 uction code.
+ However, it is encouraged%0A     * to call other methods in the sandbox class from production code to reuse the code written in%0A     * sandbox mode.
 %0A     *%0A    
@@ -2365,32 +2365,32 @@
 ick experiments%0A
-
      * or popula
@@ -2445,24 +2445,171 @@
 uction code.
+ However, it is encouraged%0A     * to call other methods in the sandbox class from production code to reuse the code written in%0A     * sandbox mode.
 %0A     */%0A   

Update comments