From 2671c74bf410fb5bff0ffad27effe39d10993ef6 Mon Sep 17 00:00:00 2001 From: Lucas Lima Date: Thu, 31 Dec 2020 19:05:39 -0300 Subject: [PATCH] Fix ambient mode on android wear --- .../main/java/dev/lucasnlm/antimine/ui/view/AreaPainter.kt | 7 ++++--- .../java/dev/lucasnlm/antimine/wear/WatchGameActivity.kt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/src/main/java/dev/lucasnlm/antimine/ui/view/AreaPainter.kt b/ui/src/main/java/dev/lucasnlm/antimine/ui/view/AreaPainter.kt index 7a797131..cb1590b4 100644 --- a/ui/src/main/java/dev/lucasnlm/antimine/ui/view/AreaPainter.kt +++ b/ui/src/main/java/dev/lucasnlm/antimine/ui/view/AreaPainter.kt @@ -30,8 +30,8 @@ fun Area.paintOnCanvas( style = Paint.Style.STROKE strokeWidth = 2.0f isAntiAlias = !isLowBitAmbient - color = theme.palette.border - alpha = 0xff + color = 0xFFFFFF + alpha = 0x66 } } else { painter.apply { @@ -156,7 +156,8 @@ fun Area.paintOnCanvas( } } isAntiAlias = !isAmbientMode - alpha = 0xff + style = Paint.Style.FILL + alpha = 0xFF } canvas.drawText(minesAround.toString(), paintSettings, painter) } diff --git a/wear/src/main/java/dev/lucasnlm/antimine/wear/WatchGameActivity.kt b/wear/src/main/java/dev/lucasnlm/antimine/wear/WatchGameActivity.kt index 8e87bf9d..267892ac 100644 --- a/wear/src/main/java/dev/lucasnlm/antimine/wear/WatchGameActivity.kt +++ b/wear/src/main/java/dev/lucasnlm/antimine/wear/WatchGameActivity.kt @@ -24,7 +24,6 @@ import kotlinx.coroutines.launch import org.koin.androidx.viewmodel.ext.android.viewModel class WatchGameActivity : AppCompatActivity(R.layout.activity_level), AmbientModeSupport.AmbientCallbackProvider { - private val viewModel by viewModel() private var currentLevelFragment: WatchLevelFragment? = null @@ -63,6 +62,7 @@ class WatchGameActivity : AppCompatActivity(R.layout.activity_level), AmbientMod bindViewModel() loadGameFragment() + viewModel.startNewGame(Difficulty.Intermediate) swipe.isSwipeable = false }