···6767[![darkmode3_thumb]][darkmode3]
6868<br>
69697070+## WearOS
7171+7272+[![wearos_demo]][wearos_demo]
7373+<br>
7474+7075## Technology stack
7176- Kotlin
7277- Multi module
7378- Single Activity
7479- MVVM (Jetpack ViewModel + LiveData)
7580- Jetpack Navigation
8181+- Jetpack Compose (WearOS)
7682- Hilt
7783- Room, migrations
7884- Coroutines
···98104 ├── data_local # Database.
99105 ├── domain # Business logic.
100106 ├── navigation # Navigation interfaces and screen params.
107107+ ├── wear # WearOS app.
108108+ ├── wearrpc # Mobile <--> WearOS communication
101109 ├── features
102110 │ ├── feature_archive # Screen for archived data.
103111 │ ├── feature_base_adapter # Shared recycler adapters.
···125133 │ └── feature_widget # Widgets.
126134127135## License
136136+137137+**Android App**
138138+128139Copyright (C) 2020-2024 Anton Razinkov devrazeeman@gmail.com
129140130141This program is free software: you can redistribute it and/or modify
···140151You should have received a copy of the GNU General Public License
141152along with this program. If not, see <https://www.gnu.org/licenses/>.
142153154154+**WearOS App**
155155+156156+Copyright (C) 2023-2024 Joseph Hale https://jhale.dev,
157157+[@kantahrek](https://github.com/kantahrek), Anton Razinkov devrazeeman@gmail.com
158158+159159+This Source Code Form is subject to the terms of the Mozilla Public
160160+License, v. 2.0. If a copy of the MPL was not distributed with this
161161+file, You can obtain one at https://mozilla.org/MPL/2.0/.
143162144163145164[change_record_thumb]: dev_files/screens/change_record_thumb.png
···185204[darkmode2]: dev_files/screens/darkmode2.png
186205[darkmode3_thumb]: dev_files/screens/darkmode3_thumb.png
187206[darkmode3]: dev_files/screens/darkmode3.png
207207+208208+[wearos_demo]: dev_files/wearos_demo.gif
···11+/*
22+ * This Source Code Form is subject to the terms of the Mozilla Public
33+ * License, v. 2.0. If a copy of the MPL was not distributed with this
44+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
55+ */
66+package com.example.util.simpletimetracker.presentation.components
77+88+import androidx.compose.runtime.Composable
99+import androidx.compose.ui.graphics.Color
1010+import androidx.compose.ui.platform.LocalContext
1111+import androidx.wear.compose.material.ChipDefaults
1212+import androidx.wear.compose.material.CompactChip
1313+import androidx.wear.compose.material.Text
1414+import com.example.util.simpletimetracker.R
1515+1616+@Composable
1717+fun CreditsButton(onClick: () -> Unit) {
1818+ CompactChip(
1919+ onClick = onClick,
2020+ label = { Text(LocalContext.current.getString(R.string.credits_button)) },
2121+ colors = ChipDefaults.chipColors(
2222+ backgroundColor = Color.Transparent
2323+ )
2424+ )
2525+}
···11+/*
22+ * This Source Code Form is subject to the terms of the Mozilla Public
33+ * License, v. 2.0. If a copy of the MPL was not distributed with this
44+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
55+ */
66+package com.example.util.simpletimetracker.presentation.remember
77+88+import androidx.compose.runtime.Composable
99+import androidx.compose.runtime.LaunchedEffect
1010+import androidx.compose.runtime.getValue
1111+import androidx.compose.runtime.mutableStateOf
1212+import androidx.compose.runtime.remember
1313+import androidx.compose.runtime.setValue
1414+import kotlinx.coroutines.time.delay
1515+import java.time.Duration
1616+import java.time.Instant
1717+1818+@Composable
1919+fun rememberDurationSince(epochMillis: Long): Duration {
2020+ var duration by remember { mutableStateOf(durationSince(epochMillis)) }
2121+ LaunchedEffect(duration) {
2222+ delay(Duration.ofSeconds(1L))
2323+ duration = durationSince(epochMillis)
2424+ }
2525+ return duration
2626+}
2727+2828+private fun durationSince(epochMillis: Long): Duration {
2929+ return Duration.between(Instant.ofEpochMilli(epochMillis), Instant.now())
3030+}