Newer
Older
LeftoverRecipe / app / src / main / res / layout / activity_detail_recipe.xml
MatsumotoKeiju on 10 Jul 2017 5 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"
    tools:context=".activity.DetailRecipeActivity">

    <data>

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

    </data>

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

        <ImageView
            android:id="@+id/hogeImage"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone" />

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

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/detailTitle"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="8dp"
                    android:textColor="#005299"
                    android:text="@{viewModel.recipeTitle}"
                    android:textSize="18dp" />

                <ImageView
                    android:id="@+id/detailImageView"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:adjustViewBounds="true"
                    android:padding="8dp"
                    app:imageUrl="@{viewModel.imageUrl}" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="材料"
                    android:textSize="20dp"
                    android:textStyle="bold" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="8dp"
                    android:text="@{viewModel.material}"
                    android:textSize="14dp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="作り方"
                    android:textSize="20dp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/detailStepTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="8dp"
                    android:text="@{viewModel.stepText}"
                    android:textSize="14dp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="一言コメント"
                    android:textSize="20dp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/detailDescriptTextView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="64dp"
                    android:padding="8dp"
                    android:text="@{viewModel.descriptionText}"
                    android:textSize="14dp" />

            </LinearLayout>

        </ScrollView>

        <android.support.design.widget.FloatingActionButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:layout_marginEnd="8dp"
            android:clickable="true"
            android:onClick="@{viewModel.onClickFab}"
            android:padding="5dp"
            android:src="@drawable/float_regist"
            android:visibility="@{viewModel.fabVisible}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent" />

        <android.support.constraint.ConstraintLayout
            android:visibility="@{viewModel.loadVisible}"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#ffffff">

            <ProgressBar
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="8dp"
                android:layout_marginEnd="8dp"
                android:layout_marginStart="8dp"
                android:layout_marginTop="8dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
        </android.support.constraint.ConstraintLayout>

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