FileDocCategorySizeDatePackage
BridgeRenderSession.javaAPI DocAndroid 5.1 API6129Thu Mar 12 22:22:44 GMT 2015com.android.layoutlib.bridge

BridgeRenderSession

public class BridgeRenderSession extends com.android.ide.common.rendering.api.RenderSession
An implementation of {@link RenderSession}. This is a pretty basic class that does almost nothing. All of the work is done in {@link RenderSessionImpl}.

Fields Summary
private final com.android.layoutlib.bridge.impl.RenderSessionImpl
mSession
private com.android.ide.common.rendering.api.Result
mLastResult
Constructors Summary
BridgeRenderSession(com.android.layoutlib.bridge.impl.RenderSessionImpl scene, com.android.ide.common.rendering.api.Result lastResult)

        mSession = scene;
        if (scene != null) {
            mSession.setScene(this);
        }
        mLastResult = lastResult;
    
Methods Summary
public com.android.ide.common.rendering.api.Resultanimate(java.lang.Object targetObject, java.lang.String animationName, boolean isFrameworkAnimation, com.android.ide.common.rendering.api.IAnimationListener listener)

        try {
            Bridge.prepareThread();
            mLastResult = mSession.acquire(RenderParams.DEFAULT_TIMEOUT);
            if (mLastResult.isSuccess()) {
                mLastResult = mSession.animate(targetObject, animationName, isFrameworkAnimation,
                        listener);
            }
        } finally {
            mSession.release();
            Bridge.cleanupThread();
        }

        return mLastResult;
    
public voiddispose()

    
public java.util.MapgetDefaultProperties(java.lang.Object viewObject)

        return mSession.getDefaultProperties(viewObject);
    
public java.awt.image.BufferedImagegetImage()

        return mSession.getImage();
    
public com.android.ide.common.rendering.api.ResultgetProperty(java.lang.Object objectView, java.lang.String propertyName)

        // pass
        return super.getProperty(objectView, propertyName);
    
public com.android.ide.common.rendering.api.ResultgetResult()

        return mLastResult;
    
public java.util.ListgetRootViews()

        return mSession.getViewInfos();
    
public java.util.ListgetSystemRootViews()

        return mSession.getSystemViewInfos();
    
public com.android.ide.common.rendering.api.ResultinsertChild(java.lang.Object parentView, com.android.ide.common.rendering.api.ILayoutPullParser childXml, int index, com.android.ide.common.rendering.api.IAnimationListener listener)

        if (parentView instanceof ViewGroup == false) {
            throw new IllegalArgumentException("parentView is not a ViewGroup");
        }

        try {
            Bridge.prepareThread();
            mLastResult = mSession.acquire(RenderParams.DEFAULT_TIMEOUT);
            if (mLastResult.isSuccess()) {
                mLastResult = mSession.insertChild((ViewGroup) parentView, childXml, index,
                        listener);
            }
        } finally {
            mSession.release();
            Bridge.cleanupThread();
        }

        return mLastResult;
    
public booleanisAlphaChannelImage()

        return mSession.isAlphaChannelImage();
    
public com.android.ide.common.rendering.api.ResultmoveChild(java.lang.Object parentView, java.lang.Object childView, int index, java.util.Map layoutParams, com.android.ide.common.rendering.api.IAnimationListener listener)

        if (parentView instanceof ViewGroup == false) {
            throw new IllegalArgumentException("parentView is not a ViewGroup");
        }
        if (childView instanceof View == false) {
            throw new IllegalArgumentException("childView is not a View");
        }

        try {
            Bridge.prepareThread();
            mLastResult = mSession.acquire(RenderParams.DEFAULT_TIMEOUT);
            if (mLastResult.isSuccess()) {
                mLastResult = mSession.moveChild((ViewGroup) parentView, (View) childView, index,
                        layoutParams, listener);
            }
        } finally {
            mSession.release();
            Bridge.cleanupThread();
        }

        return mLastResult;
    
public com.android.ide.common.rendering.api.ResultremoveChild(java.lang.Object childView, com.android.ide.common.rendering.api.IAnimationListener listener)

        if (childView instanceof View == false) {
            throw new IllegalArgumentException("childView is not a View");
        }

        try {
            Bridge.prepareThread();
            mLastResult = mSession.acquire(RenderParams.DEFAULT_TIMEOUT);
            if (mLastResult.isSuccess()) {
                mLastResult = mSession.removeChild((View) childView, listener);
            }
        } finally {
            mSession.release();
            Bridge.cleanupThread();
        }

        return mLastResult;
    
public com.android.ide.common.rendering.api.Resultrender(long timeout)

        try {
            Bridge.prepareThread();
            mLastResult = mSession.acquire(timeout);
            if (mLastResult.isSuccess()) {
                mLastResult = mSession.render(false /*freshRender*/);
            }
        } finally {
            mSession.release();
            Bridge.cleanupThread();
        }

        return mLastResult;
    
public com.android.ide.common.rendering.api.ResultsetProperty(java.lang.Object objectView, java.lang.String propertyName, java.lang.String propertyValue)

        // pass
        return super.setProperty(objectView, propertyName, propertyValue);