[fenix] For https://github.com/mozilla-mobile/fenix/issues/21309: set up HomeActivityBinding the recommended way.

The recommended way is here:
https://developer.android.com/topic/libraries/view-binding

I was concerned with the existing implementation that binding was being
set conditionally.
pull/600/head
Michael Comella 3 years ago committed by mergify[bot]
parent 6e63dce89d
commit 595a81aec2

@ -205,11 +205,11 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
components.publicSuffixList.prefetch()
setContentView(R.layout.activity_home)
binding = ActivityHomeBinding.inflate(layoutInflater)
setContentView(binding.root)
// Must be after we set the content view
if (isVisuallyComplete) {
binding = ActivityHomeBinding.bind(window.decorView.findViewById(R.id.rootContainer))
components.performance.visualCompletenessQueue
.attachViewToRunVisualCompletenessQueueLater(WeakReference(binding.rootContainer))
}

Loading…
Cancel
Save