mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/21776 - Remove unused symbols
This commit is contained in:
parent
759194a625
commit
45e9bf6693
@ -1,29 +0,0 @@
|
||||
/* 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/. */
|
||||
|
||||
package org.mozilla.fenix.components
|
||||
|
||||
import android.annotation.TargetApi
|
||||
import android.appwidget.AppWidgetManager
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import org.mozilla.gecko.search.SearchWidgetProvider
|
||||
|
||||
/**
|
||||
* Handles the creation of the pinning search widget dialog.
|
||||
*/
|
||||
object SearchWidgetCreator {
|
||||
|
||||
/**
|
||||
* Attempts to display a prompt requesting the user pin the search widget
|
||||
* Returns true if the prompt is displayed successfully, and false otherwise.
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.O)
|
||||
fun createSearchWidget(context: Context): Boolean {
|
||||
val appWidgetManager: AppWidgetManager = context.getSystemService(AppWidgetManager::class.java)
|
||||
val myProvider = ComponentName(context, SearchWidgetProvider::class.java)
|
||||
return appWidgetManager.requestPinAppWidget(myProvider, null, null)
|
||||
}
|
||||
}
|
@ -905,8 +905,3 @@ class GleanMetricsService(
|
||||
return event.wrapper != null
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function for making our booleans fit into the string list formatting
|
||||
fun Boolean.toStringList(): List<String> {
|
||||
return listOf(this.toString())
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.sp
|
||||
import org.mozilla.fenix.theme.FirefoxTheme
|
||||
|
||||
@ -39,6 +40,7 @@ fun TabTitle(
|
||||
}
|
||||
|
||||
@Composable
|
||||
@Preview
|
||||
private fun TabTitlePreview() {
|
||||
FirefoxTheme {
|
||||
Box(Modifier.background(FirefoxTheme.colors.surface)) {
|
||||
|
@ -344,8 +344,7 @@ class HomeFragment : Fragment() {
|
||||
hideOnboarding = ::hideOnboardingAndOpenSearch,
|
||||
registerCollectionStorageObserver = ::registerCollectionStorageObserver,
|
||||
removeCollectionWithUndo = ::removeCollectionWithUndo,
|
||||
showTabTray = ::openTabsTray,
|
||||
handleSwipedItemDeletionCancel = ::handleSwipedItemDeletionCancel
|
||||
showTabTray = ::openTabsTray
|
||||
),
|
||||
recentTabController = DefaultRecentTabsController(
|
||||
selectTabUseCase = components.useCases.tabsUseCases.selectTab,
|
||||
@ -1179,11 +1178,6 @@ class HomeFragment : Fragment() {
|
||||
?.isVisible = tabCount > 0
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun handleSwipedItemDeletionCancel() {
|
||||
binding.sessionControlRecyclerView.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
private fun getRecentTabs(components: Components): List<RecentTab> {
|
||||
return if (components.settings.showRecentTabsFeature) {
|
||||
components.core.store.state.asRecentTabs()
|
||||
|
@ -63,7 +63,6 @@ class HomeMenu(
|
||||
private val syncDisconnectedBackgroundColor =
|
||||
context.getColorFromAttr(R.attr.syncDisconnectedBackground)
|
||||
|
||||
private val shouldUseBottomToolbar = context.settings().shouldUseBottomToolbar
|
||||
private val accountManager = FenixAccountManager(context)
|
||||
|
||||
// 'Reconnect' and 'Quit' items aren't needed most of the time, so we'll only create the if necessary.
|
||||
|
@ -1,21 +0,0 @@
|
||||
/* 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/. */
|
||||
|
||||
package org.mozilla.fenix.home
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
|
||||
class ImageViewTopCrop(context: Context, attrs: AttributeSet) : AppCompatImageView(context, attrs) {
|
||||
override fun setFrame(l: Int, t: Int, r: Int, b: Int): Boolean {
|
||||
val scaleFactor = width / drawable.intrinsicWidth.toFloat()
|
||||
val matrix = imageMatrix
|
||||
|
||||
matrix.setScale(scaleFactor, scaleFactor, 0f, 0f)
|
||||
imageMatrix = matrix
|
||||
|
||||
return super.setFrame(l, t, r, b)
|
||||
}
|
||||
}
|
@ -208,8 +208,7 @@ class DefaultSessionControlController(
|
||||
private val hideOnboarding: () -> Unit,
|
||||
private val registerCollectionStorageObserver: () -> Unit,
|
||||
private val removeCollectionWithUndo: (tabCollection: TabCollection) -> Unit,
|
||||
private val showTabTray: () -> Unit,
|
||||
private val handleSwipedItemDeletionCancel: () -> Unit
|
||||
private val showTabTray: () -> Unit
|
||||
) : SessionControlController {
|
||||
|
||||
override fun handleCollectionAddTabTapped(collection: TabCollection) {
|
||||
|
@ -174,11 +174,4 @@ class BookmarkView(
|
||||
if (BookmarkRoot.Mobile.id == root?.guid) context.getString(R.string.library_bookmarks) else root?.title
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if [root] matches the bookmark root ID.
|
||||
*/
|
||||
private fun BookmarkRoot.matches(root: BookmarkNode?): Boolean {
|
||||
return root == null || id == root.guid
|
||||
}
|
||||
}
|
||||
|
@ -6,10 +6,9 @@ package org.mozilla.fenix.library.downloads
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.mozilla.fenix.selection.SelectionHolder
|
||||
import org.mozilla.fenix.library.downloads.viewholders.DownloadsListItemViewHolder
|
||||
import org.mozilla.fenix.selection.SelectionHolder
|
||||
|
||||
class DownloadAdapter(
|
||||
private val downloadInteractor: DownloadInteractor
|
||||
@ -47,20 +46,4 @@ class DownloadAdapter(
|
||||
fun updatePendingDeletionIds(pendingDeletionIds: Set<String>) {
|
||||
this.pendingDeletionIds = pendingDeletionIds
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val downloadDiffCallback = object : DiffUtil.ItemCallback<DownloadItem>() {
|
||||
override fun areItemsTheSame(oldItem: DownloadItem, newItem: DownloadItem): Boolean {
|
||||
return oldItem == newItem
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(oldItem: DownloadItem, newItem: DownloadItem): Boolean {
|
||||
return oldItem == newItem
|
||||
}
|
||||
|
||||
override fun getChangePayload(oldItem: DownloadItem, newItem: DownloadItem): Any? {
|
||||
return newItem
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -820,28 +820,26 @@ class DefaultSessionControlControllerTest {
|
||||
hideOnboarding: () -> Unit = { },
|
||||
registerCollectionStorageObserver: () -> Unit = { },
|
||||
showTabTray: () -> Unit = { },
|
||||
handleSwipedItemDeletionCancel: () -> Unit = { },
|
||||
removeCollectionWithUndo: (tabCollection: TabCollection) -> Unit = { }
|
||||
): DefaultSessionControlController {
|
||||
return DefaultSessionControlController(
|
||||
activity = activity,
|
||||
store = store,
|
||||
settings = settings,
|
||||
engine = engine,
|
||||
metrics = metrics,
|
||||
store = store,
|
||||
tabCollectionStorage = tabCollectionStorage,
|
||||
addTabUseCase = tabsUseCases.addTab,
|
||||
restoreUseCase = mockk(relaxed = true),
|
||||
reloadUrlUseCase = reloadUrlUseCase.reload,
|
||||
selectTabUseCase = selectTabUseCase.selectTab,
|
||||
restoreUseCase = mockk(relaxed = true),
|
||||
fragmentStore = fragmentStore,
|
||||
navController = navController,
|
||||
viewLifecycleScope = scope,
|
||||
hideOnboarding = hideOnboarding,
|
||||
registerCollectionStorageObserver = registerCollectionStorageObserver,
|
||||
removeCollectionWithUndo = removeCollectionWithUndo,
|
||||
showTabTray = showTabTray,
|
||||
handleSwipedItemDeletionCancel = handleSwipedItemDeletionCancel
|
||||
showTabTray = showTabTray
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ package org.mozilla.fenix.library.bookmarks
|
||||
import io.mockk.mockk
|
||||
import io.mockk.verify
|
||||
import io.mockk.verifyOrder
|
||||
import mozilla.appservices.places.BookmarkRoot
|
||||
import mozilla.components.concept.storage.BookmarkNode
|
||||
import mozilla.components.concept.storage.BookmarkNodeType
|
||||
import org.junit.Before
|
||||
@ -30,9 +29,6 @@ class BookmarkFragmentInteractorTest {
|
||||
private val tree: BookmarkNode = BookmarkNode(
|
||||
BookmarkNodeType.FOLDER, "123", null, 0, "Mobile", null, 0, listOf(item, separator, item, subfolder)
|
||||
)
|
||||
private val root = BookmarkNode(
|
||||
BookmarkNodeType.FOLDER, BookmarkRoot.Root.id, null, 0, BookmarkRoot.Root.name, null, 0, null
|
||||
)
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
|
Loading…
Reference in New Issue
Block a user