OverviewPrzegląd
The Changelog module automatically detects when the app has been updated and shows a beautiful dialog with the list of changes. It supports custom styling and Remote Config integration. Moduł Changelog automatycznie wykrywa, gdy aplikacja została zaktualizowana i wyświetla estetyczny dialog z listą zmian. Obsługuje niestandardowe stylowanie i integrację z Remote Config.
Basic UsagePodstawowe użycie
// In MainActivity.onCreate() / W MainActivity.onCreate()
ADict.Changelog.showIfUpdated(this) {
version("2.0.0") {
title = "Major Update!"
added("New dark theme")
added("Cloud sync")
improved("Performance by 50%")
fixed("Startup crash on Android 14")
}
version("1.5.0") {
added("Push notifications")
added("Widget support")
improved("Battery usage")
}
version("1.0.0") {
title = "Initial Release"
added("Core functionality")
}
} { shown, fromVersion, toVersion ->
if (shown) {
analytics.log("changelog_shown", mapOf(
"from" to fromVersion,
"to" to toVersion
))
}
}
Change TypesTypy zmian
| TypeTyp | Emoji | DescriptionOpis |
|---|---|---|
added() |
✨ | New featuresNowe funkcje |
improved() |
⚡ | Improvements to existing featuresUlepszenia istniejących funkcji |
fixed() |
🐛 | Bug fixesPoprawki błędów |
removed() |
🗑️ | Removed featuresUsunięte funkcje |
security() |
🔒 | Security updatesAktualizacje bezpieczeństwa |
deprecated() |
⚠️ | Deprecated featuresPrzestarzałe funkcje |
ConfigurationKonfiguracja
All dialog strings are configurable. Create a custom Strings instance:
Wszystkie teksty dialogu są konfigurowalne. Utwórz własną instancję Strings:
import rip.nerd.adictlibrary.modules.Changelog
// Custom strings / Własne teksty
val strings = Changelog.Strings(
dialogTitle = "Co nowego",
dismissButton = "Rozumiem"
)
ADict.Changelog.showIfUpdated(activity, strings = strings, config = {
version("2.0.0") {
added("Ciemny motyw")
fixed("Poprawka błędu")
}
})
Available String PropertiesDostępne właściwości tekstów
| PropertyWłaściwość | Default ValueWartość domyślna | DescriptionOpis |
|---|---|---|
dialogTitle |
"What's New" | Dialog titleTytuł dialogu |
dismissButton |
"OK" | Dismiss button textTekst przycisku zamknięcia |
Force ShowWymuszenie wyświetlania
// Show changelog even if already shown / Pokaż changelog nawet jeśli już był pokazany
ADict.Changelog.show(activity, config = {
version("2.0.0") {
title = "Check out our new features!"
added("Feature A")
added("Feature B")
}
} {
// On dismiss callback / Callback po zamknięciu
Log.d("Changelog", "Dialog dismissed")
}
Remote Config
// Load changelog from Remote Config / Załaduj changelog z Remote Config
ADict.Changelog.showFromRemoteConfig(
activity = activity,
remoteKey = "changelog_json"
) { shown ->
if (shown) analytics.log("changelog_shown")
}
// JSON format in Remote Config:
// [
// {
// "version": "2.0.0",
// "title": "Major Update",
// "date": "2026-02-18",
// "changes": [
// {"type": "ADDED", "desc": "New feature"},
// {"type": "FIXED", "desc": "Bug fix"}
// ]
// }
// ]
UtilitiesNarzędzia
// Check if there's a new version / Sprawdź czy jest nowa wersja
if (ADict.Changelog.hasNewVersion(context)) {
showNewVersionBadge()
}
// Mark current version as seen / Oznacz bieżącą wersję jako zobaczoną
ADict.Changelog.markCurrentVersionAsSeen(context)
// Reset (for testing) / Reset (do testowania)
ADict.Changelog.reset()