03-01-2018 23:55
03-01-2018 23:55
Is there a checkbox component that I can use in my application? The fitbit alarm app has one but i'm not sure if it just undocumented like the Tumbler component or just a custom control of the app.
Answered! Go to the Best Answer.
Best Answer03-02-2018 10: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.
03-02-2018 10:32
Sorry we're falling short in the documentation, we'll have more soon!
I hope this helps:
<!-- widgets.gui -->
<svg>
<defs>
<link rel="stylesheet" href="styles.css" />
<link rel="import" href="/mnt/sysassets/widgets_common.gui" />
<!-- Additional imports -->
<link rel="import" href="/mnt/sysassets/widgets/tile_list_widget.gui" />
<link rel="import" href="/mnt/sysassets/widgets/checkbox_tile_widget.gui" />
<!-- Custom tile list item with checkbox -->
<symbol id='log-checkbox-tile' href='#tile-list-item'>
<use id="log-checkbox" href='#checkbox-tile'/>
</symbol>
</defs>
</svg>
<!-- index.gui -->
<svg> <use id="my-list" href="#tile-list" class="application-color"> <!-- specify how many pixels of the content are taken by separators --> <var id="separator-height-bottom" value="2"/> <!-- disable tile list reordering --> <var id="reorder-enabled" value="0"/> <use id="log1" href="#log-checkbox-tile" class="tile"> <set href="log-checkbox/header/text" attributeName="text-buffer" to="Log 1" /> </use> <use id="log2" href="#log-checkbox-tile" class="tile"> <set href="log-checkbox/header/text" attributeName="text-buffer" to="Log 2" /> </use> <use id="log3" href="#log-checkbox-tile" class="tile"> <set href="log-checkbox/header/text" attributeName="text-buffer" to="Log 3" /> </use> </use> </svg>
// app/index.js
import document from "document";
let list = document.getElementById("my-list");
let tiles = list.getElementsByClassName("tile");
// manually track the checked state
let mystate = {}
tiles.forEach((element, index) => {
element.firstChild.onclick = (evt) => {
mystate[index] = !mystate[index];
console.log(`item ${index} checked = ${mystate[index]}`)
};
});
03-02-2018 01:14
03-02-2018 01:14
We are still awaiting quite a bit of documentation.
Maybe @JonFitbit would post some examples as he so kindly did for the other components ![]()
Best Answer03-02-2018 10: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.
03-02-2018 10:32
Sorry we're falling short in the documentation, we'll have more soon!
I hope this helps:
<!-- widgets.gui -->
<svg>
<defs>
<link rel="stylesheet" href="styles.css" />
<link rel="import" href="/mnt/sysassets/widgets_common.gui" />
<!-- Additional imports -->
<link rel="import" href="/mnt/sysassets/widgets/tile_list_widget.gui" />
<link rel="import" href="/mnt/sysassets/widgets/checkbox_tile_widget.gui" />
<!-- Custom tile list item with checkbox -->
<symbol id='log-checkbox-tile' href='#tile-list-item'>
<use id="log-checkbox" href='#checkbox-tile'/>
</symbol>
</defs>
</svg>
<!-- index.gui -->
<svg> <use id="my-list" href="#tile-list" class="application-color"> <!-- specify how many pixels of the content are taken by separators --> <var id="separator-height-bottom" value="2"/> <!-- disable tile list reordering --> <var id="reorder-enabled" value="0"/> <use id="log1" href="#log-checkbox-tile" class="tile"> <set href="log-checkbox/header/text" attributeName="text-buffer" to="Log 1" /> </use> <use id="log2" href="#log-checkbox-tile" class="tile"> <set href="log-checkbox/header/text" attributeName="text-buffer" to="Log 2" /> </use> <use id="log3" href="#log-checkbox-tile" class="tile"> <set href="log-checkbox/header/text" attributeName="text-buffer" to="Log 3" /> </use> </use> </svg>
// app/index.js
import document from "document";
let list = document.getElementById("my-list");
let tiles = list.getElementsByClassName("tile");
// manually track the checked state
let mystate = {}
tiles.forEach((element, index) => {
element.firstChild.onclick = (evt) => {
mystate[index] = !mystate[index];
console.log(`item ${index} checked = ${mystate[index]}`)
};
});
05-12-2018 14:14
05-12-2018 14:14
Hi :), can the checkbox component be used inside other components such as a panoramaview?
12-13-2022 11:24
12-13-2022 11:24
Hi Jon! Does this checkbox still work for Sense 2 devices? I tried it in my clockface for Sense2, but it does not seem work do anything. Nothing appears on the UI.
Best Answer12-13-2022 15:27
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
12-13-2022 15:27
@barbossaNot until an SDK for Sense 2 is released. A date hasn't been set for that.
Best Answer