• Administrator
  •  
    Support Ukraine
    If you experience any problems with the forum (it is not visible, there is no way to post messages, or some functionality does not work), please let us know. If you have problems with registration or you did not receive confirmation letter, let us know and we will activate your account manually.
    If you get an "The submitted form was invalid. Try submitting again" error, delete cookies, then try again.
     

Question about the xml components

Archive closed topics

Moderators: Internal error, Watchmens

AlainProvist
WF maker
Posts: 37
Joined: 23 Sep 2020, 23:34
Location: France
Has thanked: 6 times
Been thanked: 2 times
Contact:

Post by AlainProvist »

Graduation is just an image you can draw separately from your background image in case you want to customize it differently from the background.
User avatar
DxP
Posts: 41
Joined: 10 Jun 2020, 19:31
Location: Germany
Has thanked: 2 times
Been thanked: 18 times
Contact:

Post by DxP »

ok... I will try a little bit with graduation. It is a second background, like a overlay?

This syntax?

Code: Select all

<WatchFaceComponent type="Graduation" config="@wfz/graduation/0.png"  />


btw. I tested the "Goal" Component...but I doesn't work. I tried this code variants:

Code: Select all

<WatchFaceComponent type="Goal" dataType="1" x="250" y="85" config="@wfz/steps/goal.png"  />

Code: Select all

<WatchFaceComponent type="Goal" x="250" y="85" config="@wfz/steps/goal.png"  />

Code: Select all

<WatchFaceComponent type="gtrwidget" dataType="1">
		<Item type="Goal" x="250" y="85" config="@wfz/steps/goal.png"/>
</WatchFaceComponent>
Any idea?
AlainProvist
WF maker
Posts: 37
Joined: 23 Sep 2020, 23:34
Location: France
Has thanked: 6 times
Been thanked: 2 times
Contact:

Post by AlainProvist »

It's case sensitive:

Code: Select all

<WatchFaceComponent type="goal" dataType="1" x="250" y="85" config="@wfz/steps/goal.png"  />
Be aware that the goal limit seems to be hardcoded to 8000 steps. So the image for the goal will only be displayed once the goal is reached.

About graduation it's a watchfaceitem and it will take both 8c and 26w folders into account if you have them ;).
User avatar
DxP
Posts: 41
Joined: 10 Jun 2020, 19:31
Location: Germany
Has thanked: 2 times
Been thanked: 18 times
Contact:

Post by DxP »

Thanks, I thought so, but it was already too late yesterday to test it, I always have to get up early.

With a hardcoded target value, that doesn't make much sense either.
User avatar
DxP
Posts: 41
Joined: 10 Jun 2020, 19:31
Location: Germany
Has thanked: 2 times
Been thanked: 18 times
Contact:

Post by DxP »

I saw something strange there. With my ProMaster 2watch face, the graphic display of the steps suddenly no longer shows a graphic when the target value is reached. As if no steps were taken yet.

The ProMaster 2 worked with "gtrwidget" instead of "progress".

The parameter "continueMode" seems to be to blame. If it is set to "1", the behavior mentioned occurs. If I change the value to "0" it works normally again.

Anyone an idea? Does the app code provide anything?
PS: I've uploded a version with "continueMode="0" at the moment....

----

Edit: It gets really exciting with Scrapyard Dashboard. It works without problems despite continueMode = "1". The only difference, here there are only 3 graphics instead of 10 in Promaster 2.

I have no idea what goes wrong.
AlainProvist
WF maker
Posts: 37
Joined: 23 Sep 2020, 23:34
Location: France
Has thanked: 6 times
Been thanked: 2 times
Contact:

Post by AlainProvist »

That's funny because I just litterally lost 2 hours figuring why 1 of my graduation in my config list was not showing in sleep mode when all the other were.

It's not the first time this happens to me and I think I finally found the reason. It seems to be caused by the bit transparency of images. When you save a png, you can either use 24bits RGB with bit transparency (basically one color replaced by transparent pixels), or 32bits ARGB with full 8bit transparency.

Now if you chose the first option, this can cause elements to disappear depending some magical piece of garbage black voodoo magic I can't even totally understand. I suspect the bit transparency could be reused from an image to another, making opaque pixels finally disappear too.

I came to this conclusion after my white colored graduation saved with black transparent pixel background suddenly dissapear after I edited the images of some other images. Then I save it in 32bits ARGB and everything works again... What is a bit crazy is that this image was working for nearly a week in 24bits before it suddenly stopped working.
User avatar
DxP
Posts: 41
Joined: 10 Jun 2020, 19:31
Location: Germany
Has thanked: 2 times
Been thanked: 18 times
Contact:

Post by DxP »

All my graphics are in 32 bit - funny
AlainProvist
WF maker
Posts: 37
Joined: 23 Sep 2020, 23:34
Location: France
Has thanked: 6 times
Been thanked: 2 times
Contact:

Post by AlainProvist »

OMG you're right, the code is bugged there too:

Code: Select all

if (this.mDatatype == 1) {
                this.mDataResult = new BigDecimal(values[0].intValue()).floatValue();
                this.progress = this.mDataResult / ((float) values[1].intValue());
                if (this.mAdditiveBitmapCount > 0) {
                    this.mAdditiveIndex = ((int) (this.progress * ((float) this.mAdditiveBitmapCount))) - 1;
                }
            }
this.mAdditiveIndex is not clamped between 0 and this.mAdditiveBitmapCount -1. So when the steps go over 8000,

Code: Select all

this.progress * ((float) this.mAdditiveBitmapCount
will go over this.mAdditiveBitmapCount. So when the steps are over 8000/this.mAdditiveBitmapCount + 8000, this.mAdditiveIndex will reach this.mAdditiveBitmapCount wich is no more a valid index to display. ContinueMode will just draw nothing, but when off the loop will still display all the images before doing the empty iterations, which explain why continueMode = 0 will work even if bugged too.
User avatar
DxP
Posts: 41
Joined: 10 Jun 2020, 19:31
Location: Germany
Has thanked: 2 times
Been thanked: 18 times
Contact:

Post by DxP »

I found another bug related to the display of units for distance. I leave the unit "km" with the charset = ";" > Show "km.png" in the "font.xml". As long as the units are set to "metric" in the Zepp app, everything works. If you set it to "imperial", the units in active mode disappear. As far as understandable, I didn't have any graphics for miles. But, in "locked mode" the unit "km" is back. No idea why.

I would be interested in how I can define "miles" in the "charset". Got through pretty much all of the signs, no success. Can you deduce something from the firmware code?
AlainProvist
WF maker
Posts: 37
Joined: 23 Sep 2020, 23:34
Location: France
Has thanked: 6 times
Been thanked: 2 times
Contact:

Post by AlainProvist »

It's supposed to be "!" char in the charset for miles. I did not verify this work correctly though...

By the way, I just released my Ourobos watchface: https://amazfitwatchfaces.com/pace/view/6996
User avatar
DxP
Posts: 41
Joined: 10 Jun 2020, 19:31
Location: Germany
Has thanked: 2 times
Been thanked: 18 times
Contact:

Post by DxP »

Yes..."!" is working. But in the "locked mode" the unit symbol is switched to "km". The values are still converted / displayed in miles.
AlainProvist
WF maker
Posts: 37
Joined: 23 Sep 2020, 23:34
Location: France
Has thanked: 6 times
Been thanked: 2 times
Contact:

Post by AlainProvist »

They just read the char image for ';' in the slpt widget, no matter what the unit type is... *insert profanity there*

Code: Select all

            SlptPictureView ttSeq = new SlptPictureView();
            Bitmap ttunitNum = getCharBitmapByFont(this.mFont, ';', need_8c);
            ttSeq.setImagePicture(getCharBitmapByFont(this.mFont, '.', need_8c));
            totalDistanceFView.setImagePictureArray(num);
            totalDistanceLView.setImagePictureArray(num);
            ttlayout.add(totalDistanceFView);
            ttlayout.add(ttSeq);
            ttlayout.add(totalDistanceLView);
            if (ttunitNum != null) {
                SlptPictureView km = new SlptPictureView();
                km.setImagePicture(ttunitNum);
                km.alignParentY = 1;
                km.padding.left = (short) this.mSpace;
                ttlayout.add(km);
            }
AlainProvist
WF maker
Posts: 37
Joined: 23 Sep 2020, 23:34
Location: France
Has thanked: 6 times
Been thanked: 2 times
Contact:

Post by AlainProvist »

And now another bug ruining 2 days of work: offseting the position of a timehand item outside the left side of the screen results in an ugly pixel glitch of the rendered image in sleep mode, depending the rotation of the image...

Code: Select all

<Item type="min" x="160" y="160" xCenter="-60" yCenter="0" config="@wfz/timehand/minute.png"/>
User avatar
DxP
Posts: 41
Joined: 10 Jun 2020, 19:31
Location: Germany
Has thanked: 2 times
Been thanked: 18 times
Contact:

Post by DxP »

We should make a list with all the bugs.... :-)
AlainProvist
WF maker
Posts: 37
Joined: 23 Sep 2020, 23:34
Location: France
Has thanked: 6 times
Been thanked: 2 times
Contact:

Post by AlainProvist »

This is even more insane because after a few minutes, the watch just freezes and you need to hardreboot it. I even got a more crazier bug that made the hours roll like seconds and the minutes likes milliseconds... on all watchfaces even the stock ones until I rebooted...
User avatar
DxP
Posts: 41
Joined: 10 Jun 2020, 19:31
Location: Germany
Has thanked: 2 times
Been thanked: 18 times
Contact:

Post by DxP »

I looked at the code on your "Chronos00" watch face. There you commented out the line with the "year", with the remark that the clock freezes when it goes into standby mode. I've stumbled across it, but there is a solution.

I had already written about this in my tutorial:
++ Definition year
...
Please note that there must also be an extra graphic in the folder, which is included in the "font.xml" with the following line.

Code: Select all

<WatchFaceItem type="font" charset="." config="@wfz/date/year/xtra.png" />
The graphic can be emty, but without this, the clock will be very slow and the battery will empty very quickly. I'm guessing it is a bug.
AlainProvist
WF maker
Posts: 37
Joined: 23 Sep 2020, 23:34
Location: France
Has thanked: 6 times
Been thanked: 2 times
Contact:

Post by AlainProvist »

Oh I guess I totally missed this part :s Thx for the info.
Locked

Return to “Closed topics”

Who is online

Users browsing this forum: No registered users and 1 guest