issues
search
taratara10
/
silent-timer-wear-os
0
stars
0
forks
source link
とりあえず色々練習する
#1
Open
taratara10
opened
1 year ago
taratara10
commented
1 year ago
https://qiita.com/k_shinn/items/f36c1a8fc19a91d97aae
https://www.youtube.com/watch?v=o0HhsnVAGNA&ab_channel=DroidKaigi
https://github.com/android/wear-os-samples
taratara10
commented
1 year ago
まずはgradle
ktsにするか
taratara10
commented
1 year ago
serviceとActivityどっちがいいの?
スワイプするwidgetみたいなのがService
launchするのがappでactivityのイメージ
taratara10
commented
1 year ago
viewModelっている?
composeに状態をもたせたくないので、外部で管理したい
となるとdatastoreが手軽なのか
repositoryは作るほどでもないな
stateHolderでもいい気がする
mainActivityにuseCase直Injectもありか
クリーンじゃないのでなし
stateHolderだとscopeとHiltのDIの相性がな~
viewModel入れてみるか
taratara10
commented
1 year ago
データ構造
どこでtimerを持つか
今回のセット時間
viewModelのuiStateでdataStoreから取ってきた値を
単位秒の整数値が良さそう
画面に表示している残り時間
経過時間を保持する
Floatで経過時間
で上のと差分を計算する
計算ロジックはuseCase vs value object
value objectのが拡張性があって高凝集
かつ、value object自体を扱えるのでこれがいい
taratara10
commented
1 year ago
今こそ、MVVM -> MVIのときでは?
わからんので、MVVMでひとまず実装しよう
taratara10
commented
1 year ago
とりあえずお昼寝の15minタイマー機能だけ作ろう