Newer
Older
MonCalc / app / src / main / res / layout / regist_item.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

    <data>

        <variable
            name="viewModel"
            type="jackall.moncalc.viewmodel.RegistItemViewModel" />
    </data>

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:id="@+id/linearLayout"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:layout_marginTop="8dp"
            android:orientation="horizontal">

            <FrameLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:padding="2dp">

                <Spinner
                    android:id="@+id/fruit_spinner"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@drawable/custom_spinner_dropdown"
                    android:selectedItemPosition="@={viewModel.fruitRank}"
                    android:setSpinnerAdapter="@{viewModel.fruitSpinnerAdapter}" />
            </FrameLayout>

            <FrameLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:padding="2dp">

                <Spinner
                    android:id="@+id/grade_spinner"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@drawable/custom_spinner_dropdown"
                    android:selectedItemPosition="@={viewModel.gradeRank}"
                    android:setSpinnerAdapter="@{viewModel.gradeSpinnerAdapter}" />

            </FrameLayout>

        </LinearLayout>

    </android.support.constraint.ConstraintLayout>
</layout>