You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
Kotlin
30 lines
1.1 KiB
Kotlin
3 years ago
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||
|
|
||
3 years ago
|
package org.mozilla.fenix.nimbus.view
|
||
3 years ago
|
|
||
|
import androidx.navigation.NavController
|
||
|
import mozilla.components.service.nimbus.ui.NimbusExperimentsAdapterDelegate
|
||
3 years ago
|
import org.mozilla.experiments.nimbus.AvailableExperiment
|
||
3 years ago
|
import org.mozilla.fenix.ext.navigateBlockingForAsyncNavGraph
|
||
3 years ago
|
import org.mozilla.fenix.nimbus.NimbusExperimentsFragmentDirections
|
||
3 years ago
|
|
||
|
/**
|
||
|
* View used for managing Nimbus experiments.
|
||
|
*/
|
||
|
class NimbusExperimentsView(
|
||
|
private val navController: NavController
|
||
|
) : NimbusExperimentsAdapterDelegate {
|
||
|
|
||
3 years ago
|
override fun onExperimentItemClicked(experiment: AvailableExperiment) {
|
||
3 years ago
|
val directions =
|
||
3 years ago
|
NimbusExperimentsFragmentDirections.actionNimbusExperimentsFragmentToNimbusBranchesFragment(
|
||
|
experimentId = experiment.slug,
|
||
|
experimentName = experiment.userFacingName
|
||
3 years ago
|
)
|
||
|
|
||
3 years ago
|
navController.navigateBlockingForAsyncNavGraph(directions)
|
||
3 years ago
|
}
|
||
|
}
|