bbc / tal

TV Application Layer

Home Page:http://bbc.github.com/tal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix the alignment of a Carousel once reaching X number of last items

clayton93 opened this issue · comments

We have a Carousel widget with a CullingStrip set and are having trouble with attempting a different alignment and focusing on an active child once you reach the end of the carousel.

Our issue is described perfectly by issue #473 apart from the image provided which doesn't seem to match the functionality asked in the question...

To re-iterate, once there are only the number of items left to fill each remaining space in the carousel without leaving whitespace we want the alignment to stay fixed but the focus to continue across to the end of the carousel.

Reading the TAL website, this behaviour also seems to be described here as:

This can make layout easier, for example if the first item you can see is always flush with the left edge of the carousel but the active item should always be the third visible item, you can ask for this directly rather then having to calculate any offsets.

But the described methods below it do not provide that functionality, namely setActiveIndex() and setActiveWidget().

We have tried many, many different ways of achieving this such as with alignToIndex() and setActiveChildIndex() on the beforealign event but no luck.


I have tried to describe this in the below graphic. The bold item is what is focussed and the contents of the curly braces shows what is in the mask (on-screen) at the time.

What is happening:

{ [1] [2] [3] } [4] [5] [6] [7]
[1] { [2] [3] [4] } [5] [6] [7]
...
[1] [2] [3] [4] { [5] [6] [7] }
[1] [2] [3] [4] [5] { [6] [7] }
[1] [2] [3] [4] [5] [6] { [7] }

What we want:

{ [1] [2] [3] } [4] [5] [6] [7]
[1] { [2] [3] [4] } [5] [6] [7]
...
[1] [2] [3] [4] { [5] [6] [7] }
[1] [2] [3] [4] { [5] [6] [7] }
[1] [2] [3] [4] { [5] [6] [7] }

We have deprecated this project and there are no plans for active development going forward.

Please see the deprecation notice.