0

I have added a common Surface and a Scrollview (actually a FlexScrollView) to a SequentialLayout and then added the layout to my View as the following code shows:

function _createCameraView() {
    var layoutViews = [];

    this.cameraView = new View({
        size: [undefined, this.options.footerSize]

    });

    var layout = new SequentialLayout({
        size: [undefined, this.options.footerSize],
        direction: Utility.Direction.Y
    });

    var backgroundSurface = new Surface({
        size: [undefined, 120],
        content: 'some content',
        classes : ['photo-guide-content'],
        properties: {
            backgroundColor: 'transparent',
            zIndex: 4
        }
    });

    // detail list
    var detailsList = new FlexScrollView({
        layout: ListLayout,
        direction: Utility.Direction.X, // set direction to horizontal
        paginated: true,
        //autoPipeEvents: true,
        useContainer: true,
        container : {
            size: [undefined, 60],
            properties : {
                'z-index' : 5,
            }
        }
    });

    layoutViews.push(backgroundSurface);
    layoutViews.push(detailsList);

    layout.sequenceFrom(layoutViews);

    this.cameraView.add(alignModifier).add(layout);
}

Then I've added a RenderController on another view and I'm using it to display my cameraView like this:

function _selectCamera() {
    if (!this.cameraView) {
        _createCameraView.call(this);
    }
    this.footerRender.hide(this.mapView);
    this.footerRender.show(this.cameraView);
}

I know I don't need to call the hide method from the render on the function above, just the show method and it should swap the views with a smooth opacity transition, which is defined by default. Although when using this Sequential Layout I'm not getting this effect. I know it has to do with this layout because I've tried to switch the layout to a FlexibleLayout and a GridLayout, and it works fine with these two. So, my question is, why doesn't work with the SequentialLayout? I've also noticed it has a method called setOutputFunction(outputFunction), is there a way to use it so the layout uses the opacity returned from the RenderController or how can it be fixed some other way?

Cassildo
  • 11
  • 1

1 Answers1

0

Try adding a getSize method to your view.

Something like this:

this.cameraView.getSize = function() {
    return [undefined, undefined];
};
  • Thanks for the answer, but I've managed to figure out what the problem was shortly after posting this question. It actually is a bug with the code from the SequentialLayout. On the bottom of the code in the commit function return { transform: parentSpec.transform, origin: parentSpec.origin, size: this.getSize(), target: result }; there is a line missing for the opacity where it should be opacity: parentSpec.opacity I searched the repository and checked that an issue and solution had already been created for this problem/bug. – Cassildo Jan 19 '15 at 17:00