Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Checkboxes on SDK 5

ANSWERED

I know that there was a checkbox element for sdk 4, but is there one on sdk 5? 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Maybe. I haven't tried it, but consider this:

<link rel="import" href="/mnt/sysassets/widgets/checkbox.defs" />

 

<use href="#checkbox" value="1" />
Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
0 Votes
6 REPLIES 6

Maybe. I haven't tried it, but consider this:

<link rel="import" href="/mnt/sysassets/widgets/checkbox.defs" />

 

<use href="#checkbox" value="1" />
Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thanks! It is working great.

Best Answer

Hi - thanks for this advice, changing the defs and the href did get rid of the errors in the simulator.

However I've still got problems

```

    <symbol id="tile-item" href="#tile-list-item" focusable="false" pointer-events="none" system-events="all" display="none">
      <rect id="item-background" x="0" y="0" width="100%" height="100%"/>
      <use id="item-text" href="#checkbox" pointer-events="all" value="0">
        <set href="header/text" attributeName="text-buffer" to="item-text" />
      </use>
      <rect id="tile-divider-bottom" class="tile-divider-bottom" />
    </symbol>
 
```
"header/text" of the checkbox does not exist and I cannot seem to be able to set the text of the checkbox from code
```
      configureTile: (tileinfo=> {
        if (info.data.type === "header") {
          tile.getElementById("item-header-text").text = info.data.text;
        } else {
          const bg = tile.getElementById("item-background");
          const checkBoxTile = tile.getElementById("item-text");
          const textArea = checkBoxTile.getElementById("header");

          checkBoxTile.text = info.data.text;

          if (info.data.selected) {
            checkBoxTile.value = 1;
          } else {
            checkBoxTile.value = 0;
          }
```
Its all a bit hard, does anyone know if there is any documentation for checkboxes in OS5?
Best Answer
0 Votes

Hello derekwilson, I am also trying to do something similar with the checkbox and I am running in the same issue. Have you found a solution? Thank you!

Best Answer

Hi

Sorry to say I haven't found any documentation on the checkbox widget from the SDK and trying to guess what to do was too inefficient and also probably not supported.

 

In the end I reimplemented the checkbox functionality using the fitbit design assets.

 

I blogged about it here

http://derekwilson.net/blog/2021/02/25/porting-wrist-list-to-fitbit-os5

 

My app is open source so feel free to copy my code, if you make the implementation more generic I may even copy it back 🙂
https://bitbucket.org/derekwilson/wrist-list/src/master/Fitbit-os5/

 

Hope this helps

Derek

 

Best Answer
0 Votes

Hi,
I was also looking for how to implement a checkbox for the Fitbit SDK 6 and found your answer.
Many thanks for that!

But it seems to me that the checkbox.defs widget is undocumented.
At least when I look through the official documentation from Fitbit in the User Interface Guide 

I also found out there is a toggle component in a widget called /mnt/sysassets/widgets/toggle_switch.defs which also seems to be undocumented.

So my questions are:
1. Are there any other undocumented widgets for the Fitbit SDK 6?
Maybe there is a widget for radio buttons as well?

2. How did you know about the 
/mnt/sysassets/widgets/checkbox.defs widget?

Thx!

Best Answer
0 Votes