Modern Apps git

← Modern-Apps.git

games/nonogram: document public API for detekt

Commit
f9a23169dcacc1f1cd96c716d1911ccedd1d407f
Author
Vayun Mathur <[email protected]>
When
2026-11-17 14:42 UTC (18 days ago)
Parents
d9caa0f
Add concise KDoc to every public class, object, interface and
enum (including nested types) that detekt's
UndocumentedPublicClass rule flagged in this module. Docs only:
no behaviour, visibility or config changes.

Verified: ./gradlew :games:nonogram:detekt reports 0
UndocumentedPublicClass findings (pre-existing error-severity
findings in other rules, where present, are untouched), and the
module unit tests pass.

Diff

games/nonogram/src/main/java/com/vayunmathur/games/nonogram/MainActivity.kt
diff --git a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/MainActivity.kt b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/MainActivity.ktindex e06a005a6f..ec06a56821 100644--- a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/MainActivity.kt+++ b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/MainActivity.kt@@ -5,6 +5,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel import com.vayunmathur.games.nonogram.platform.NonogramViewModel import com.vayunmathur.library.ui.MaActivity +/** Entry activity for the Nonogram app; hosts its navigation with the shared view model. */ class MainActivity : MaActivity() {     @Composable     override fun Content() {
games/nonogram/src/main/java/com/vayunmathur/games/nonogram/Route.kt
diff --git a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/Route.kt b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/Route.ktindex 0cd337ae0d..82cc4beedc 100644--- a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/Route.kt+++ b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/Route.kt@@ -3,15 +3,18 @@ package com.vayunmathur.games.nonogram import com.vayunmathur.library.util.NavKey import kotlinx.serialization.Serializable +/** Navigation destinations for the Nonogram app. */ @Serializable sealed interface Route : NavKey {     /** The only board there is: which puzzle it shows comes from the stored mode and level. */     @Serializable     data object Game : Route +    /** Destination for the shared game-center screen. */     @Serializable     data object GameCenter : Route +    /** Destination for the Nonogram settings screen. */     @Serializable     data object Settings : Route }
games/nonogram/src/main/java/com/vayunmathur/games/nonogram/data/NonogramPuzzle.kt
diff --git a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/data/NonogramPuzzle.kt b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/data/NonogramPuzzle.ktindex 84f671a557..885e8ab4f1 100644--- a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/data/NonogramPuzzle.kt+++ b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/data/NonogramPuzzle.kt@@ -14,6 +14,7 @@ data class NonogramPuzzle( ) {     val filledCount: Int get() = solution.count { it } +    /** Factories and clue derivation for [NonogramPuzzle]. */     companion object {         /** Run lengths of filled cells along [line], the clue a player reads. */         fun cluesFor(line: List<Boolean>): List<Int> {
games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/AppBackupAgent.kt
diff --git a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/AppBackupAgent.kt b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/AppBackupAgent.ktindex 74f42540e3..8f3c0ceb06 100644--- a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/AppBackupAgent.kt+++ b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/AppBackupAgent.kt@@ -2,6 +2,7 @@ package com.vayunmathur.games.nonogram.platform  import com.vayunmathur.library.util.BaseBackupAgent +/** Backup agent declaring the Nonogram DataStore files restored with the app. */ class AppBackupAgent : BaseBackupAgent() {     /**      * Both files, or a restore silently wipes half the player's history: "settings" holds the level
games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramAchievementsManager.kt
diff --git a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramAchievementsManager.kt b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramAchievementsManager.ktindex b74e2ea39f..4a92112d73 100644--- a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramAchievementsManager.kt+++ b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramAchievementsManager.kt@@ -9,6 +9,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.first import kotlinx.coroutines.launch +/** Reports Nonogram achievements and progress to the shared games hub. */ class NonogramAchievementsManager(     context: Context,     json: String,
games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramUiContract.kt
diff --git a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramUiContract.kt b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramUiContract.ktindex b531c55a8d..0dd64a3a20 100644--- a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramUiContract.kt+++ b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramUiContract.kt@@ -49,6 +49,7 @@ interface NonogramGameActions {     fun retryGeneration() {}     fun setGameMode(mode: GameMode) {} +    /** Holds the no-op [NonogramGameActions] used by previews. */     companion object { val Noop: NonogramGameActions = object : NonogramGameActions {} } } @@ -68,13 +69,16 @@ data class NonogramUiState(     val canUndo: Boolean = false, ) +/** Actions the Nonogram settings screen can request. */ interface SettingsActions {     fun setReminderEnabled(enabled: Boolean) {}     fun setReminderTime(hour: Int, minute: Int) {} +    /** Holds the no-op [SettingsActions] used by previews. */     companion object { val Noop: SettingsActions = object : SettingsActions {} } } +/** State the Nonogram settings screen renders, including daily-reminder preferences. */ data class SettingsUiState(     val reminderEnabled: Boolean = false,     val reminderHour: Int = 20,
games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramViewModel.kt
diff --git a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramViewModel.kt b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramViewModel.ktindex 814739513a..c7a99b6b13 100644--- a/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramViewModel.kt+++ b/games/nonogram/src/main/java/com/vayunmathur/games/nonogram/platform/NonogramViewModel.kt@@ -469,6 +469,7 @@ class NonogramViewModel(application: Application) : AndroidViewModel(application     /** Which win has already been banked, so a re-emitted flow cannot double-count it. */     private var recordedWin: Long? = null +    /** Constants for [NonogramViewModel], including daily-challenge keys and seed offsets. */     companion object {         /** Namespace shared by the daily-challenge store and its reminder. */         const val DAILY_KEY_PREFIX = "nonogram_daily"