Skip to content

1.7.0

Choose a tag to compare

@projectdelta6 projectdelta6 released this 24 Apr 11:01
· 35 commits to master since this release
bc59aed

Property delegate API

Adds *Pref property delegate factories to both BasePrefsHelper and BaseDataStoreHelper:

class AppPrefs(ctx: Context) : BaseDataStoreHelper(ctx, "app_prefs") {
    var userId by intPref(KEY_USER_ID, defaultValue = -1)
    val userIdFlow = intPrefFlow(KEY_USER_ID, defaultValue = -1)
    var theme by enumPref(KEY_THEME, default = Theme.SYSTEM)
}

Each type has a non-nullable overload (key, defaultValue) and a nullable overload (key). BaseDataStoreHelper additionally exposes matching *PrefFlow aliases for reactive reads. Delegate setters route through the existing *Async writes so subclasses no longer need to open their own CoroutineScope.

Types covered: String, Int, Long, Boolean, LocalDateTime, LocalDate, LocalTime, Enum<*> on both classes; plus Date on BasePrefsHelper and Double on BaseDataStoreHelper.

Build upgrades

  • AGP 9.2.0, Gradle 9.4.1, Kotlin 2.3.21, Compose BOM 2026.04.01
  • Core-KTX 1.18.0, Activity-Compose 1.13.0, DataStore 1.2.1, Mockito 5.23.0, mockito-kotlin 6.3.0
  • Migrated to AGP 9.0+ built-in Kotlin (dropped the separate org.jetbrains.kotlin.android plugin)
  • Swapped empty lifecycle-runtime-ktx artifact for lifecycle-runtime
  • Explicit maven-publish configuration so JitPack no longer needs to inject a Groovy-syntax publishing block into the Kotlin DSL script

Docs

  • Rewrote README.md with usage examples for both helpers and the combined façade pattern.

Full Changelog: 1.6.0...1.7.0