ViewFlipper is not swapping includes when I use databind

0

activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/root_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

    <ViewFlipper
        android:id="@+id/view_flipper"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <include
            android:id="@+id/inc_one"
            layout="@layout/inc_layout_one" />

        <include
            android:id="@+id/inc_two"
            layout="@layout/inc_layout_two" />

        <include
            android:id="@+id/inc_three"
            layout="@layout/inc_layout_three" />

        <include
            android:id="@+id/inc_four"
            layout="@layout/inc_layout_four" />
    </ViewFlipper>
</LinearLayout>

inc_layout_one.xml / two / three / four

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>

        <variable
            name="user"
            type="io.project.User" />
    </data>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:id="@+id/include_2_indiv_register_root"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <!-- a lot of views -->
       </LinearLayout>
    </ScrollView>
</layout>

In my toolbar there is a button to "navigate" ("Next Step") through the ViewFlipper includes. When I move to the 3rd include and back to 2nd, my view_flipper object changes the mChildDisplayed attribute (I saw this in debug mode) but not on my device, on the device it continues on the 3rd include. If I remove the tag from my activity_main.xml, it works normally

Any suggestions? :

NOTE: This occurs only when I use the databind.

    
asked by anonymous 02.04.2018 / 18:40

0 answers