11-02-2017 23:30 - edited 11-02-2017 23:33
11-02-2017 23:30 - edited 11-02-2017 23:33
Hi Fitbit Devs,
I want to make the tile-view snap to the nearest tile so it never stops half way between. Just like it does when scrolling between app screens in the OS. I figure the best way to do this is to set the tile-view scroll position to the nearest multiple of screen height on a mouseup event.
To do this I need to be able to get and set the scroll position from javascript. Any idea if this is possible?
Cheers,
Willem
Answered! Go to the Best Answer.
Best Answer11-03-2017 16:50
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
11-03-2017 16:50
It should be:
<use id="blah" href='#tile-list'> <var id="align-mode" value="1"/>
It's not clear to me, but you may also need this:
<var id="peek-enabled" value="0"/>
Best Answer11-03-2017 11:32
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
11-03-2017 11:32
More info coming on Tile List soon, meanwhile enjoy this little gem!
align-mode='0' selects no alignment, i.e. the default behavior. align-mode='1' selects aligning the nearest item to the top of the view after the scroll ends.
Best Answer11-03-2017 13:49
11-03-2017 13:49
Ah that brilliant moment when something you think is going to be hard turns out to be super easy. Thanks Jon!
Best Answer11-03-2017 16:42
11-03-2017 16:42
Hmm now I've had a chance to try this out it doesn't seem to work. I have tried it both as
<use href="#tile-list" height="100%" width="100%"> <var id="align-mode" value="1"/>
<use href="#tile-list-item"/>
...
</use>
and
<use href="#tile-list" height="100%" width="100%" align-mode="1"> <use href="#tile-list-item"/> ... </use>
without much luck. The second one gives an error as well
"Error 22 Unknown attribute 'align-mode' in align-mode".
Is it not implemented yet?
Cheers,
Willem
Best Answer11-03-2017 16:50
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
11-03-2017 16:50
It should be:
<use id="blah" href='#tile-list'> <var id="align-mode" value="1"/>
It's not clear to me, but you may also need this:
<var id="peek-enabled" value="0"/>
Best Answer11-03-2017 17:20
11-03-2017 17:20
Still no luck. Here is my code
<use id="tileList" href="#tile-list">
<!-- <var id="reorder-enabled" value="1"/> -->
<var id="align-mode" value="1"/>
<var id="peek-enabled" value="0"/>
<use id="tile-0" href="#tile-list-item" class="tile">
<use href="#price-tile" />
</use>
<use id="tile-1" href="#tile-list-item" class="tile">
<use href="#price-tile" />
</use>
<use id="tile-2" href="#tile-list-item" class="tile">
<use href="#price-tile" />
</use>
</use>
Best Answer11-09-2017 19:43
11-09-2017 19:43
This is working now after updating to developer preview 3 🙂
Best Answer11-15-2017 02:31
11-15-2017 02:31
The Reference guide is not updated yet!
For those who wish to know how to import the tile-list widget
<link rel="import" href="/mnt/sysassets/widgets/tile_list_widget.gui"/>
Best Answer