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"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>

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

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

        <Spinner
            android:id="@+id/fruit_spinner"
            android:layout_width="0dp"
            android:layout_height="34dp"
            android:layout_marginBottom="8dp"
            android:layout_marginEnd="4dp"
            android:background="@drawable/custom_spinner_dropdown"
            android:selectedItemPosition="@={viewModel.fruitRank}"
            android:setSpinnerAdapter="@{viewModel.fruitSpinnerAdapter}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/grade_spinner"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <Spinner
            android:id="@+id/grade_spinner"
            android:layout_width="0dp"
            android:layout_height="34dp"
            android:layout_marginBottom="8dp"
            android:layout_marginStart="4dp"
            android:background="@drawable/custom_spinner_dropdown"
            android:selectedItemPosition="@={viewModel.gradeRank}"
            android:setSpinnerAdapter="@{viewModel.gradeSpinnerAdapter}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/fruit_spinner"
            app:layout_constraintTop_toTopOf="parent" />

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