For #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.
upstream-sync
Michael Comella 3 years ago committed by mergify[bot]
parent c251e4c5ab
commit cafc23acb1

@ -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