mListener.done(Status.SUCCESS.createResult());
} catch (Throwable throwable) {
- Bridge.getLog().error(null, "Error playing animation", throwable);
+ // can't use Bridge.getLog() as the exception might be thrown outside
+ // of an acquire/release block.
+ mSession.getLog().error(null, "Error playing animation", throwable);
+ mListener.done(Status.ERROR_UNKNOWN.createResult("Error playing animation", throwable));
} finally {
postAnimation();
import com.android.ide.common.rendering.api.IAnimationListener;
import com.android.ide.common.rendering.api.ILayoutPullParser;
import com.android.ide.common.rendering.api.IProjectCallback;
+import com.android.ide.common.rendering.api.LayoutLog;
import com.android.ide.common.rendering.api.Params;
import com.android.ide.common.rendering.api.RenderSession;
import com.android.ide.common.rendering.api.ResourceDensity;
previousParent.setLayoutTransition(removeTransition);
// no fade-out
- removeTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
+ // FIXME: set a non-null do-nothing Animator.
+ // setting a null animator doesn't work because the child gets its parent
+ // set to null too late.
+ //removeTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
// now for the new parent, if different
if (previousParent != newParentView) {
LayoutTransition addTransition = new LayoutTransition();
// no fade-in
- addTransition.setAnimator(LayoutTransition.APPEARING, null);
+ // FIXME: set a non-null do-nothing Animator.
+ // setting a null animator doesn't work because the child gets its parent
+ // set to null too late.
+ //addTransition.setAnimator(LayoutTransition.APPEARING, null);
newParentView.setLayoutTransition(addTransition);
}
}
/**
+ * Returns the log associated with the session.
+ * @return the log or null if there are none.
+ */
+ public LayoutLog getLog() {
+ if (mParams != null) {
+ return mParams.getLog();
+ }
+
+ return null;
+ }
+
+ /**
* Checks that the lock is owned by the current thread and that the current context is the one
* from this scene.
*