Backed out changeset b7b5591bbe22 (bug 1890369) for causing fenix failures in HomeFragmentTest CLOSED TREE

This commit is contained in:
Cristian Tuns 2024-05-02 06:21:00 -04:00
parent 724ac2384d
commit a66d4b8629
2 changed files with 14 additions and 1 deletions

View File

@ -657,7 +657,6 @@ class HomeFragment : Fragment() {
)
},
operation = { },
anchorView = snackbarAnchorView,
elevation = TOAST_ELEVATION,
paddedForBottomToolbar = true,
)

View File

@ -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,6 +68,19 @@ class TopSiteItemViewHolder(
)
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()