Skip to content

Commit

Permalink
Add entry point event tracking for Explore Card entry in Places (#4879)
Browse files Browse the repository at this point in the history
  • Loading branch information
cooltey authored Aug 19, 2024
1 parent 8f0feb0 commit 2f0b143
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/org/wikipedia/feed/places/PlacesCardView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.location.Location
import android.view.LayoutInflater
import androidx.core.view.isVisible
import org.wikipedia.R
import org.wikipedia.analytics.eventplatform.PlacesEvent
import org.wikipedia.databinding.ViewPlacesCardBinding
import org.wikipedia.feed.view.CardFooterView
import org.wikipedia.feed.view.DefaultFeedCardView
Expand Down Expand Up @@ -62,6 +63,7 @@ class PlacesCardView(context: Context) : DefaultFeedCardView<PlacesCard>(context
goToPlaces(it.pageTitle, it.location)
}
binding.placesCardContainer.setOnLongClickListener { view ->
PlacesEvent.logAction("places_click", "explore_feed_more_menu")
LongPressMenu(view, openPageInPlaces = true, location = it.location, callback = object : LongPressMenu.Callback {
override fun onOpenInPlaces(entry: HistoryEntry, location: Location) {
goToPlaces(entry.title, location)
Expand Down Expand Up @@ -103,6 +105,7 @@ class PlacesCardView(context: Context) : DefaultFeedCardView<PlacesCard>(context

private fun footer(card: PlacesCard) {
binding.cardFooter.callback = CardFooterView.Callback {
PlacesEvent.logAction("places_click", "explore_feed")
goToPlaces()
}
binding.cardFooter.setFooterActionText(card.footerActionText(), card.wikiSite().languageCode)
Expand Down

0 comments on commit 2f0b143

Please sign in to comment.