Tüm Yazılar
KategoriAndroid
Okuma Süresi
14 dk okuma
Yayın Tarihi
...
Kelime Sayısı
846kelime

Kahveni hazırla - bu içerikli bir makale!

Wear OS 5 Watch Face Format (WFF) deklaratif XML, complications, health sensors, %50 battery tasarrufu ve Samsung Galaxy Watch + Pixel Watch uyumu.

Wear OS 5 Watch Face Format: Deklaratif Watch Face Geliştirme

# Wear OS 5 Watch Face Format: Deklaratif Watch Face Geliştirme

Wear OS 5 (2024 release, Pixel Watch 3 + Galaxy Watch 7 ile popülerleşti) Watch Face geliştirmeyi tamamen yeniden tanımladı. Watch Face Format (WFF) — XML-based declarative approach, eski Canvas API'sinin %50 daha az battery tüketimi, hızlı iteration, cross-device compatibility. Bu yazı WFF sistemini, complications entegrasyonunu, health sensors kullanımını ve Samsung + Google ecosystem uyumunu kapsar.

💡 Pro Tip: WFF ile yapılan watch face Canvas API'den %50 daha az battery tüketir — saat gün boyu takılır, bu battery farkı ciddi.

İçindekiler


Watch Face Format Nedir

2 yaklaşım:

  • Canvas-based (eski): Kotlin + Jetpack Compose, her frame render — flexibility max, battery cost yüksek
  • WFF (yeni): XML deklaratif, system render eder — limited flexibility, **%50 battery tasarruf**

Samsung 2023'te Galaxy Watch için öneri modu, Google 2024'te Wear OS 5 ile standard yaptı.


XML Structure

xml
1<!-- watchface.xml -->
2<WatchFace width="450" height="450">
3 <Metadata key="CLOCK_TYPE" value="DIGITAL"/>
4 <Metadata key="PREVIEW_TIME" value="10:08:32"/>
5 
6 <Scene>
7 <!-- Background -->
8 <PartImage x="0" y="0" width="450" height="450">
9 <Image resource="background.png"/>
10 </PartImage>
11 
12 <!-- Digital time -->
13 <DigitalClock x="100" y="180" width="250" height="80">
14 <HourFormat12 format="%H:%M"
15 color="#FFFFFF"
16 fontFamily="OpenSans-Bold"
17 fontSize="72"/>
18 </DigitalClock>
19 
20 <!-- Date -->
21 <DigitalText x="150" y="280" width="150" height="30">
22 <TimeText format="EEE, MMM d"
23 color="#CCCCCC"
24 fontSize="24"/>
25 </DigitalText>
26 </Scene>
27</WatchFace>

Preview edit ile anında görünüm — Android Studio Wear OS 5 eklentisi live preview yapar.


Complications

3rd party complication provider'ları (pedometer, weather, calendar):

xml
1<ComplicationSlot
2 slotId="0"
3 x="80" y="80" width="80" height="80"
4 supportedTypes="SHORT_TEXT|ICON|RANGED_VALUE">
5 
6 <BoundingArc centerX="40" centerY="40" startAngle="0" endAngle="360"/>
7 
8 <Complication>
9 <ShortText color="#FFFFFF" fontSize="20"/>
10 <Icon color="#FFFFFF"/>
11 <RangedValue color="#4CAF50" strokeWidth="4"/>
12 </Complication>
13</ComplicationSlot>

User Watch app'ten complication'ı provider seçer. Watch face görünüm değişmez, data değişir.


Time-aware Expressions

Dinamik değerler:

xml
1<!-- Animated second hand -->
2<AnalogClock x="0" y="0" width="450" height="450">
3 <SecondHand
4 centerX="225" centerY="225"
5 width="4" length="200"
6 color="#FF0000">
7 <Rotation>
8 <Formula>[SECOND] * 6</Formula>
9 </Rotation>
10 </SecondHand>
11</AnalogClock>
12 
13<!-- Progress ring based on hour -->
14<CircularProgressBar
15 centerX="225" centerY="225" radius="220"
16 thickness="8"
17 progressColor="#4CAF50"
18 backgroundColor="#333333">
19 <Progress>
20 <Formula>[HOUR_0_23] / 24.0</Formula>
21 </Progress>
22</CircularProgressBar>

Expression'lar:

  • [SECOND], [MINUTE], [HOUR_0_23]
  • [BATTERY_PERCENT]
  • [STEP_COUNT]
  • [HEART_RATE]
  • [NOTIFICATIONS_COUNT]

Device State (Battery, Charging)

xml
1<!-- Battery level -->
2<CircularProgressBar
3 centerX="380" centerY="70" radius="30"
4 progressColor="[BATTERY_COLOR]">
5 <Progress>
6 <Formula>[BATTERY_PERCENT] / 100.0</Formula>
7 </Progress>
8 
9 <!-- Conditional color -->
10 <ColorFormula>
11 <If condition="[BATTERY_PERCENT] &lt; 20">
12 <Then>#FF3333</Then>
13 <ElseIf condition="[BATTERY_PERCENT] &lt; 50">
14 <Then>#FFAA33</Then>
15 <Else>#33FF33</Else>
16 </ElseIf>
17 </If>
18 </ColorFormula>
19</CircularProgressBar>
20 
21<!-- Charging indicator -->
22<PartImage x="400" y="100" width="20" height="20">
23 <Image resource="charging_bolt.png"/>
24 <Visibility>
25 <Formula>[IS_CHARGING]</Formula>
26 </Visibility>
27</PartImage>

Health Sensors

xml
1<!-- Heart rate -->
2<DigitalText x="150" y="320" width="150" height="40">
3 <Text>
4 <Formula>[HEART_RATE]</Formula>
5 </Text>
6 <Template> {value} BPM</Template>
7</DigitalText>
8 
9<!-- Step count -->
10<DigitalText x="150" y="360" width="150" height="40">
11 <Text>
12 <Formula>[STEP_COUNT]</Formula>
13 </Text>
14 <Template>{value} adım</Template>
15</DigitalText>
16 
17<!-- SpO2 (Samsung-specific) -->
18<DigitalText x="150" y="400" width="150" height="40">
19 <Text>
20 <Formula>[SPO2_PERCENT]</Formula>
21 </Text>
22</DigitalText>

Health sensor erişim user permission'a bağlı.


Styles ve Variations

User watch face customization:

xml
1<UserConfigurations>
2 <ListConfiguration id="theme" displayName="Renk teması">
3 <ListOption id="dark" displayName="Koyu"/>
4 <ListOption id="light" displayName="Açık"/>
5 <ListOption id="auto" displayName="Otomatik"/>
6 </ListConfiguration>
7 
8 <ColorConfiguration id="accent" displayName="Vurgu rengi">
9 <ColorOption value="#FF0000"/>
10 <ColorOption value="#00FF00"/>
11 <ColorOption value="#0000FF"/>
12 </ColorConfiguration>
13 
14 <BooleanConfiguration id="show_seconds" displayName="Saniye göster"/>
15</UserConfigurations>

User saat uygulamasından bunları değiştirir.


Publishing ve Distribution

  1. Play Console: "Watch Face" uygulama tipinden gönder
  2. Build: ./gradlew :wear:bundleRelease
  3. Review: Play Store Wear OS review team — teknik + content validation

Wear OS 5 watch face'leri standalone app olarak publish edilir (phone app'ten bağımsız).


ALTIN İPUCU

Bu yazının en değerli bilgisi

Bu ipucu, yazının en önemli çıkarımını içeriyor.

Easter Egg

Gizli bir bilgi buldun!

Bu bölümde gizli bir bilgi var. Keşfetmek ister misin?

xml
1<WatchFace width="450" height="450">
2 <Metadata key="CLOCK_TYPE" value="DIGITAL"/>
3 <Scene>
4 <PartImage x="0" y="0" width="450" height="450">
5 <Image resource="bg.png"/>
6 </PartImage>
7 
8 <DigitalClock x="75" y="175" width="300" height="100">
9 <HourFormat24 format="%H:%M"
10 color="#FFFFFF"
11 fontFamily="RobotoMono"
12 fontSize="96"/>
13 </DigitalClock>
14 
15 <DigitalText x="150" y="290" width="150" height="30">
16 <TimeText format="EEE d MMM" color="#888888" fontSize="20"/>
17 </DigitalText>
18 
19 <ComplicationSlot slotId="0" x="100" y="350" width="80" height="80"/>
20 <ComplicationSlot slotId="1" x="270" y="350" width="80" height="80"/>
21 </Scene>
22</WatchFace>

Okuyucu Ödülü

Bu minimal watch face + 2 complication + modern tipografi = clean professional design. **External Resources:** - [WFF documentation](https://developer.android.com/training/wearables/wff) - [WFF sample repository](https://github.com/android/wear-os-samples/tree/main/WatchFaceFormat) - [Complication types](https://developer.android.com/training/wearables/wff/complications) - [Samsung Galaxy Watch design guide](https://developer.samsung.com/galaxy-watch) - [Publishing Wear OS](https://developer.android.com/training/wearables/publish)

Sonuç

Watch Face Format, Wear OS 5'in battery-friendly, kolay geliştirilebilir watch face standart'ı. XML deklaratif yaklaşımı Canvas API'den %50 daha az battery tüketir. Samsung + Google cross-compatibility. Publishing streamlined. Canvas'ın flexibility'sine ihtiyaç yoksa (complex animations, games) — WFF default tercih. Pixel Watch 3, Galaxy Watch 7 ecosystem'inde hızla yaygınlaşıyor.

*İlgili yazılar: Compose 1.7, WorkManager 2.10, Android 15.*

Etiketler

#Android#Wear OS#Wear OS 5#Watch Face Format#WFF#Wearables#2026
Muhittin Çamdalı

Muhittin Çamdalı

Senior iOS Developer

12+ yıllık deneyime sahip iOS Developer. Swift, SwiftUI ve modern iOS mimarileri konusunda uzman. Apple platformlarında performanslı ve kullanıcı dostu uygulamalar geliştiriyorum.

iOS Geliştirme Haberleri

Haftalık Swift tips, SwiftUI tricks ve iOS best practices. Spam yok, sadece değerli içerik.

Gizliliğinize saygı duyuyoruz. İstediğiniz zaman abonelikten çıkabilirsiniz.

Paylaş

İlgili İçerik