DishDelish/dishdelish-app

View on GitHub
app/src/main/res/layout/recipe_ingredient_edittext.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    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"
    android:id="@+id/ingredients"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:theme="@style/Theme.SDPBootcamp">

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/ingredientsAmount"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:hint="@string/ingredientsAmountHint"
        android:textColorHint="#8e9094"
        app:layout_constraintEnd_toStartOf="@+id/ingredientsUnit"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:inputType="number" />

    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/ingredientsUnit"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:layout_marginEnd="10dp"
        android:hint="@string/ingredientsUnitHint"
        android:textColorHint="#8e9094"
        app:layout_constraintEnd_toStartOf="@+id/ingredientsName"
        app:layout_constraintStart_toEndOf="@+id/ingredientsAmount"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="text" />

    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/ingredientsName"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
        android:layout_width="170dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="10dp"
        android:hint="@string/ingredientsNameHint"
        android:minWidth="80dp"
        android:textColorHint="#8e9094"
        app:layout_constraintEnd_toStartOf="@id/offerIngredientItem"
        app:layout_constraintStart_toEndOf="@+id/ingredientsUnit"
        app:layout_constraintTop_toTopOf="parent">

        <AutoCompleteTextView
            android:id="@+id/ingredientAutoComplete"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="text" />

    </com.google.android.material.textfield.TextInputLayout>

    <ImageView
        android:id="@+id/offerIngredientItem"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_marginStart="10dp"
        android:src="@drawable/baseline_map_24"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="@id/removeIngredient"
        app:layout_constraintStart_toEndOf="@+id/ingredientsName"
        app:layout_constraintTop_toTopOf="parent"
        tools:visibility="gone"
        android:contentDescription="@string/offerIngredientItemDescription" />

    <ImageView
        android:id="@+id/removeIngredient"
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:src="@drawable/close"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/offerIngredientItem"
        app:layout_constraintTop_toTopOf="parent"
        android:contentDescription="@string/removeIngredientDescription" />

</androidx.constraintlayout.widget.ConstraintLayout>