Skip to content

Commit

Permalink
3.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
DeKaN committed Sep 20, 2023
2 parents 51cbae2 + 7abbf9b commit a0e23f3
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 54 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Piano Analytics SDK for Android

## v3.3.3
* Added `track` function to `MediaHelper` for tracking custom media events.
* Changed behavior: `extraProps` in `MediaHelper` are added to all events, not only to "heartbeat" events.
* Fixed bug with clearing storage at setting `PrivacyMode` with only `PrivacyStorageFeature.ALL` allowed.
* Fixed bug with incorrect default values for `LIFECYCLE` properties

## v3.3.2
* Added `ReportUrlProvider` to `Configuration` for case "switching between several site ids for one app at runtime"

Expand Down
10 changes: 4 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[versions]
# Plugins
kotlin = "1.8.22"
android = "8.1.0"
android = "8.1.1"
versionUpdater = "0.47.0"
ktlint = "11.5.0"
ktlint = "11.5.1"
dokka = "1.8.20"
mavenRelease = "0.25.3"
moshiIR = "0.22.1"

# AndroidX libraries
compatLibrary = "1.6.1"
annotationsLibrary = "1.6.0"
lifecycle = "2.6.1"
lifecycle = "2.6.2"
materialLibrary = "1.9.0"

# Third party Libraries
Expand All @@ -27,13 +27,12 @@ viewBindingProperty = "1.5.9"
junit = "4.13.2"
androidxTestCore = "1.5.0"
mockitoKotlin = "2.2.0"
mockitoCore = "5.4.0"
mockitoCore = "5.5.0"

[plugins]
android-library = { id = "com.android.library", version.ref = "android" }
android-app = { id = "com.android.application", version.ref = "android" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
mavenRelease = { id = "com.vanniktech.maven.publish", version.ref = "mavenRelease" }
Expand All @@ -51,7 +50,6 @@ okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
okhttpLogging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
moshiCodegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "moshi" }
viewBindingProperty = { module = "com.github.kirich1409:viewbindingpropertydelegate", version.ref = "viewBindingProperty" }

kotlinJunit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
2 changes: 1 addition & 1 deletion piano-analytics/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=3.3.2
VERSION_NAME=3.3.3
GROUP=io.piano.android
POM_NAME=Analytics
POM_ARTIFACT_ID=analytics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@ package io.piano.android.analytics

import android.content.SharedPreferences
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KMutableProperty0
import kotlin.reflect.KProperty

internal inline fun <T> delegatedPropertyWithDefaultValue(
delegateProperty: KMutableProperty0<T>,
crossinline defaultValue: () -> T,
crossinline valueFilter: (T) -> Boolean,
) = object : ReadWriteProperty<Any, T> {
override fun getValue(thisRef: Any, property: KProperty<*>): T {
return delegateProperty.get().takeIf(valueFilter) ?: defaultValue().also { setValue(thisRef, property, it) }
}

override fun setValue(thisRef: Any, property: KProperty<*>, value: T) {
delegateProperty.set(value)
}
}

internal fun <T> resettableProperty(
resetValue: T,
initializer: () -> T,
Expand Down
Loading

0 comments on commit a0e23f3

Please sign in to comment.