From db3353feb5d915fcee54631300821319f6bb7973 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 15 Dec 2021 16:53:13 +0100 Subject: [PATCH] Analytics: Track some screen (#4715) --- .../features/home/room/detail/RoomDetailActivity.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailActivity.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailActivity.kt index 05dbd724d12..9565f9ca620 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailActivity.kt @@ -19,6 +19,7 @@ package im.vector.app.features.home.room.detail import android.content.Context import android.content.Intent import android.os.Bundle +import android.view.View import android.widget.Toast import androidx.core.view.GravityCompat import androidx.drawerlayout.widget.DrawerLayout @@ -36,6 +37,8 @@ import im.vector.app.core.extensions.replaceFragment import im.vector.app.core.platform.ToolbarConfigurable import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.databinding.ActivityRoomDetailBinding +import im.vector.app.features.analytics.plan.Screen +import im.vector.app.features.analytics.screen.ScreenEvent import im.vector.app.features.home.room.breadcrumbs.BreadcrumbsFragment import im.vector.app.features.home.room.detail.timeline.helper.VoiceMessagePlaybackTracker import im.vector.app.features.matrixto.MatrixToBottomSheet @@ -161,6 +164,16 @@ class RoomDetailActivity : } private val drawerListener = object : DrawerLayout.SimpleDrawerListener() { + private var drawerScreenEvent: ScreenEvent? = null + override fun onDrawerOpened(drawerView: View) { + drawerScreenEvent = ScreenEvent(Screen.ScreenName.MobileBreadcrumbs) + } + + override fun onDrawerClosed(drawerView: View) { + drawerScreenEvent?.send(analyticsTracker) + drawerScreenEvent = null + } + override fun onDrawerStateChanged(newState: Int) { hideKeyboard()