05-24-2018 19:44 - edited 05-24-2018 19:53
05-24-2018 19:44 - edited 05-24-2018 19:53
If you define two combo buttons on different screens, the hardware button won't trigger the combo button.
@JonFitbit, there's the high severity bug making combo button widget practically unusable. Or I'm missing something.
<svg id="timer_config" display="none">
<use id="btn-br" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="icons/btn_combo_play_p.png"/>
<set href="combo-button-icon-press" attributeName="href" to="icons/btn_combo_play_press_p.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>
<svg id="timer_screen">
<use id="btn-br-2" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="icons/btn_combo_play_p.png"/>
<set href="combo-button-icon-press" attributeName="href" to="icons/btn_combo_play_press_p.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>
I can create my own implementation of the combo button which would work properly, but it defeats the whole purpose of the SDK.
I would propose to increase the size of an application heap, make widgets implementation in JS, and open source this implementation making it the part of the SDK distribution. In this case, I bet I could just fix this bug without waiting for FitBit developers who seem to be quite busy with something.
06-05-2018 17:26
06-05-2018 17:26
We still have an internal issue tracking this bug, I've asked for an update.
I believe the workaround is to use the onclick event instead of onactivate.
06-05-2018 18:08 - edited 06-05-2018 18:15
06-05-2018 18:08 - edited 06-05-2018 18:15
> I believe the workaround is to use the onclick event instead of onactivate
I tried that. The major problem is, however, that it doesn't react on the hardware button. And as far as I remember, manual event subscription for the button doesn't work as well when the combo button is present on the screen.
I would be happy to help you fix that bugs assuming that the implementation is in JS and it's open source.
08-18-2018 12:48
08-18-2018 12:48
Is there any update for a fix on this bug or is the work around still to use the onclick event?
08-20-2018 05:24
08-20-2018 05:24
@jomis003 wrote:Is there any update for a fix on this bug or is the work around still to use the onclick event?
I think the workaround is to put the combo-button inside an SVG that is inside a template and then reference it in <use>.
08-20-2018 12:29
08-20-2018 12:29
Thank EmTe
More specifically I am trying to use the combo buttons on different screens (svg's). Here is my code:
<svg id="screen1">
<rect id="background" />
<use id="btn-tr" href="#combo-button-upper-right" fill="fb-red">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>
<svg id="screen2" display="none">
<use id="btn-br" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>
When configured in this way, the physical action of pushing the button on screen1 (onactivate) is not working to move to screen2. The buttons work within a single svg.
I thought @JonFitbit said that there is still an open issue on this. I was wondering if it is still an issue.
08-21-2018 06:14
08-21-2018 06:14
You need to use templates.
<dfn>
<symbol id="screen1a">
<svg> <rect id="background" /> <use id="btn-tr" href="#combo-button-upper-right" fill="fb-red"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use> </svg>
</symbol>
<symbol id="screen2a"> <svg> <use id="btn-br" href="#combo-button-lower-right" fill="fb-peach"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use> </svg>
</symbol>
</dfn>
<use id="screen1" href="#screen1a" />
<use id="screen2" href="#screen2a" display="none" />
Something like that.
08-22-2018 11:11
08-22-2018 11:11
I am getting a whole host of errors when using that code. I was able to minimize them by moving the defs outside of the symbols but it is still not functional.
<svg>
<rect id="background" />
<defs>
<symbol id="screen1a">
<use id="btn-tr" href="#combo-button-upper-right" fill="fb-red">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</symbol>
</defs>
</svg>
<svg>
<defs>
<symbol id="screen2a">
<use id="btn-br" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</symbol>
</defs>
</svg>
<use id="screen1" href="#screen1a" />
<use id="screen2" href="#screen2a" display="none"/>
With this I am getting
Error 22 Could not find symbol '#screen2a' in screen 2
and
Error 22 Undefined attribute 'href' in screen2 (I assume because of the first error)
08-22-2018 11:22 - edited 08-22-2018 11:23
08-22-2018 11:22 - edited 08-22-2018 11:23
Two things.
First - "defs" must be in the same "svg" to be visible. That's correct code:
<svg> <rect id="background" /> <defs> <symbol id="screen1a"> <use id="btn-tr" href="#combo-button-upper-right" fill="fb-red"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use> <use id="btn-br" href="#combo-button-lower-right" fill="fb-peach"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use> </symbol> <symbol id="screen2a"> <use id="btn-br-v" href="#combo-button-lower-right" fill="fb-peach"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use> </symbol> </defs> <use id="screen1" href="#screen1a" display="none"/> <use id="screen2" href="#screen2a" /> </svg>
And the second one. This is not a workaround for anything. It's still broken in the same way as I originally described. Click at the hardware button and see yourself.
08-22-2018 11:26 - edited 08-22-2018 11:37
08-22-2018 11:26 - edited 08-22-2018 11:37
The reason for this bug is that combo button implementation assumes that there's only the single button in each corner per application, no matter are other buttons hidden or not.
This bug makes combo button useless for anything but very simple or demo apps.
No, it's not fixed yet and I wouldn't count on it to be fixed in near future. The workaround is to implement your own corner buttons.
I would add that having 64K RAM restriction and closed implementation of these widgets is one of the major and obvious design flaws of the SDK. If it would be 128K or RAM and these widgets would be available to import as JS/SVG library I would have fixed this thing already. Not a big deal at all.
It's sad that after one year since the SDK announcement it's still in "very promising" state. Could be a great product.
08-22-2018 19:54 - edited 08-22-2018 19:55
08-22-2018 19:54 - edited 08-22-2018 19:55
You forgot to add back the SVG inside the symbols to make it work. I've updated the below.
@gaperton wrote:
First - "defs" must be in the same "svg" to be visible. That's correct code:<svg> <rect id="background" /> <defs>
<svg> <symbol id="screen1a"> <use id="btn-tr" href="#combo-button-upper-right" fill="fb-red"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use> <use id="btn-br" href="#combo-button-lower-right" fill="fb-peach"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use>
</svg> </symbol> <symbol id="screen2a">
<svg> <use id="btn-br-v" href="#combo-button-lower-right" fill="fb-peach"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use>
</svg> </symbol> </defs> <use id="screen1" href="#screen1a" display="none"/> <use id="screen2" href="#screen2a" /> </svg>
08-23-2018 08:25
08-23-2018 08:25
That's right, I forgot about that. Did I make it right this time? Same thing. Unfortunately, it doesn't help.
<svg>
<rect id="background" />
<defs>
<symbol id="screen1a">
<svg>
<use id="btn-tr" href="#combo-button-upper-right" fill="fb-red">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
<use id="btn-br" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>
</symbol>
<symbol id="screen2a">
<svg>
<use id="btn-br-v" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>
</symbol>
</defs>
<use id="screen1" href="#screen1a" display="none"/>
<use id="screen2" href="#screen2a" />
</svg>
08-28-2018 05:33
08-28-2018 05:33
That indeed did work.... Thank you both.
08-28-2018 05:58 - edited 08-28-2018 06:00
08-28-2018 05:58 - edited 08-28-2018 06:00
@gaperton wrote:That's right, I forgot about that. Did I make it right this time?
@jomis003 wrote:That indeed did work.... Thank you both.
You're welcome. Please vote for my answer if it helped solve your problem.
08-28-2018 12:02
08-28-2018 12:02
Hardware button still doesn’t work, so unfortunately it’s not a workaround.
05-04-2019 17:33 - edited 05-04-2019 17:35
05-04-2019 17:33 - edited 05-04-2019 17:35
@JonFitbit yup that works for me. However, the hardware button still doesn't work.
@JonFitbit wrote:We still have an internal issue tracking this bug, I've asked for an update.
I believe the workaround is to use the onclick event instead of onactivate.