From 49eb339d158bfc14b260fbb812bb7090fb9f3888 Mon Sep 17 00:00:00 2001 From: Nikit Bhandari Date: Thu, 1 Aug 2019 00:13:49 +0530 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/4339 reduce build warnings (https://github.com/mozilla-mobile/fenix/pull/4340) --- .../org/mozilla/fenix/collections/CollectionCreationUIView.kt | 1 - .../main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt | 4 ++-- .../java/org/mozilla/fenix/settings/TurnOnSyncFragment.kt | 3 --- .../quicksettings/QuickSettingsSheetDialogFragment.kt | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationUIView.kt b/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationUIView.kt index 936a91146e..42704fb320 100644 --- a/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationUIView.kt +++ b/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationUIView.kt @@ -43,7 +43,6 @@ class CollectionCreationUIView( actionEmitter, changesObservable ) { - override val view = LayoutInflater.from(container.context) .inflate(R.layout.component_collection_creation, container, true) diff --git a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt index 87f69496e3..c3497729c8 100644 --- a/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt +++ b/app/src/main/java/org/mozilla/fenix/search/toolbar/ToolbarView.kt @@ -14,7 +14,7 @@ import mozilla.components.browser.domains.autocomplete.ShippedDomainsProvider import mozilla.components.browser.toolbar.BrowserToolbar import mozilla.components.concept.storage.HistoryStorage import mozilla.components.feature.toolbar.ToolbarAutocompleteFeature -import mozilla.components.support.ktx.android.content.res.pxToDp +import mozilla.components.support.ktx.android.util.dpToPx import org.mozilla.fenix.R import org.mozilla.fenix.ext.getColorFromAttr import org.mozilla.fenix.search.SearchState @@ -66,7 +66,7 @@ class ToolbarView( view.apply { editMode() - elevation = resources.pxToDp(TOOLBAR_ELEVATION_IN_DP).toFloat() + elevation = TOOLBAR_ELEVATION_IN_DP.dpToPx(resources.displayMetrics).toFloat() setOnUrlCommitListener { interactor.onUrlCommitted(it) diff --git a/app/src/main/java/org/mozilla/fenix/settings/TurnOnSyncFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/TurnOnSyncFragment.kt index 553f6c811f..2580d8d66f 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/TurnOnSyncFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/TurnOnSyncFragment.kt @@ -66,7 +66,6 @@ class TurnOnSyncFragment : Fragment(), AccountObserver { // We could auto-close this tab once we get to the end of the authentication process? // Via an interceptor, perhaps. requireComponents.analytics.metrics.track(Event.SyncAuthSignIn) - true } } @@ -75,8 +74,6 @@ class TurnOnSyncFragment : Fragment(), AccountObserver { val directions = TurnOnSyncFragmentDirections.actionTurnOnSyncFragmentToPairFragment() Navigation.findNavController(view!!).navigate(directions) requireComponents.analytics.metrics.track(Event.SyncAuthScanPairing) - - true } } diff --git a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsSheetDialogFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsSheetDialogFragment.kt index 4f7466d4d8..6dff18250b 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsSheetDialogFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/quicksettings/QuickSettingsSheetDialogFragment.kt @@ -245,7 +245,7 @@ class QuickSettingsSheetDialogFragment : AppCompatDialogFragment() { private val sessionObserver = object : Session.Observer { override fun onUrlChanged(session: Session, url: String) { lifecycleScope.launch(Dispatchers.IO) { - val host = session.url.toUri()?.host + val host = session.url.toUri().host val sitePermissions: SitePermissions? = host?.let { val storage = requireContext().components.core.permissionStorage storage.findSitePermissionsBy(it)