File tree Expand file tree Collapse file tree 4 files changed +31
-8
lines changed
analytics/src/main/java/com/sofakingforever/analytics/events Expand file tree Collapse file tree 4 files changed +31
-8
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ package com.sofakingforever.analytics.events
3
3
import com.sofakingforever.analytics.AnalyticsKit
4
4
import com.sofakingforever.analytics.events.base.Event
5
5
6
+ /* *
7
+ * Implement this interface in your class, if it is a ContentView event.
8
+ * It will only have a name. nothing else.
9
+ */
6
10
interface ContentViewEvent : Event {
7
11
8
12
fun getViewName (kit : AnalyticsKit ): String
Original file line number Diff line number Diff line change @@ -3,6 +3,12 @@ package com.sofakingforever.analytics.events
3
3
import com.sofakingforever.analytics.AnalyticsKit
4
4
import com.sofakingforever.analytics.events.base.Event
5
5
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
+ */
6
12
interface CustomEvent : Event {
7
13
8
14
fun getEventName (kit : AnalyticsKit ): String
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ package com.sofakingforever.analytics.events
3
3
import android.content.Context
4
4
import com.sofakingforever.analytics.events.base.Event
5
5
6
+
7
+ /* *
8
+ * Implement this interface in your class, if it is an Invite event.
9
+ */
6
10
interface InviteEvent : Event {
7
11
8
12
val context: Context
Original file line number Diff line number Diff line change @@ -3,9 +3,25 @@ package com.sofakingforever.analytics.events.base
3
3
import com.sofakingforever.analytics.AnalyticsKit
4
4
5
5
/* *
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.
7
10
*/
8
11
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
+ */
9
25
fun isConsideredIncluded (kit : AnalyticsKit ): Boolean {
10
26
11
27
if (excludedKits.contains(kit)) {
@@ -22,11 +38,4 @@ interface Event {
22
38
return true
23
39
}
24
40
25
- val excludedKits: List <AnalyticsKit >
26
- get() = emptyList()
27
-
28
-
29
- val includedKits: List <AnalyticsKit >
30
- get() = emptyList()
31
-
32
41
}
You can’t perform that action at this time.
0 commit comments