|
|
|
@ -12,6 +12,7 @@ import androidx.appcompat.app.AppCompatDelegate
|
|
|
|
|
import androidx.preference.PreferenceFragmentCompat
|
|
|
|
|
import androidx.preference.SwitchPreference
|
|
|
|
|
import org.mozilla.fenix.FeatureFlags
|
|
|
|
|
import org.mozilla.fenix.GleanMetrics.ToolbarSettings
|
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
|
import org.mozilla.fenix.components.metrics.Event
|
|
|
|
|
import org.mozilla.fenix.components.toolbar.ToolbarPosition
|
|
|
|
@ -115,18 +116,18 @@ class CustomizationFragment : PreferenceFragmentCompat() {
|
|
|
|
|
private fun setupToolbarCategory() {
|
|
|
|
|
val topPreference = requirePreference<RadioButtonPreference>(R.string.pref_key_toolbar_top)
|
|
|
|
|
topPreference.onClickListener {
|
|
|
|
|
requireContext().components.analytics.metrics.track(
|
|
|
|
|
Event.ToolbarPositionChanged(
|
|
|
|
|
Event.ToolbarPositionChanged.Position.TOP
|
|
|
|
|
ToolbarSettings.changedPosition.record(
|
|
|
|
|
ToolbarSettings.ChangedPositionExtra(
|
|
|
|
|
Position.TOP.name
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val bottomPreference = requirePreference<RadioButtonPreference>(R.string.pref_key_toolbar_bottom)
|
|
|
|
|
bottomPreference.onClickListener {
|
|
|
|
|
requireContext().components.analytics.metrics.track(
|
|
|
|
|
Event.ToolbarPositionChanged(
|
|
|
|
|
Event.ToolbarPositionChanged.Position.BOTTOM
|
|
|
|
|
ToolbarSettings.changedPosition.record(
|
|
|
|
|
ToolbarSettings.ChangedPositionExtra(
|
|
|
|
|
Position.BOTTOM.name
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
@ -153,4 +154,9 @@ class CustomizationFragment : PreferenceFragmentCompat() {
|
|
|
|
|
onPreferenceChangeListener = SharedPreferenceUpdater()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
|
// Used to send telemetry data about toolbar position changes
|
|
|
|
|
enum class Position { TOP, BOTTOM }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|