3

I am attempting to get complex data from a complication using Watch Face Format. I'm wondering if there's any way to split a string from complication data, based on a separator like a comma or space?

Per the WFF complication documentation, there is a complication type called WEIGHTED_ELEMENTS. If you get the [COMPLICATION.WEIGHTED_ELEMENTS_WEIGHTS] complication data, it is delivered as "a space-separated list of element weights".

One would think there would be an obvious way to split this string based on the space separator as described, but in the WFF arithmetic expression documentation, the closest function I can find is subText(,,), which is a substring function.

What gives? Is there something I'm missing here, or did they really add a complication data type without also giving developers any way to parse the data?

0

2 Answers 2

0

It seems there is no way to do what I was hoping for. Per this Google I/O tutorial, a special type of Stroke element was added specifically for GOAL_PROGRESS and WEIGHTED_ELEMENTS complications called WeightedStroke, which handle the space-separated list of data automatically.

Sign up to request clarification or add additional context in comments.

Comments

0

Yep, as you've seen, the intention is that this is value is fed directly into the weights attribute of WeightedStroke.

1 Comment

This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.