0

I'm trying to configure a watch face I am working on. I can't seem to make the condition work. The Condition documentation is hard for me to understand - with lack of examples (online and in-documentation).

List of Configuration:

<ListConfiguration id="handStyle" displayName="Hand Style" defaultValue="1">
  <ListOption id="0" displayName="hand_style_filled" />
  <ListOption id="1" displayName="hand_style_outline" />
</ListConfiguration>

Snippet of the code segment:

<Condition expression="[CONFIGURATION.handStyle.id] == 0">
    <PartImage x="88" y="30" width="14" height="140" pivotX="0.5" pivotY="1.0" tintColor="[CONFIGURATION.themeColor.1]">
        <Variant mode="AMBIENT" target="alpha" value="0" />
        <Image resource="hour_arm_one" />
     </PartImage>
 </Condition>

<Condition expression="[CONFIGURATION.handStyle.id] == 1">
    <PartImage x="88" y="30" width="14" height="140" pivotX="0.5" pivotY="1.0" tintColor="[CONFIGURATION.themeColor.1]">
        <Variant mode="AMBIENT" target="alpha" value="0" />
        <Image resource="hour_arm_one_outline" />
    </PartImage>
</Condition>

Things I have tried:

I've tried too many things for me to list here including the most obvious (for me):

  • <Condition expression="[CONFIGURATION.handStyle.id] == 1"> <-- no quotes
  • <Condition expression="[CONFIGURATION.handStyle.id] == '1'"> <-- w/ quotes

What I want to achieve:

When the user selects displayName the corresponding [conditional] code should be triggered.

1 Answer 1

0

To trigger any Configuration, you will need to use the following format:

For a list of configurations:

<ListConfiguration id="bg_img" displayName="bg_img_lbl" icon="bg_img_ico"
    screenReaderText="bg_img_lbl" defaultValue="0">
  <ListOption id="0" displayName="bg0_lbl" screenReaderText="b0_lbl" icon="bg0_ico" />
  <ListOption id="1" displayName="bg1_lbl" screenReaderText="bg1_lbl" icon="bg1_ico" />
  ...
</ListConfiguration>

Would require something like this to function:

<ListConfiguration id="bg_img">
  <ListOption id="0">
    <!-- Show background 0 -->
  </ListOption>
  <ListOption id="1">
    <!-- Show background 1 ... etc -->
  </ListOption>
</ListConfiguration>

----

And in my case, for a list of configurations:

<ListConfiguration id="handStyle" displayName="Hand Style" defaultValue="1">
  <ListOption id="0" displayName="hand_style_filled" />
  <ListOption id="1" displayName="hand_style_outline" />
</ListConfiguration>

The triggers are as follows:

<ListConfiguration id="handStyle">
  <ListOption id="0">
    <PartImage x="88" y="30" width="14" height="170" pivotX="0.5" pivotY="1.0" tintColor="[CONFIGURATION.themeColor.1]">
      <Image resource="hour_arm" />
    </PartImage>
  </ListOption>
  <ListOption id="1">
    <PartImage x="88" y="30" width="14" height="170" pivotX="0.5" pivotY="1.0" tintColor="[CONFIGURATION.themeColor.1]">
      <Image resource="hour_arm_outline" />
    </PartImage>
  </ListOption>
</ListConfiguration>
Sign up to request clarification or add additional context in comments.

Comments

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.