Data Binding for alternative layouts
<p>I have faced with an issue with data binding for different layouts.
I have layout file for different orientation.
For portrait mode: </p>

<pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"&gt;

    &lt;FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" /&gt;

&lt;/LinearLayout&gt;
&lt;/layout&gt;
</code></pre>

<p>and for landspace mode:</p>

<pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"&gt;

    &lt;FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_weight="1"
        android:layout_height="match_parent" /&gt;

    &lt;FrameLayout
        android:id="@+id/extra_container"
        android:layout_width="match_parent"
        android:layout_weight="1"
        android:layout_height="match_parent" /&gt;

&lt;/LinearLayout&gt;
&lt;/layout&gt;
</code></pre>

<p>And when I use it for binding via</p>

<pre><code>ViewBinding binding = DataBindingUtil.setContentView(this, R.layout.view);
</code></pre>

<p>I have no access for <code>extraContainer</code> from current binding. </p>

<p>Possible solution to add the view with same id and check the view class in runtime. Any other solutions ?</p>