Newer
Older
LeftoverRecipe / app / src / main / res / layout / fragment_regist_dialog.xml
MatsumotoKeiju on 10 Jul 2017 6 KB [add] menu, calendar
<?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"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="viewModel"
            type="org.ntlab.leftoverrecipe.viewmodel.RegistDialogViewModel" />

    </data>

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:orientation="vertical">

        <ScrollView
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginBottom="8dp"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            app:layout_constraintBottom_toTopOf="@+id/bootstrapButton3"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

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

                <TextView
                    android:id="@+id/textView"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="8dp"
                    android:layout_marginStart="8dp"
                    android:layout_marginTop="8dp"
                    android:text="@{viewModel.recipeTitle}"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <EditText
                    android:id="@+id/editText"
                    android:layout_width="0dp"
                    android:layout_height="46dp"
                    android:layout_marginEnd="8dp"
                    android:layout_marginStart="8dp"
                    android:hint="料理名を入力して下さい"
                    android:text="@={viewModel.recipeName}"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/textView" />

                <Spinner
                    android:id="@+id/dialogSpinner"
                    android:layout_width="199dp"
                    android:layout_height="28dp"
                    android:layout_marginStart="8dp"
                    android:layout_marginTop="8dp"
                    android:entries="@array/spinner_values"
                    android:selectedItemPosition="@={viewModel.selectedPosition}"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/editText"
                    tools:layout_editor_absoluteY="85dp"></Spinner>

                <com.beardedhen.androidbootstrap.BootstrapButton
                    android:id="@+id/dialogCaptureButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:layout_marginTop="8dp"
                    android:clickable="true"
                    android:onClick="@{viewModel.onClickCapture}"
                    android:text="料理を撮影"
                    app:bootstrapBrand="primary"
                    app:bootstrapSize="lg"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/dialogSpinner"
                    app:roundedCorners="true" />

                <ImageView
                    android:id="@+id/dialogImageView"
                    android:layout_width="300dp"
                    android:layout_height="300dp"
                    android:layout_marginStart="8dp"
                    android:layout_marginTop="8dp"
                    android:adjustViewBounds="true"
                    android:visibility="gone"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/dialogCaptureButton" />

                <EditText
                    android:id="@+id/dialogComment"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    android:layout_marginEnd="8dp"
                    android:layout_marginStart="8dp"
                    android:layout_marginTop="8dp"
                    android:hint="料理のコメントを入力して下さい"
                    android:text="@={viewModel.comment}"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/dialogImageView" />


            </android.support.constraint.ConstraintLayout>

        </ScrollView>

        <com.beardedhen.androidbootstrap.BootstrapButton
            android:id="@+id/bootstrapButton2"
            android:layout_width="140dp"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:onClick="@{viewModel.onClickOk}"
            android:text="記録する"
            app:bootstrapBrand="primary"
            app:bootstrapSize="lg"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/bootstrapButton3"
            app:roundedCorners="true" />

        <com.beardedhen.androidbootstrap.BootstrapButton
            android:id="@+id/bootstrapButton3"
            android:layout_width="140dp"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:layout_marginEnd="8dp"
            android:layout_marginStart="8dp"
            android:onClick="@{viewModel.onClickCancel}"
            android:text="キャンセル"
            app:bootstrapBrand="danger"
            app:bootstrapSize="lg"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/bootstrapButton2"
            app:layout_constraintStart_toStartOf="parent"
            app:roundedCorners="true" />

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