From 46b18e44eb61dad2c5589df0a2937d7c7b306129 Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Fri, 7 Sep 2018 15:42:20 +0300 Subject: [PATCH] [transit][eye] added eye event for public transport --- map/transit/transit_reader.cpp | 10 ++++++++++ map/transit/transit_reader.hpp | 1 + 2 files changed, 11 insertions(+) diff --git a/map/transit/transit_reader.cpp b/map/transit/transit_reader.cpp index bc32c4b6a5..788b612bdc 100644 --- a/map/transit/transit_reader.cpp +++ b/map/transit/transit_reader.cpp @@ -7,6 +7,8 @@ #include "indexer/drules_include.hpp" #include "indexer/feature_algo.hpp" +#include "metrics/eye.hpp" + #include "coding/reader.hpp" #include "drape_frontend/drape_engine.hpp" @@ -178,6 +180,7 @@ void TransitReadManager::EnableTransitSchemeMode(bool enable) if (m_isSchemeMode == enable) return; m_isSchemeMode = enable; + m_trackFirstSchemeData = enable; m_drapeEngine.SafeCall(&df::DrapeEngine::EnableTransitScheme, enable); @@ -294,6 +297,13 @@ void TransitReadManager::UpdateViewport(ScreenBase const & screen) break; } } + + if (hasData && m_trackFirstSchemeData) + { + eye::Eye::Event::LayerUsed(eye::Layer::Type::PublicTransport); + m_trackFirstSchemeData = false; + } + ChangeState(hasData ? TransitSchemeState::Enabled : TransitSchemeState::NoData); } diff --git a/map/transit/transit_reader.hpp b/map/transit/transit_reader.hpp index b6525e6eb4..0161b5b2dd 100644 --- a/map/transit/transit_reader.hpp +++ b/map/transit/transit_reader.hpp @@ -148,4 +148,5 @@ private: bool m_isSchemeMode = false; bool m_isSchemeModeBlocked = false; pair m_currentModelView = {ScreenBase(), false /* initialized */}; + bool m_trackFirstSchemeData = false; };