title: Access view binding in Fragment from Activity
body: <p>I am upgrading an application to remove all synthetics and use the new ViewBinding feature. So far everything works as long as you are inside of the class/layout you are accessing, but I have synthetic references to layout elements in my Main Activity.</p>
  <p>In class Fragment:</p>
  <pre><code>    private var _binding: FragmentBinding? = null
      val binding get() = _binding!!
      private val compositeDisposable = CompositeDisposable()
  
      override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
          App.instance.getAppComponent().inject(this)
          _binding = FragmentBinding.inflate(inflater, container, false)
          return binding.root
      }
  </code></pre>
  <p>In MainActivity I have:</p>
  <pre><code>    private lateinit var mainBinding: ActivityMainBinding
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(null)
          mainBinding = ActivityMainBinding.inflate(layoutInflater)
          setContentView(mainBinding.root)
      }
  </code></pre>
  <p>I have methods for dialogs which use synthetics to dim layout elements in the Fragment.
  eg.</p>
  <pre><code>//textView on fragment layout.xml
  textView?.alpha = someFloat
  </code></pre>
  <p>This works fine when synthetic, however I cannot get the new view binding to work based on Android's documention. How can I easily mimic the synthetic behavior with ViewBinding? So far it has increased the code by a large amount and does not work unless the Fragment's view has been created and has honestly made the code worse and harder to understand. I attempted to use bind off the the main activity layout root view but I got &quot;view must have a tag&quot; errors, and all layouts start with <code>&lt;layout&gt;</code>. Any help is appreciated.</p>