Skip to content

Commit 96c3dff

Browse files
authored
fix naming (#27)
1 parent 4c958e2 commit 96c3dff

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ The screen call lets you record whenever a user sees a screen in your mobile app
185185

186186
Method signature:
187187
```kotlin
188-
fun screen(screenTitle: String, properties: JsonObject = emptyJsonObject, category: String = "")
188+
fun screen(title: String, properties: JsonObject = emptyJsonObject, category: String = "")
189189

190190
// If <T> is annotated with @Serializable you will not need to provide a serializationStrategy
191-
fun <T> screen(screenTitle: String, properties: T, category: String = "", serializationStrategy: KSerializer<T>)
191+
fun <T> screen(title: String, properties: T, category: String = "", serializationStrategy: KSerializer<T>)
192192
```
193193

194194
Example Usage:

core/src/main/java/com/segment/analytics/kotlin/core/Analytics.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,18 @@ class Analytics(val configuration: Configuration) : Subscriber {
201201
* attach a name, category or properties to the screen. Either category or name must be
202202
* provided.
203203
*
204-
* @param screenTitle A name for the screen.
204+
* @param title A name for the screen.
205205
* @param category A category to describe the screen.
206206
* @param properties [Properties] to add extra information to this call.
207207
* @see <a href="https://segment.com/docs/spec/screen/">Screen Documentation</a>
208208
*/
209209
@JvmOverloads
210210
fun screen(
211-
screenTitle: String,
211+
title: String,
212212
properties: JsonObject = emptyJsonObject,
213213
category: String = ""
214214
) {
215-
val event = ScreenEvent(name = screenTitle, category = category, properties = properties)
215+
val event = ScreenEvent(name = title, category = category, properties = properties)
216216
process(event)
217217
}
218218

@@ -221,20 +221,20 @@ class Analytics(val configuration: Configuration) : Subscriber {
221221
* attach a name, category or properties to the screen. Either category or name must be
222222
* provided.
223223
*
224-
* @param screenTitle A name for the screen.
224+
* @param title A name for the screen.
225225
* @param category A category to describe the screen.
226226
* @param properties [Properties] to add extra information to this call. Needs to be [serializable](https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md)
227227
* @param serializationStrategy strategy to serialize [properties]
228228
* @see <a href="https://segment.com/docs/spec/screen/">Screen Documentation</a>
229229
*/
230230
fun <T : Any> screen(
231-
screenTitle: String,
231+
title: String,
232232
properties: T,
233233
serializationStrategy: SerializationStrategy<T>,
234234
category: String = ""
235235
) {
236236
screen(
237-
screenTitle,
237+
title,
238238
Json.encodeToJsonElement(serializationStrategy, properties).jsonObject,
239239
category
240240
)
@@ -245,17 +245,17 @@ class Analytics(val configuration: Configuration) : Subscriber {
245245
* attach a name, category or properties to the screen. Either category or name must be
246246
* provided.
247247
*
248-
* @param screenTitle A name for the screen.
248+
* @param title A name for the screen.
249249
* @param category A category to describe the screen.
250250
* @param properties [Properties] to add extra information to this call. Needs to be [serializable](https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md)
251251
* @see <a href="https://segment.com/docs/spec/screen/">Screen Documentation</a>
252252
*/
253253
inline fun <reified T : Any> screen(
254-
screenTitle: String,
254+
title: String,
255255
properties: T,
256256
category: String = "",
257257
) {
258-
screen(screenTitle, properties, Json.serializersModule.serializer(), category)
258+
screen(title, properties, Json.serializersModule.serializer(), category)
259259
}
260260

261261
/**

core/src/test/kotlin/com/segment/analytics/kotlin/core/AnalyticsTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class AnalyticsTests {
258258
val mockPlugin = spyk(StubPlugin())
259259
analytics.add(mockPlugin)
260260
analytics.screen(
261-
screenTitle = "main",
261+
title = "main",
262262
category = "mobile",
263263
properties = buildJsonObject { put("foo", "bar") })
264264
val screen = slot<ScreenEvent>()

0 commit comments

Comments
 (0)