For #3323 Runs PublicSuffixList synchronously
parent
a58a77317e
commit
decacbfc97
|
@ -57,6 +57,8 @@ open class HomeActivity : AppCompatActivity() {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
components.publicSuffixList.prefetch()
|
||||||
browsingModeManager = createBrowsingModeManager()
|
browsingModeManager = createBrowsingModeManager()
|
||||||
themeManager = createThemeManager(
|
themeManager = createThemeManager(
|
||||||
when (browsingModeManager.isPrivate) {
|
when (browsingModeManager.isPrivate) {
|
||||||
|
|
|
@ -747,22 +747,20 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
|
||||||
private fun showSaveToCollection() {
|
private fun showSaveToCollection() {
|
||||||
val context = context ?: return
|
val context = context ?: return
|
||||||
getSessionById()?.let {
|
getSessionById()?.let {
|
||||||
launch(Dispatchers.Main) {
|
val tabs = Tab(it.id, it.url, it.url.urlToTrimmedHost(context), it.title)
|
||||||
val tabs = Tab(it.id, it.url, it.url.urlToTrimmedHost(context), it.title)
|
val viewModel = activity?.run {
|
||||||
val viewModel = activity?.run {
|
ViewModelProviders.of(this).get(CreateCollectionViewModel::class.java)
|
||||||
ViewModelProviders.of(this).get(CreateCollectionViewModel::class.java)
|
}
|
||||||
}
|
viewModel?.tabs = listOf(tabs)
|
||||||
viewModel?.tabs = listOf(tabs)
|
val selectedSet = mutableSetOf(tabs)
|
||||||
val selectedSet = mutableSetOf(tabs)
|
viewModel?.selectedTabs = selectedSet
|
||||||
viewModel?.selectedTabs = selectedSet
|
viewModel?.tabCollections = requireComponents.core.tabCollectionStorage.cachedTabCollections.reversed()
|
||||||
viewModel?.tabCollections = requireComponents.core.tabCollectionStorage.cachedTabCollections.reversed()
|
viewModel?.saveCollectionStep =
|
||||||
viewModel?.saveCollectionStep =
|
viewModel?.tabCollections?.getStepForCollectionsSize() ?: SaveCollectionStep.SelectCollection
|
||||||
viewModel?.tabCollections?.getStepForCollectionsSize() ?: SaveCollectionStep.SelectCollection
|
viewModel?.snackbarAnchorView = nestedScrollQuickAction
|
||||||
viewModel?.snackbarAnchorView = nestedScrollQuickAction
|
view?.let {
|
||||||
view?.let {
|
val directions = BrowserFragmentDirections.actionBrowserFragmentToCreateCollectionFragment()
|
||||||
val directions = BrowserFragmentDirections.actionBrowserFragmentToCreateCollectionFragment()
|
nav(R.id.browserFragment, directions)
|
||||||
nav(R.id.browserFragment, directions)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ import kotlinx.android.synthetic.main.component_collection_creation.view.*
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import mozilla.components.support.ktx.android.view.hideKeyboard
|
import mozilla.components.support.ktx.android.view.hideKeyboard
|
||||||
import mozilla.components.support.ktx.android.view.showKeyboard
|
import mozilla.components.support.ktx.android.view.showKeyboard
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
|
@ -268,18 +267,16 @@ class CollectionCreationUIView(
|
||||||
is SaveCollectionStep.RenameCollection -> {
|
is SaveCollectionStep.RenameCollection -> {
|
||||||
view.tab_list.isClickable = false
|
view.tab_list.isClickable = false
|
||||||
|
|
||||||
launch(Dispatchers.Main) {
|
it.selectedTabCollection?.let { tabCollection ->
|
||||||
it.selectedTabCollection?.let { tabCollection ->
|
tabCollection.tabs.map { tab ->
|
||||||
tabCollection.tabs.map { tab ->
|
Tab(
|
||||||
Tab(
|
tab.id.toString(),
|
||||||
tab.id.toString(),
|
tab.url,
|
||||||
tab.url,
|
tab.url.urlToTrimmedHost(view.context),
|
||||||
tab.url.urlToTrimmedHost(view.context),
|
tab.title
|
||||||
tab.title
|
)
|
||||||
)
|
}.let { tabs ->
|
||||||
}.let { tabs ->
|
collectionCreationTabListAdapter.updateData(tabs, tabs.toSet(), true)
|
||||||
collectionCreationTabListAdapter.updateData(tabs, tabs.toSet(), true)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import kotlinx.android.synthetic.main.collections_list_item.view.collection_icon
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.components.description
|
import org.mozilla.fenix.components.description
|
||||||
import org.mozilla.fenix.home.sessioncontrol.Tab
|
import org.mozilla.fenix.home.sessioncontrol.Tab
|
||||||
|
@ -82,18 +81,16 @@ class CollectionViewHolder(
|
||||||
|
|
||||||
fun bind(collection: TabCollection) {
|
fun bind(collection: TabCollection) {
|
||||||
this.collection = collection
|
this.collection = collection
|
||||||
launch(Dispatchers.Main) {
|
view.collection_item.text = collection.title
|
||||||
view.collection_item.text = collection.title
|
view.collection_description.text = collection.description(view.context)
|
||||||
view.collection_description.text = collection.description(view.context)
|
|
||||||
|
|
||||||
view.collection_icon.setColorFilter(
|
view.collection_icon.setColorFilter(
|
||||||
ContextCompat.getColor(
|
ContextCompat.getColor(
|
||||||
view.context,
|
view.context,
|
||||||
getIconColor(collection.id)
|
getIconColor(collection.id)
|
||||||
),
|
),
|
||||||
android.graphics.PorterDuff.Mode.SRC_IN
|
android.graphics.PorterDuff.Mode.SRC_IN
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("ComplexMethod", "MagicNumber")
|
@Suppress("ComplexMethod", "MagicNumber")
|
||||||
|
|
|
@ -91,7 +91,7 @@ class TabCollectionStorage(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun TabCollection.description(context: Context): String {
|
fun TabCollection.description(context: Context): String {
|
||||||
return this.tabs
|
return this.tabs
|
||||||
.map { it.url.urlToTrimmedHost(context).capitalize() }
|
.map { it.url.urlToTrimmedHost(context).capitalize() }
|
||||||
.map {
|
.map {
|
||||||
|
|
|
@ -8,6 +8,7 @@ package org.mozilla.fenix.ext
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
|
import kotlinx.coroutines.runBlocking
|
||||||
import java.net.MalformedURLException
|
import java.net.MalformedURLException
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import mozilla.components.support.ktx.android.net.hostWithoutCommonPrefixes
|
import mozilla.components.support.ktx.android.net.hostWithoutCommonPrefixes
|
||||||
|
@ -34,10 +35,12 @@ fun String?.getHostFromUrl(): String? = try {
|
||||||
/**
|
/**
|
||||||
* Trim a host's prefix and suffix
|
* Trim a host's prefix and suffix
|
||||||
*/
|
*/
|
||||||
suspend fun String.urlToTrimmedHost(context: Context): String {
|
fun String.urlToTrimmedHost(context: Context): String {
|
||||||
return try {
|
return try {
|
||||||
val host = toUri().hostWithoutCommonPrefixes ?: return this
|
val host = toUri().hostWithoutCommonPrefixes ?: return this
|
||||||
context.components.publicSuffixList.stripPublicSuffix(host).await()
|
runBlocking {
|
||||||
|
context.components.publicSuffixList.stripPublicSuffix(host).await()
|
||||||
|
}
|
||||||
} catch (e: MalformedURLException) {
|
} catch (e: MalformedURLException) {
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,15 +283,13 @@ class HomeFragment : Fragment(), CoroutineScope, AccountObserver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
launch(Dispatchers.Main) {
|
getManagedEmitter<SessionControlChange>().onNext(
|
||||||
getManagedEmitter<SessionControlChange>().onNext(
|
SessionControlChange.Change(
|
||||||
SessionControlChange.Change(
|
tabs = getListOfTabs(sessionManager = requireComponents.core.sessionManager),
|
||||||
tabs = getListOfTabs(sessionManager = requireComponents.core.sessionManager),
|
mode = currentMode(),
|
||||||
mode = currentMode(),
|
collections = requireComponents.core.tabCollectionStorage.cachedTabCollections
|
||||||
collections = requireComponents.core.tabCollectionStorage.cachedTabCollections
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
|
|
||||||
requireComponents.core.tabCollectionStorage.register(collectionStorageObserver, this)
|
requireComponents.core.tabCollectionStorage.register(collectionStorageObserver, this)
|
||||||
sessionObserver.onStart()
|
sessionObserver.onStart()
|
||||||
|
@ -566,63 +564,59 @@ class HomeFragment : Fragment(), CoroutineScope, AccountObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun removeTabWithUndo(sessionId: String) {
|
private fun removeTabWithUndo(sessionId: String) {
|
||||||
launch(Dispatchers.Main) {
|
val sessionManager = requireComponents.core.sessionManager
|
||||||
val sessionManager = requireComponents.core.sessionManager
|
|
||||||
|
|
||||||
// Update the UI with the tab removed, but don't remove it from storage yet
|
// Update the UI with the tab removed, but don't remove it from storage yet
|
||||||
getManagedEmitter<SessionControlChange>().onNext(
|
getManagedEmitter<SessionControlChange>().onNext(
|
||||||
|
|
||||||
SessionControlChange.TabsChange(
|
SessionControlChange.TabsChange(
|
||||||
sessionManager.sessions
|
sessionManager.sessions
|
||||||
.filter { (activity as HomeActivity).browsingModeManager.isPrivate == it.private }
|
.filter { (activity as HomeActivity).browsingModeManager.isPrivate == it.private }
|
||||||
.filter { it.id != sessionId }
|
.filter { it.id != sessionId }
|
||||||
.map {
|
.map {
|
||||||
val selected = it == sessionManager.selectedSession
|
val selected = it == sessionManager.selectedSession
|
||||||
Tab(
|
Tab(
|
||||||
it.id,
|
it.id,
|
||||||
it.url,
|
it.url,
|
||||||
it.url.urlToTrimmedHost(context!!),
|
it.url.urlToTrimmedHost(context!!),
|
||||||
it.title,
|
it.title,
|
||||||
selected,
|
selected,
|
||||||
it.thumbnail
|
it.thumbnail
|
||||||
)
|
)
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
val deleteOperation: (suspend () -> Unit) = {
|
|
||||||
sessionManager.findSessionById(sessionId)
|
|
||||||
?.let { session ->
|
|
||||||
sessionManager.remove(session)
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
deleteSessionJob = deleteOperation
|
|
||||||
|
|
||||||
allowUndo(
|
|
||||||
view!!, getString(R.string.snackbar_tab_deleted),
|
|
||||||
getString(R.string.snackbar_deleted_undo), {
|
|
||||||
deleteSessionJob = null
|
|
||||||
emitSessionChanges()
|
|
||||||
},
|
|
||||||
operation = deleteOperation
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
val deleteOperation: (suspend () -> Unit) = {
|
||||||
|
sessionManager.findSessionById(sessionId)
|
||||||
|
?.let { session ->
|
||||||
|
sessionManager.remove(session)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deleteSessionJob = deleteOperation
|
||||||
|
|
||||||
|
allowUndo(
|
||||||
|
view!!, getString(R.string.snackbar_tab_deleted),
|
||||||
|
getString(R.string.snackbar_deleted_undo), {
|
||||||
|
deleteSessionJob = null
|
||||||
|
emitSessionChanges()
|
||||||
|
},
|
||||||
|
operation = deleteOperation
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun emitSessionChanges() {
|
private fun emitSessionChanges() {
|
||||||
val sessionManager = context?.components?.core?.sessionManager ?: return
|
val sessionManager = context?.components?.core?.sessionManager ?: return
|
||||||
|
|
||||||
launch(Dispatchers.Main) {
|
getManagedEmitter<SessionControlChange>().onNext(
|
||||||
getManagedEmitter<SessionControlChange>().onNext(
|
SessionControlChange.TabsChange(
|
||||||
SessionControlChange.TabsChange(
|
getListOfTabs(sessionManager)
|
||||||
getListOfTabs(sessionManager)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun getListOfTabs(sessionManager: SessionManager): List<Tab> {
|
private fun getListOfTabs(sessionManager: SessionManager): List<Tab> {
|
||||||
val context = context ?: return listOf()
|
val context = context ?: return listOf()
|
||||||
return sessionManager.sessions
|
return sessionManager.sessions
|
||||||
.filter { (activity as HomeActivity).browsingModeManager.isPrivate == it.private }
|
.filter { (activity as HomeActivity).browsingModeManager.isPrivate == it.private }
|
||||||
|
@ -653,27 +647,25 @@ class HomeFragment : Fragment(), CoroutineScope, AccountObserver {
|
||||||
|
|
||||||
val context = context?.let { it } ?: return
|
val context = context?.let { it } ?: return
|
||||||
|
|
||||||
launch(Dispatchers.Main) {
|
val tabs = requireComponents.core.sessionManager.sessions.filter { !it.private }
|
||||||
val tabs = requireComponents.core.sessionManager.sessions.filter { !it.private }
|
.map { Tab(it.id, it.url, it.url.urlToTrimmedHost(context), it.title) }
|
||||||
.map { Tab(it.id, it.url, it.url.urlToTrimmedHost(context), it.title) }
|
|
||||||
|
|
||||||
val viewModel = activity?.run {
|
val viewModel = activity?.run {
|
||||||
ViewModelProviders.of(this).get(CreateCollectionViewModel::class.java)
|
ViewModelProviders.of(this).get(CreateCollectionViewModel::class.java)
|
||||||
}
|
}
|
||||||
viewModel?.tabs = tabs
|
viewModel?.tabs = tabs
|
||||||
val selectedTabs =
|
val selectedTabs =
|
||||||
tabs.find { tab -> tab.sessionId == selectedTabId } ?: if (tabs.size == 1) tabs[0] else null
|
tabs.find { tab -> tab.sessionId == selectedTabId } ?: if (tabs.size == 1) tabs[0] else null
|
||||||
val selectedSet = if (selectedTabs == null) mutableSetOf() else mutableSetOf(selectedTabs)
|
val selectedSet = if (selectedTabs == null) mutableSetOf() else mutableSetOf(selectedTabs)
|
||||||
viewModel?.selectedTabs = selectedSet
|
viewModel?.selectedTabs = selectedSet
|
||||||
viewModel?.tabCollections = requireComponents.core.tabCollectionStorage.cachedTabCollections.reversed()
|
viewModel?.tabCollections = requireComponents.core.tabCollectionStorage.cachedTabCollections.reversed()
|
||||||
viewModel?.selectedTabCollection = selectedTabCollection
|
viewModel?.selectedTabCollection = selectedTabCollection
|
||||||
viewModel?.saveCollectionStep =
|
viewModel?.saveCollectionStep =
|
||||||
step ?: viewModel?.getStepForTabsAndCollectionSize() ?: SaveCollectionStep.SelectTabs
|
step ?: viewModel?.getStepForTabsAndCollectionSize() ?: SaveCollectionStep.SelectTabs
|
||||||
|
|
||||||
view?.let {
|
view?.let {
|
||||||
val directions = HomeFragmentDirections.actionHomeFragmentToCreateCollectionFragment()
|
val directions = HomeFragmentDirections.actionHomeFragmentToCreateCollectionFragment()
|
||||||
nav(R.id.homeFragment, directions)
|
nav(R.id.homeFragment, directions)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ import kotlinx.android.synthetic.main.collection_home_list_row.view.*
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import mozilla.components.browser.menu.BrowserMenuBuilder
|
import mozilla.components.browser.menu.BrowserMenuBuilder
|
||||||
import mozilla.components.browser.menu.item.SimpleBrowserMenuItem
|
import mozilla.components.browser.menu.item.SimpleBrowserMenuItem
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
|
@ -82,33 +81,31 @@ class CollectionViewHolder(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateCollectionUI() {
|
private fun updateCollectionUI() {
|
||||||
launch(Dispatchers.Main) {
|
view.collection_title.text = collection.title
|
||||||
view.collection_title.text = collection.title
|
view.collection_description.text = collection.description(view.context)
|
||||||
view.collection_description.text = collection.description(view.context)
|
|
||||||
|
|
||||||
if (expanded) {
|
if (expanded) {
|
||||||
(view.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = 0
|
(view.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = 0
|
||||||
collection_title.setPadding(0, 0, 0, EXPANDED_PADDING)
|
collection_title.setPadding(0, 0, 0, EXPANDED_PADDING)
|
||||||
view.background = ContextCompat.getDrawable(view.context, R.drawable.rounded_top_corners)
|
view.background = ContextCompat.getDrawable(view.context, R.drawable.rounded_top_corners)
|
||||||
view.collection_description.visibility = View.GONE
|
view.collection_description.visibility = View.GONE
|
||||||
|
|
||||||
view.chevron.setBackgroundResource(R.drawable.ic_chevron_up)
|
view.chevron.setBackgroundResource(R.drawable.ic_chevron_up)
|
||||||
} else {
|
} else {
|
||||||
(view.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = COLLAPSED_MARGIN
|
(view.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = COLLAPSED_MARGIN
|
||||||
view.background = ContextCompat.getDrawable(view.context, R.drawable.rounded_all_corners)
|
view.background = ContextCompat.getDrawable(view.context, R.drawable.rounded_all_corners)
|
||||||
view.collection_description.visibility = View.VISIBLE
|
view.collection_description.visibility = View.VISIBLE
|
||||||
|
|
||||||
view.chevron.setBackgroundResource(R.drawable.ic_chevron_down)
|
view.chevron.setBackgroundResource(R.drawable.ic_chevron_down)
|
||||||
}
|
|
||||||
|
|
||||||
view.collection_icon.setColorFilter(
|
|
||||||
ContextCompat.getColor(
|
|
||||||
view.context,
|
|
||||||
getIconColor(collection.id)
|
|
||||||
),
|
|
||||||
android.graphics.PorterDuff.Mode.SRC_IN
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
view.collection_icon.setColorFilter(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
view.context,
|
||||||
|
getIconColor(collection.id)
|
||||||
|
),
|
||||||
|
android.graphics.PorterDuff.Mode.SRC_IN
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleExpansion(isExpanded: Boolean) {
|
private fun handleExpansion(isExpanded: Boolean) {
|
||||||
|
|
|
@ -79,9 +79,8 @@ class TabInCollectionViewHolder(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateTabUI() {
|
private fun updateTabUI() {
|
||||||
launch(Dispatchers.Main) {
|
collection_tab_hostname.text = tab.url.urlToTrimmedHost(view.context)
|
||||||
collection_tab_hostname.text = tab.url.urlToTrimmedHost(view.context)
|
|
||||||
}
|
|
||||||
collection_tab_title.text = tab.title
|
collection_tab_title.text = tab.title
|
||||||
launch(Dispatchers.IO) {
|
launch(Dispatchers.IO) {
|
||||||
val bitmap = collection_tab_icon.context.components.core.icons
|
val bitmap = collection_tab_icon.context.components.core.icons
|
||||||
|
|
|
@ -25,7 +25,6 @@ import androidx.navigation.NavController
|
||||||
import androidx.navigation.Navigation
|
import androidx.navigation.Navigation
|
||||||
import kotlinx.android.synthetic.main.fragment_bookmark.view.*
|
import kotlinx.android.synthetic.main.fragment_bookmark.view.*
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.Dispatchers.IO
|
import kotlinx.coroutines.Dispatchers.IO
|
||||||
import kotlinx.coroutines.Dispatchers.Main
|
import kotlinx.coroutines.Dispatchers.Main
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
|
@ -268,17 +267,15 @@ class BookmarkFragment : Fragment(), CoroutineScope, BackHandler, AccountObserve
|
||||||
getManagedEmitter<BookmarkChange>()
|
getManagedEmitter<BookmarkChange>()
|
||||||
.onNext(BookmarkChange.Change(currentRoot - it.item.guid))
|
.onNext(BookmarkChange.Change(currentRoot - it.item.guid))
|
||||||
|
|
||||||
launch(Dispatchers.Main) {
|
allowUndo(
|
||||||
allowUndo(
|
view!!,
|
||||||
view!!,
|
getString(R.string.bookmark_deletion_snackbar_message,
|
||||||
getString(R.string.bookmark_deletion_snackbar_message,
|
it.item.url?.urlToTrimmedHost(context)),
|
||||||
it.item.url?.urlToTrimmedHost(context)),
|
getString(R.string.bookmark_undo_deletion), { refreshBookmarks() }
|
||||||
getString(R.string.bookmark_undo_deletion), { refreshBookmarks() }
|
) {
|
||||||
) {
|
bookmarkStorage()?.deleteNode(it.item.guid)
|
||||||
bookmarkStorage()?.deleteNode(it.item.guid)
|
metrics()?.track(Event.RemoveBookmark)
|
||||||
metrics()?.track(Event.RemoveBookmark)
|
refreshBookmarks()
|
||||||
refreshBookmarks()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue