Skip to content

Commit d411a99

Browse files
Some more documentation
1 parent cb7449e commit d411a99

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

analytics/src/main/java/com/sofakingforever/analytics/events/ContentViewEvent.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ package com.sofakingforever.analytics.events
33
import com.sofakingforever.analytics.AnalyticsKit
44
import com.sofakingforever.analytics.events.base.Event
55

6+
/**
7+
* Implement this interface in your class, if it is a ContentView event.
8+
* It will only have a name. nothing else.
9+
*/
610
interface ContentViewEvent : Event {
711

812
fun getViewName(kit : AnalyticsKit): String

analytics/src/main/java/com/sofakingforever/analytics/events/CustomEvent.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ package com.sofakingforever.analytics.events
33
import com.sofakingforever.analytics.AnalyticsKit
44
import com.sofakingforever.analytics.events.base.Event
55

6+
/**
7+
* Implement this interface in your class, if it is a "custom" event.
8+
*
9+
* It will carry a name, and a parameter map.
10+
* Both might vary, according to the kit parameter supplied.
11+
*/
612
interface CustomEvent : Event {
713

814
fun getEventName(kit: AnalyticsKit): String

analytics/src/main/java/com/sofakingforever/analytics/events/InviteEvent.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ package com.sofakingforever.analytics.events
33
import android.content.Context
44
import com.sofakingforever.analytics.events.base.Event
55

6+
7+
/**
8+
* Implement this interface in your class, if it is an Invite event.
9+
*/
610
interface InviteEvent : Event {
711

812
val context: Context

analytics/src/main/java/com/sofakingforever/analytics/events/base/Event.kt

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,25 @@ package com.sofakingforever.analytics.events.base
33
import com.sofakingforever.analytics.AnalyticsKit
44

55
/**
6-
* Every event interface (See CustomEvent or ContentViewEvent) should extend this interface.
6+
* Every event interface should extend this interface. (See CustomEvent or ContentViewEvent)
7+
*
8+
* @property excludedKits - if you want to disable a certain kit for an event, you just add the kit to this list.
9+
* @property includedKits - if you want to send the event to ceratin services, but not other, just add them here.
710
*/
811
interface Event {
12+
13+
14+
val excludedKits: List<AnalyticsKit>
15+
get() = emptyList()
16+
17+
18+
val includedKits: List<AnalyticsKit>
19+
get() = emptyList()
20+
21+
22+
/**
23+
* @return false if *kit* is considered "excluded". true if considered "included".
24+
*/
925
fun isConsideredIncluded(kit: AnalyticsKit): Boolean {
1026

1127
if (excludedKits.contains(kit)) {
@@ -22,11 +38,4 @@ interface Event {
2238
return true
2339
}
2440

25-
val excludedKits: List<AnalyticsKit>
26-
get() = emptyList()
27-
28-
29-
val includedKits: List<AnalyticsKit>
30-
get() = emptyList()
31-
3241
}

0 commit comments

Comments
 (0)