herman man
herman man

Reputation: 11

[wear-os][WFF] ComplicationSlot BoundingArc hit test on the entire oval area instead of just the arc itself, How to fix this?

Watch Face Format (WFF) with BoundingArc can lead to unintended hit testing on the entire oval area instead of just the arc itself.

If has multiple ComplicationSlot overlap with difference angle arc, it will lead to only last complicationSlot will have the hit test. Following is the sample of the issue. Any idea? Thanks.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<WatchFace height="450" width="450">
  <Scene>
    <ComplicationSlot
        x="0" y="0"
        width="450" height="450"
        slotId="0"
        name="slot0" displayName="slot0"
        supportedTypes="SHORT_TEXT EMPTY">
      <DefaultProviderPolicy
          primaryProvider="com.google.android.gm/com.google.android.apps.gmail.wear.complications.UnreadEmailsComplicationService"
          primaryProviderType="SHORT_TEXT"
          defaultSystemProvider="SUNRISE_SUNSET"
          defaultSystemProviderType="SHORT_TEXT"
          />
      <BoundingArc centerX="225" centerY="225" width="435"
          height="435" thickness="40" isRoundEdge="true"
          startAngle="100" endAngle="170"
          direction="CLOCKWISE" />

      <Complication type="SHORT_TEXT">
        <Group name="Complications" width="450" height="450" x="0" y="0" alpha="255">
          <Variant mode="AMBIENT" target="alpha" value="0" />
          <PartDraw x="0" y="0" height="450" width="450">
            <Arc direction="CLOCKWISE" startAngle="100" endAngle="170" centerX="225" centerY="225" width="410" height="410">
              <Stroke color="#4444FF" cap="ROUND" thickness="40">
              </Stroke>
            </Arc>
          </PartDraw>
        </Group>
      </Complication>
    </ComplicationSlot>

    <ComplicationSlot
        x="0" y="0"
        width="225" height="225"
        slotId="1"
        name="slot1" displayName="slot1"
        supportedTypes="SHORT_TEXT EMPTY">
      <DefaultProviderPolicy
          primaryProvider="com.google.android.gm/com.google.android.apps.gmail.wear.complications.UnreadEmailsComplicationService"
          primaryProviderType="SHORT_TEXT"
          defaultSystemProvider="SUNRISE_SUNSET"
          defaultSystemProviderType="SHORT_TEXT"
          />
      <BoundingArc centerX="225" centerY="225" width="435"
          height="435" thickness="40" isRoundEdge="true"
          startAngle="190" endAngle="260"
          direction="CLOCKWISE" />

      <Complication type="SHORT_TEXT">
        <Group name="Complications" width="450" height="450" x="0" y="0" alpha="255">
          <Variant mode="AMBIENT" target="alpha" value="0" />
          <PartDraw x="0" y="0" height="450" width="450">
            <Arc direction="CLOCKWISE" startAngle="190" endAngle="260" centerX="225" centerY="225" width="410" height="410">
              <Stroke color="#44FF44" cap="ROUND" thickness="40">
              </Stroke>
            </Arc>
          </PartDraw>
        </Group>
      </Complication>
    </ComplicationSlot>
  </Scene>
</WatchFace>

Upvotes: 1

Views: 100

Answers (0)

Related Questions