Skip to content

Commit

Permalink
For mozilla-mobile#24210: Remove wrapper from tab list view setting c…
Browse files Browse the repository at this point in the history
…hanged event.
  • Loading branch information
mcarare committed Apr 6, 2022
1 parent f740bf7 commit 13418e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
1 change: 1 addition & 0 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ events:
description: |
A string containing the name of the tab view the user tapped.
These items include: list or grid.
type: string
bugs:
- https://github.com/mozilla-mobile/fenix/issues/19956
data_reviews:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,6 @@ sealed class Event {
get() = mapOf(Autoplay.settingChangedKeys.autoplaySetting to setting.toString().lowercase(Locale.ROOT))
}

data class TabViewSettingChanged(val type: Type) : Event() {
enum class Type { LIST, GRID }

override val extras: Map<Events.tabViewChangedKeys, String>?
get() = mapOf(Events.tabViewChangedKeys.type to type.toString().lowercase(Locale.ROOT))
}

data class SearchTermGroupCount(val count: Int) : Event() {
override val extras: Map<SearchTerms.numberOfSearchTermGroupKeys, String>
get() = hashMapOf(SearchTerms.numberOfSearchTermGroupKeys.count to count.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreference
import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.GleanMetrics.Events
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.Event.TabViewSettingChanged
import org.mozilla.fenix.components.metrics.Event.TabViewSettingChanged.Type
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
Expand Down Expand Up @@ -104,12 +103,10 @@ class TabsSettingsFragment : PreferenceFragmentCompat() {
}

private fun sendTabViewTelemetry() {
val metrics = requireContext().components.analytics.metrics

if (listRadioButton.isChecked && !gridRadioButton.isChecked) {
metrics.track(TabViewSettingChanged(Type.LIST))
Events.tabViewChanged.record(Events.TabViewChangedExtra("list"))
} else {
metrics.track(TabViewSettingChanged(Type.GRID))
Events.tabViewChanged.record(Events.TabViewChangedExtra("grid"))
}
}

Expand Down

0 comments on commit 13418e8

Please sign in to comment.