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

Feature request: Add 9-patch PNG support to Fitbit Studio

Fitbit OS 2.0 seems to have internal 9-patch PNG support when compiling to TXI format, but it is not opened to the Studio yet. This feature is particularly useful when customised creating frames or rectangles with customised styles like round corner. 

See the 2nd reply for more details.

 

---------------------

Original post...

Title: Round corner rectangle: How did square-button achieve it?

 

In the square-button docs under User Interface/Components/Buttons, the button have seems achieved a round-corner rectangle with 8-bit PNG images that is resizable, as it accepts fill and opacity for its colouring, but I didn't find any related resources on the documentation that does this trick. 

 

Did it use some undocumented tricks? Is it possible for us to do the same thing?

Best Answer
0 Votes
2 REPLIES 2

 

If you want to see how it's achieved, you can look into the code behind it as it's part of the simulator.

The files square_button_widget.css and square_button_widget.gui contains all the code used to draw them.

They can be found in you user directory where the simulator is installed.

for Windows users it's in: \AppData\Local\Programs\@fitbitsimulator\resources\static\devicesim\win\meson\Resources\widgets\

Best Answer

Thanks for the hint.

 

It seems that they used an Android-format 9-patch PNG for the button image. 

I've tried both to create my own 9-patch PNG and to throw in the PNG i found in that folder, they all stretch like normal image without taking consideration of the actual 9-patch configuration. However, direct reference to the .txi file like what the square-button-widget did do work. 

 

So I guess that the 9-patch PNG feature wasn't considered when compiling .txi files with FitBit Studio.

Best Answer
0 Votes