DishDelish/dishdelish-app

View on GitHub
app/src/main/res/layout/dialog_timer_editor.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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="16dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/timerTopWrapper"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/timerCreate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginVertical="10dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                android:id="@+id/timerCreateTitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/cook_now_timer_create_title"
                android:textSize="30sp"
                android:textStyle="bold"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/timerCreateTitleName"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="20dp"
                android:textSize="30sp"
                app:layout_constraintStart_toEndOf="@+id/timerCreateTitle"
                app:layout_constraintTop_toTopOf="parent" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:minWidth="360dp"
                android:gravity="center"
                android:orientation="vertical"
                android:layout_marginVertical="20dp"
                android:paddingVertical="20dp"
                android:background="@drawable/border"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/timerCreateTitle">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/timerCreateContent"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginVertical="10dp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/timerCreateTitle">

                    <com.google.android.material.textfield.TextInputLayout
                        android:id="@+id/timerHour"
                        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent">

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

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

                    <TextView
                        android:id="@+id/timerHourUnitCreate"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        android:layout_marginTop="20dp"
                        android:text="@string/timer_hour_unit"
                        app:layout_constraintStart_toEndOf="@+id/timerHour"
                        app:layout_constraintTop_toTopOf="parent" />

                    <com.google.android.material.textfield.TextInputLayout
                        android:id="@+id/timerMin"
                        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        app:layout_constraintStart_toEndOf="@+id/timerHourUnitCreate"
                        app:layout_constraintTop_toTopOf="parent">

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

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

                    <TextView
                        android:id="@+id/timerMinUnitCreate"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        android:layout_marginTop="20dp"
                        android:text="@string/timer_min_unit"
                        app:layout_constraintStart_toEndOf="@+id/timerMin"
                        app:layout_constraintTop_toTopOf="parent" />

                    <com.google.android.material.textfield.TextInputLayout
                        android:id="@+id/timerSec"
                        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        app:layout_constraintStart_toEndOf="@+id/timerMinUnitCreate"
                        app:layout_constraintTop_toTopOf="parent">

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

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

                    <TextView
                        android:id="@+id/timerSecUnitCreate"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        android:layout_marginTop="20dp"
                        android:text="@string/timer_sec_unit"
                        app:layout_constraintStart_toEndOf="@+id/timerSec"
                        app:layout_constraintTop_toTopOf="parent" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <LinearLayout
                    android:id="@+id/startTimer"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:orientation="vertical"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/timerCreateContent">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/start" />

                    <TextView
                        android:id="@+id/startTimerText"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/cook_now_timer_create_button" />
                </LinearLayout>
            </LinearLayout>
        </androidx.constraintlayout.widget.ConstraintLayout>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/timerEdit"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginVertical="10dp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <TextView
                android:id="@+id/timerEditTitle"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/cook_now_timer_edit_title"
                android:textSize="30sp"
                android:textStyle="bold"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/timerEditTitleName"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="20dp"
                android:textSize="30sp"
                app:layout_constraintStart_toEndOf="@+id/timerEditTitle"
                app:layout_constraintTop_toTopOf="parent" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:minWidth="360dp"
                android:gravity="center"
                android:orientation="vertical"
                android:layout_marginVertical="20dp"
                android:paddingVertical="20dp"
                android:background="@drawable/border"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/timerEditTitle">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/timerEditContent"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="15dp"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/timerEditTitle">

                    <TextView
                        android:id="@+id/timerHourNumber"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textSize="24sp"
                        android:textStyle="bold"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/timerHourUnitEdit"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        android:text="@string/timer_hour_unit"
                        android:textSize="20sp"
                        app:layout_constraintStart_toEndOf="@+id/timerHourNumber"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/timerMinNumber"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="16dp"
                        android:textSize="24sp"
                        android:textStyle="bold"
                        app:layout_constraintStart_toEndOf="@+id/timerHourUnitEdit"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/timerMinUnitEdit"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        android:text="@string/timer_min_unit"
                        android:textSize="20sp"
                        app:layout_constraintStart_toEndOf="@+id/timerMinNumber"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/timerSecNumber"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="16dp"
                        android:textSize="24sp"
                        android:textStyle="bold"
                        app:layout_constraintStart_toEndOf="@+id/timerMinUnitEdit"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/timerSecUnitEdit"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        android:text="@string/timer_sec_unit"
                        android:textSize="20sp"
                        app:layout_constraintStart_toEndOf="@+id/timerSecNumber"
                        app:layout_constraintTop_toTopOf="parent" />
                </androidx.constraintlayout.widget.ConstraintLayout>

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp">

                    <LinearLayout
                        android:id="@+id/pauseTimer"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:src="@drawable/pause" />

                        <TextView
                            android:id="@+id/pauseTimerText"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/cook_now_timer_edit_pause_button" />
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/resumeTimer"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:layout_marginStart="30dp"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:src="@drawable/resume" />

                        <TextView
                            android:id="@+id/resumeTimerText"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/cook_now_timer_edit_resume_button" />
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/cancelTimer"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:layout_marginStart="30dp"
                        android:orientation="vertical">

                        <ImageView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:src="@drawable/cancel" />

                        <TextView
                            android:id="@+id/cancelTimerText"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/cook_now_timer_edit_cancel_button" />
                    </LinearLayout>

                    <androidx.constraintlayout.helper.widget.Flow
                        android:id="@+id/timerEditButtonFlow"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        app:constraint_referenced_ids="cancelTimer,resumeTimer,pauseTimer"
                        app:flow_horizontalBias="0"
                        app:flow_horizontalGap="10dp"
                        app:flow_horizontalStyle="packed"
                        app:flow_verticalBias="0"
                        app:flow_wrapMode="chain" />
                </LinearLayout>

            </LinearLayout>

        </androidx.constraintlayout.widget.ConstraintLayout>


    </androidx.constraintlayout.widget.ConstraintLayout>


    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/timerList"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/timerTopWrapper">

        <TextView
            android:id="@+id/timerListTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/cook_now_timer_list_title"
            android:textSize="30sp"
            android:textStyle="bold"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <LinearLayout
            android:id="@+id/timerListContentWrapper"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginVertical="16dp"
            android:orientation="vertical"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/timerListTitle">

        </LinearLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>


</androidx.constraintlayout.widget.ConstraintLayout>