android / wear-os-samples

Multiple samples showing best practices in app and watch face development on Wear OS.
https://developer.android.com/wear
Apache License 2.0
1.08k stars 561 forks source link

How I can show time in TextCircular style (Watch Face)? Arc style #1138

Closed arstagaev closed 3 weeks ago

arstagaev commented 3 weeks ago

I using Watch Face Format XML, and can't found how I can represent time in arc style, found only line style - TimeText.

What should I do for show time in arc style?

yschimke commented 3 weeks ago

I haven't tried, but is the issue that DigitalClock doesn't allow a PartText or TextCircular child?

Would something like this work?

            <PartText x="125" ...>
                <Localization calendar="GREGORIAN"/>
                <TextCircular ...>
                    <Font ...>
                        <Template>%s:%s
                            <Parameter expression="[HOUR_1_12_Z]"/>
                            <Parameter expression="[MINUTE_Z]"/>
                        </Template>
                    </Font>
                </Text>
            </PartText>
arstagaev commented 3 weeks ago

Thank you! Yes, I checked this - and this work well, also with seconds.

<Font family="SYNC_TO_DEVICE" size="32" weight="NORMAL"
              slant="NORMAL"
              color="[CONFIGURATION.themeColor.2]">
            <Template>%s:%s:%s
              <Parameter expression="[HOUR_1_12_Z]"/>
              <Parameter expression="[MINUTE_Z]"/>
              <Parameter expression="[SECOND]"/>
            </Template>
</Font>