1
0
Fork 0

Removes FragmentPreDrawManager changes in BrowserFragment

master
ekager 2020-02-25 11:53:48 -08:00 committed by Jeff Boek
parent dcc1e9fc65
commit 511c36e191
4 changed files with 3 additions and 24 deletions

View File

@ -366,7 +366,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity() {
fun updateThemeForSession(session: Session) {
val sessionMode = BrowsingMode.fromBoolean(session.private)
browsingModeManager.mode = sessionMode
browsingModeManager.mode = sessionMode
}
protected open fun createBrowsingModeManager(initialMode: BrowsingMode): BrowsingModeManager {

View File

@ -46,6 +46,7 @@ class IntentReceiverActivity : Activity() {
)
} else {
components.analytics.metrics.track(Event.OpenedLink(Event.OpenedLink.Mode.NORMAL))
intent.putExtra(HomeActivity.PRIVATE_BROWSING_MODE, false)
listOf(
components.intentProcessors.customTabIntentProcessor,
components.intentProcessors.intentProcessor

View File

@ -87,7 +87,6 @@ import org.mozilla.fenix.ext.sessionsOfType
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.settings.SupportUtils
import org.mozilla.fenix.theme.ThemeManager
import org.mozilla.fenix.utils.FragmentPreDrawManager
/**
* Base fragment extended by [BrowserFragment].
@ -139,23 +138,10 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
)
}
// We don't need to wait on shared element transitions for view intents or custom tabs
if (getSessionById()?.source == Session.Source.ACTION_VIEW ||
getSessionById()?.isCustomTabSession() == true
) {
startPostponedEnterTransition()
}
return view
}
final override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// We don't need to wait on shared element transitions for view intents or custom tabs
if (getSessionById()?.source != Session.Source.ACTION_VIEW &&
getSessionById()?.isCustomTabSession() != true
) {
FragmentPreDrawManager(this).execute {}
}
browserInitialized = initializeUI(view) != null
}

View File

@ -26,7 +26,6 @@ import mozilla.components.feature.tabs.WindowFeature
import mozilla.components.lib.state.ext.consumeFrom
import mozilla.components.support.base.feature.UserInteractionHandler
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.components.FenixSnackbar
import org.mozilla.fenix.components.TabCollectionStorage
@ -64,6 +63,7 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
): View {
val view = super.onCreateView(inflater, container, savedInstanceState)
view.browserLayout.transitionName = "$TAB_ITEM_TRANSITION_NAME${getSessionById()?.id}"
startPostponedEnterTransition()
return view
}
@ -146,14 +146,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
override fun onResume() {
super.onResume()
getSessionById()?.let {
/**
* The session mode may be changed if the user is originally in Normal Mode and then
* opens a 3rd party link in Private Browsing Mode. Hence, we update the theme here.
* This fixes issue #5254.
*/
(activity as HomeActivity).updateThemeForSession(it)
}
requireComponents.core.tabCollectionStorage.register(collectionStorageObserver, this)
}