|
|
|
@ -31,6 +31,7 @@ import org.mozilla.fenix.GleanMetrics.Pings
|
|
|
|
|
import org.mozilla.fenix.GleanMetrics.TopSites
|
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
|
import org.mozilla.fenix.components.AppStore
|
|
|
|
|
import org.mozilla.fenix.components.FenixSnackbar
|
|
|
|
|
import org.mozilla.fenix.databinding.TopSiteItemBinding
|
|
|
|
|
import org.mozilla.fenix.ext.bitmapForUrl
|
|
|
|
|
import org.mozilla.fenix.ext.components
|
|
|
|
@ -67,9 +68,22 @@ class TopSiteItemViewHolder(
|
|
|
|
|
is TopSiteItemMenu.Item.RenameTopSite -> interactor.onRenameTopSiteClicked(
|
|
|
|
|
topSite,
|
|
|
|
|
)
|
|
|
|
|
is TopSiteItemMenu.Item.RemoveTopSite -> interactor.onRemoveTopSiteClicked(
|
|
|
|
|
topSite,
|
|
|
|
|
)
|
|
|
|
|
is TopSiteItemMenu.Item.RemoveTopSite -> {
|
|
|
|
|
interactor.onRemoveTopSiteClicked(topSite)
|
|
|
|
|
FenixSnackbar.make(
|
|
|
|
|
view = it,
|
|
|
|
|
duration = FenixSnackbar.LENGTH_LONG,
|
|
|
|
|
isDisplayedWithBrowserToolbar = false,
|
|
|
|
|
)
|
|
|
|
|
.setText(it.context.getString(R.string.snackbar_top_site_removed))
|
|
|
|
|
.setAction(it.context.getString(R.string.snackbar_deleted_undo)) {
|
|
|
|
|
it.context.components.useCases.topSitesUseCase.addPinnedSites(
|
|
|
|
|
topSite.title.toString(),
|
|
|
|
|
topSite.url,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
.show()
|
|
|
|
|
}
|
|
|
|
|
is TopSiteItemMenu.Item.Settings -> interactor.onSettingsClicked()
|
|
|
|
|
is TopSiteItemMenu.Item.SponsorPrivacy -> interactor.onSponsorPrivacyClicked()
|
|
|
|
|
}
|
|
|
|
|