|
1 | 1 | package com.getcode.analytics |
2 | 2 |
|
3 | 3 | import com.getcode.api.BuildConfig |
| 4 | +import com.getcode.model.AppSetting |
4 | 5 | import com.getcode.model.CurrencyCode |
5 | 6 | import com.getcode.model.Kin |
6 | 7 | import com.getcode.model.KinAmount |
| 8 | +import com.getcode.model.PrefsBool |
7 | 9 | import com.getcode.solana.keys.PublicKey |
8 | 10 | import com.getcode.solana.keys.base58 |
9 | 11 | import com.google.firebase.ktx.Firebase |
@@ -92,7 +94,11 @@ class AnalyticsManager @Inject constructor( |
92 | 94 | ) |
93 | 95 | } |
94 | 96 |
|
95 | | - override fun billHidden(kin: Kin, currencyCode: CurrencyCode, animation: BillPresentationStyle) { |
| 97 | + override fun billHidden( |
| 98 | + kin: Kin, |
| 99 | + currencyCode: CurrencyCode, |
| 100 | + animation: BillPresentationStyle |
| 101 | + ) { |
96 | 102 | track( |
97 | 103 | Name.Bill, |
98 | 104 | Pair(Property.State, StringValue.Hidden.value), |
@@ -247,6 +253,17 @@ class AnalyticsManager @Inject constructor( |
247 | 253 | track(Name.BackgroundSwap) |
248 | 254 | } |
249 | 255 |
|
| 256 | + override fun appSettingToggled(setting: AppSetting, value: Boolean) { |
| 257 | + val name = when (setting) { |
| 258 | + PrefsBool.CAMERA_START_BY_DEFAULT -> Name.AutoStartCamera |
| 259 | + } |
| 260 | + |
| 261 | + track( |
| 262 | + name, |
| 263 | + Property.State to if (value) StringValue.Yes.value else StringValue.No.value, |
| 264 | + ) |
| 265 | + } |
| 266 | + |
250 | 267 | private fun track(event: Name, vararg properties: Pair<Property, String>) { |
251 | 268 | if (BuildConfig.DEBUG) { |
252 | 269 | Timber.d("debug track $event, ${properties.map { "${it.first.name}, ${it.second}" }}") |
@@ -292,6 +309,9 @@ class AnalyticsManager @Inject constructor( |
292 | 309 | ErrorRequest("Error Request"), |
293 | 310 |
|
294 | 311 | Recompute("Recompute"), |
| 312 | + |
| 313 | + // App Settings |
| 314 | + AutoStartCamera("Auto Start Camera") |
295 | 315 | } |
296 | 316 |
|
297 | 317 | enum class Property(val value: String) { |
@@ -343,6 +363,8 @@ class AnalyticsManager @Inject constructor( |
343 | 363 | Backup("Backup Screen"), |
344 | 364 | Withdraw("Withdraw Screen"), |
345 | 365 | Debug("Debug Screen"), |
| 366 | + Share("Share Screen"), |
| 367 | + AppSettings("App Settings"), |
346 | 368 | ForceUpgrade("Force Upgrade"), |
347 | 369 | BuyMoreKin("Buy More Kin Screen"), |
348 | 370 | SendKin("Send Kin Screen"), |
|
0 commit comments