No issue - Autoformatting (#4715)
parent
b733fcdbd5
commit
1328d686aa
|
@ -61,7 +61,8 @@ open class HomeActivity : AppCompatActivity(), ShareFragment.TabsSharedCallback
|
|||
|
||||
lateinit var browsingModeManager: BrowsingModeManager
|
||||
|
||||
private val onDestinationChangedListener = NavController.OnDestinationChangedListener { _, dest, _ ->
|
||||
private val onDestinationChangedListener =
|
||||
NavController.OnDestinationChangedListener { _, dest, _ ->
|
||||
val fragmentName = resources.getResourceEntryName(dest.id)
|
||||
Sentry.getContext().recordBreadcrumb(
|
||||
BreadcrumbBuilder()
|
||||
|
@ -107,7 +108,11 @@ open class HomeActivity : AppCompatActivity(), ShareFragment.TabsSharedCallback
|
|||
val appBarConfiguration = AppBarConfiguration.Builder().build()
|
||||
val navigationToolbar = findViewById<Toolbar>(R.id.navigationToolbar)
|
||||
setSupportActionBar(navigationToolbar)
|
||||
NavigationUI.setupWithNavController(navigationToolbar, navHost.navController, appBarConfiguration)
|
||||
NavigationUI.setupWithNavController(
|
||||
navigationToolbar,
|
||||
navHost.navController,
|
||||
appBarConfiguration
|
||||
)
|
||||
navigationToolbar.setNavigationOnClickListener {
|
||||
onBackPressed()
|
||||
}
|
||||
|
@ -148,7 +153,10 @@ open class HomeActivity : AppCompatActivity(), ShareFragment.TabsSharedCallback
|
|||
attrs: AttributeSet
|
||||
): View? =
|
||||
when (name) {
|
||||
EngineView::class.java.name -> components.core.engine.createView(context, attrs).asView()
|
||||
EngineView::class.java.name -> components.core.engine.createView(
|
||||
context,
|
||||
attrs
|
||||
).asView()
|
||||
else -> super.onCreateView(parent, name, context, attrs)
|
||||
}
|
||||
|
||||
|
@ -180,8 +188,11 @@ open class HomeActivity : AppCompatActivity(), ShareFragment.TabsSharedCallback
|
|||
private fun handleOpenedFromExternalSourceIfNecessary(intent: Intent?) {
|
||||
if (intent?.extras?.getBoolean(OPEN_TO_BROWSER_AND_LOAD) == true) {
|
||||
this.intent.putExtra(OPEN_TO_BROWSER_AND_LOAD, false)
|
||||
openToBrowserAndLoad(intent.getStringExtra(
|
||||
IntentReceiverActivity.SPEECH_PROCESSING), true, BrowserDirection.FromGlobal, forceSearch = true)
|
||||
openToBrowserAndLoad(
|
||||
intent.getStringExtra(
|
||||
IntentReceiverActivity.SPEECH_PROCESSING
|
||||
), true, BrowserDirection.FromGlobal, forceSearch = true
|
||||
)
|
||||
return
|
||||
} else if (intent?.extras?.getBoolean(OPEN_TO_SEARCH) == true) {
|
||||
this.intent.putExtra(OPEN_TO_SEARCH, false)
|
||||
|
@ -220,7 +231,11 @@ open class HomeActivity : AppCompatActivity(), ShareFragment.TabsSharedCallback
|
|||
sessionObserver = subscribeToSessions()
|
||||
|
||||
with(navHost.navController) {
|
||||
if (currentDestination?.id == R.id.browserFragment || popBackStack(R.id.browserFragment, false)) return
|
||||
if (currentDestination?.id == R.id.browserFragment || popBackStack(
|
||||
R.id.browserFragment,
|
||||
false
|
||||
)
|
||||
) return
|
||||
}
|
||||
|
||||
@IdRes var fragmentId: Int? = null
|
||||
|
|
|
@ -129,7 +129,9 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
bookmarked = false,
|
||||
readerActive = getSessionById()?.readerMode ?: false,
|
||||
bounceNeeded = false,
|
||||
isAppLink = getSessionById()?.let { appLink.invoke(it.url).hasExternalApp() } ?: false
|
||||
isAppLink = getSessionById()?.let {
|
||||
appLink.invoke(it.url).hasExternalApp()
|
||||
} ?: false
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -160,7 +162,12 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
engineView = engineView,
|
||||
currentSession = session,
|
||||
viewModel = viewModel,
|
||||
getSupportUrl = { SupportUtils.getSumoURLForTopic(context!!, SupportUtils.SumoTopic.HELP) },
|
||||
getSupportUrl = {
|
||||
SupportUtils.getSumoURLForTopic(
|
||||
context!!,
|
||||
SupportUtils.SumoTopic.HELP
|
||||
)
|
||||
},
|
||||
openInFenixIntent = Intent(context, IntentReceiverActivity::class.java).also {
|
||||
it.action = Intent.ACTION_VIEW
|
||||
it.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
|
@ -169,7 +176,8 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
bottomSheetBehavior = BottomSheetBehavior.from(nestedScrollQuickAction)
|
||||
)
|
||||
|
||||
browserInteractor = createBrowserToolbarViewInteractor(browserToolbarController, session)
|
||||
browserInteractor =
|
||||
createBrowserToolbarViewInteractor(browserToolbarController, session)
|
||||
|
||||
browserToolbarView = BrowserToolbarView(
|
||||
container = view.browserLayout,
|
||||
|
@ -224,7 +232,10 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
sessionManager = sessionManager,
|
||||
fragmentManager = childFragmentManager,
|
||||
sessionId = customTabSessionId,
|
||||
downloadManager = FetchDownloadManager(requireContext().applicationContext, DownloadService::class),
|
||||
downloadManager = FetchDownloadManager(
|
||||
requireContext().applicationContext,
|
||||
DownloadService::class
|
||||
),
|
||||
onNeedToRequestPermissions = { permissions ->
|
||||
requestPermissions(permissions, REQUEST_CODE_DOWNLOAD_PERMISSIONS)
|
||||
}),
|
||||
|
@ -268,7 +279,8 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
view = view
|
||||
)
|
||||
|
||||
val accentHighContrastColor = ThemeManager.resolveAttribute(R.attr.accentHighContrast, requireContext())
|
||||
val accentHighContrastColor =
|
||||
ThemeManager.resolveAttribute(R.attr.accentHighContrast, requireContext())
|
||||
|
||||
sitePermissionsFeature.set(
|
||||
feature = SitePermissionsFeature(
|
||||
|
@ -299,7 +311,8 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
FenixSnackbar.make(view.rootView, Snackbar.LENGTH_SHORT)
|
||||
.setText(getString(R.string.full_screen_notification))
|
||||
.show()
|
||||
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
||||
activity?.requestedOrientation =
|
||||
ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
||||
activity?.enterToImmersiveMode()
|
||||
toolbar.visibility = View.GONE
|
||||
nestedScrollQuickAction.visibility = View.GONE
|
||||
|
@ -314,7 +327,12 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
}
|
||||
view.swipeRefresh.apply {
|
||||
val (topMargin, bottomMargin) = if (inFullScreen) 0 to 0 else getEngineMargins()
|
||||
(layoutParams as CoordinatorLayout.LayoutParams).setMargins(0, topMargin, 0, bottomMargin)
|
||||
(layoutParams as CoordinatorLayout.LayoutParams).setMargins(
|
||||
0,
|
||||
topMargin,
|
||||
0,
|
||||
bottomMargin
|
||||
)
|
||||
}
|
||||
},
|
||||
owner = this,
|
||||
|
@ -323,7 +341,8 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
|
||||
@Suppress("ConstantConditionIf")
|
||||
if (FeatureFlags.pullToRefreshEnabled) {
|
||||
val primaryTextColor = ThemeManager.resolveAttribute(R.attr.primaryText, requireContext())
|
||||
val primaryTextColor =
|
||||
ThemeManager.resolveAttribute(R.attr.primaryText, requireContext())
|
||||
view.swipeRefresh.setColorSchemeColors(primaryTextColor)
|
||||
swipeRefreshFeature.set(
|
||||
feature = SwipeRefreshFeature(
|
||||
|
@ -448,7 +467,9 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
*/
|
||||
protected open fun removeSessionIfNeeded(): Boolean {
|
||||
getSessionById()?.let { session ->
|
||||
if (session.source == Session.Source.ACTION_VIEW) requireComponents.core.sessionManager.remove(session)
|
||||
if (session.source == Session.Source.ACTION_VIEW) requireComponents.core.sessionManager.remove(
|
||||
session
|
||||
)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -496,7 +517,8 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|||
}
|
||||
|
||||
view?.let {
|
||||
val directions = BrowserFragmentDirections.actionBrowserFragmentToQuickSettingsSheetDialogFragment(
|
||||
val directions =
|
||||
BrowserFragmentDirections.actionBrowserFragmentToQuickSettingsSheetDialogFragment(
|
||||
sessionId = session.id,
|
||||
url = session.url,
|
||||
isSecured = session.securityInfo.secure,
|
||||
|
|
|
@ -95,7 +95,8 @@ class BrowserFragment : BaseBrowserFragment(), BackHandler {
|
|||
|
||||
return super.initializeUI(view)?.also { session ->
|
||||
|
||||
quickActionSheetView = QuickActionSheetView(view.nestedScrollQuickAction, browserInteractor)
|
||||
quickActionSheetView =
|
||||
QuickActionSheetView(view.nestedScrollQuickAction, browserInteractor)
|
||||
|
||||
customTabSessionId?.let { customTabSessionId ->
|
||||
customTabsIntegration.set(
|
||||
|
|
Loading…
Reference in New Issue