package com.kodroid.pilot.lib.android.frameBacking;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;

/**
 * Convenience FrameLayout base for BackedByFrame backed views. Custom views do not have to use this as
 * long as they conform to the {@link PilotFrameBackedUI} interface.
 *
 * @param <P> The BackedByFrame (controller / whatever) you want to use for this view. Support for thin
 *           views but easily usable with fragments.
 */
public abstract class PilotFrameLayout<P> extends FrameLayout implements PilotFrameBackedUI<P>
{
    //==================================================================//
    // Fields
    //==================================================================//

    private P mBackingPilotFrame;

    //==================================================================//
    // Constructor
    //==================================================================//

    public PilotFrameLayout(Context context)
    {
        super(context);
    }

    public PilotFrameLayout(Context context, AttributeSet attrs, int defStyleAttr)
    {
        super(context, attrs, defStyleAttr);
    }

    //==================================================================//
    // BackedByFrame IOC
    //==================================================================//

    /**
     * Subclasses can override this but will need to call super(). If any child views use child Presenters
     * these can be grabbed from this (parent) PilotFrame on this method call.
     *
     * @param backingPilotFrame
     * @return
     */
    public View setBackingPilotFrame(P backingPilotFrame)
    {
        mBackingPilotFrame = backingPilotFrame;
        return this;
    }

    protected P getBackingPilotFrame()
    {
        return mBackingPilotFrame;
    }

    @Override
    public void backingFrameSet(P backingPilotFrame) {
        //do nothing - subclasses can override
    }
}

@@ -1060,24 +1060,133 @@
 xt);%0A    %7D%0A%0A
+    public PilotFrameLayout(Context context, AttributeSet attrs)%0A    %7B%0A        super(context, attrs);%0A    %7D%0A%0A
     public P

add missing cnstr