Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7638953
Groundwork for dynamic layouts configuration
rdnt Jan 7, 2024
5b4a23d
Use ComplicationSlotsUserStyleSetting for layout selection to limit v…
rdnt Jan 7, 2024
8b5f1c6
Layout selection on watch and companion
rdnt Jan 17, 2024
ca11364
Complication and focus layouts complications bounds
rdnt Jan 17, 2024
c6ab7c5
Complication rendering bounds optimizations
rdnt Jan 19, 2024
e47cdee
Reusable complication button groundwork
rdnt Jan 19, 2024
e0aaa7c
Re-usable complication button
rdnt Jan 19, 2024
36c9824
Dynamic complication editor based on selected layout
rdnt Jan 19, 2024
f065610
Groundwork on refined canvas renderer
rdnt Jan 24, 2024
0551110
wip
rdnt Feb 10, 2024
675d416
Cleaned up time rendering (wip)
rdnt Feb 11, 2024
5d9c62f
Fix text scaling for big/detailed ambient
rdnt Feb 11, 2024
39cb5dd
Disable debug complication bounds bg
rdnt Feb 11, 2024
68283d8
Better seconds rendering, wip bitmap cache
rdnt Feb 12, 2024
d4887a4
Bitmap cache for seconds
rdnt Feb 13, 2024
b6004e0
Fix seconds offset on info modes
rdnt Feb 13, 2024
c9f8047
Format
rdnt Feb 13, 2024
14828f7
Bitmap cache for hours/minutes (wip)
rdnt Feb 13, 2024
94a62bd
Global bitmap cache, merge hours and minutes rendering code
rdnt Feb 14, 2024
c46cd51
Fix am/pm rendering, seconds offsets
rdnt Feb 14, 2024
40dc31d
Update gradle
rdnt Feb 14, 2024
415e1c1
Unify text rendering functions, cleanup debug text
rdnt Feb 15, 2024
9cd8199
Toggleable debug overlay for render elements and complications (wip)
rdnt Feb 15, 2024
633c51a
Bitmap cache on most complications
rdnt Feb 15, 2024
33eaa30
Minor bug fixes
rdnt Feb 16, 2024
1832241
Remove some analog seconds elements, misc
rdnt Feb 16, 2024
0685933
minor bug fixes
rdnt Mar 9, 2024
085d47f
Rendering performance optimizations, simplify transform/translate/opa…
rdnt Mar 16, 2024
a207ba8
minor fixes
rdnt Mar 16, 2024
137b775
add support for ambient styles (wip)
rdnt Mar 16, 2024
0eb5ea9
fix stuck animators
rdnt Mar 17, 2024
5c3a28e
wip
rdnt Mar 19, 2024
812372d
Before refactor to ambient style
rdnt Mar 24, 2024
1898c97
Clean up offset/scaling rendering
rdnt Mar 24, 2024
dd56c5d
Clean up complications scale
rdnt Mar 24, 2024
403f74c
further cleanup, partial scale
rdnt Mar 24, 2024
13dcea9
rollback partial scale
rdnt Mar 24, 2024
77b16c4
Update preview img & time instant, misc
rdnt Mar 24, 2024
2816d62
rollback instant change, bump version code
rdnt Mar 24, 2024
8fffd9b
update-changelog
rdnt Mar 24, 2024
97053a1
update app name
rdnt Mar 24, 2024
b1e796b
clean up manifest
rdnt Mar 24, 2024
281a925
misc
rdnt Mar 24, 2024
5ecb53d
use lru cache for bitmap atlas storage
rdnt Mar 25, 2024
ac73cde
Use LruCache for watchface renderer
rdnt Mar 25, 2024
a20d40c
before debug anim
rdnt Mar 27, 2024
72fbcc5
single animator
rdnt Mar 27, 2024
9bee482
before cleanup, broken horizontal compl
rdnt Mar 27, 2024
e529af6
3.0.2-alpha
rdnt Mar 27, 2024
eb645b4
Refine complications/seconds drawing, use only enter animator, cleanu…
rdnt Mar 28, 2024
55b966a
fix textstyle
rdnt Mar 28, 2024
4ffbc7a
cache-optimized complication renderer
rdnt Mar 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
Last updated: 2023-11-25
Last updated: 2024-03-25

- v3.0.2-alpha
- Use single animator to help avoid data races/bugs

- v3.0.1-alpha
- Use LruCache instead of BitmapCache

- v3.0.0-alpha
- Dynamic layouts

- v2.12.1
- Remove heartrate complication prefix style
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
applicationId "dev.rdnt.m8face"
minSdk 28
targetSdk 33
versionCode 56
versionName '2.12.1'
versionCode 62
versionName '3.0.5'
}

buildFeatures {
Expand All @@ -51,6 +51,7 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
versionNameSuffix '-preview'
signingConfig signingConfigs.debug
}

release {
Expand Down
113 changes: 57 additions & 56 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2020 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,69 +14,71 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools">

<uses-feature android:name="android.hardware.type.watch" />
<uses-feature android:name="android.hardware.type.watch" />

<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA" />
<uses-permission android:name="com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA_PRIVILEGED" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA" />
<uses-permission android:name="com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA_PRIVILEGED" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission
android:name="com.google.android.gms.permission.AD_ID"
tools:node="remove" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="false"
>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="false">

<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />

<service
android:name=".WatchFaceService"
android:directBootAware="true"
android:exported="true"
android:label="@string/analog_watch_face_name"
android:permission="android.permission.BIND_WALLPAPER">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
</intent-filter>
<service
android:name=".WatchFaceService"
android:directBootAware="true"
android:exported="true"
android:label="@string/watch_face_name"
android:permission="android.permission.BIND_WALLPAPER">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
</intent-filter>

<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watch_preview" />
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="@drawable/watch_preview" />
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/watch_face" />
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watch_preview" />
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="@drawable/watch_preview" />
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/watch_face" />

<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR" />

<meta-data
android:name="com.google.android.wearable.watchface.companionBuiltinConfigurationEnabled"
android:value="true" />
</service>
<meta-data
android:name="com.google.android.wearable.watchface.companionBuiltinConfigurationEnabled"
android:value="true" />
</service>

<activity
android:name=".editor.WatchFaceConfigActivity"
android:exported="true"
android:label="@string/title_activity_watch_face_config">
<activity
android:name=".editor.WatchFaceConfigActivity"
android:exported="true"
android:label="@string/title_activity_watch_face_config"
android:taskAffinity="dev.rdnt.m8face">

<intent-filter>
<action android:name="androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR" />
<intent-filter>
<action android:name="androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR" />

<category android:name="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
<category android:name="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
68 changes: 68 additions & 0 deletions app/src/main/java/dev/rdnt/m8face/BitmapCache.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package dev.rdnt.m8face

import android.graphics.Bitmap
import android.util.Log

//const val HOURS_BITMAP_KEY = "hours"
//const val MINUTES_BITMAP_KEY = "minutes"
//const val SECONDS_BITMAP_KEY = "seconds"
//const val AMPM_BITMAP_KEY = "ampm"
//
//const val TIME_BITMAP_KEY = "time"
//const val AUX_BITMAP_KEY = "aux"

class BitmapCacheOld {
private val entries: MutableMap<String, BitmapCacheEntry> = mutableMapOf()

override fun toString(): String {
//loop entries
var result = ""
entries.forEach { (k, v) -> result += "{$k: $v} " }
return "(entries= $result)"
}

fun get(k: String, h: String): Bitmap? {
return entries[k]?.get(h)
}

fun set(k: String, h: String, b: Bitmap?) {
val entry = entries.getOrPut(k) { BitmapCacheEntry() }
entry.set(h, b)
}

fun renders(k: String): Int {
return entries[k]?.renders ?: 1
}

fun loads(k: String): Int {
return entries[k]?.loads ?: 1
}
}

class BitmapCacheEntry {
var renders: Int = 1
var loads: Int = 1
private var hash: String = ""
private var bitmap: Bitmap? = null

override fun toString(): String {
return "(renders=$renders, loads=$loads)"
}

fun get(h: String): Bitmap? {
loads++

if (bitmap != null && h == hash) {
return bitmap
}

return null
}

fun set(h: String, b: Bitmap?) {
renders++

hash = h
bitmap = b
}
}
Loading