IanTDuncan / MealTime

Project for CSC 480
0 stars 0 forks source link

MVP - Meal Result Activity.Xml Design Update with Image Boxes #166

Closed BeepDroid closed 3 months ago

BeepDroid commented 3 months ago

MVP - Meal Result Activity.Xml Design Update with Image Boxes


Description:


This is a pretty simple update to include multuple meal results for a plan, along with pictures of said meals. Buttons are still the same and funtionality is the same, just allowing for image results now.

Steps to Reproduce:


  1. You're going to add 3 ImageView objects but don't assign them any images from the drawable folder. The images are going to come from the API url.
  2. Add some text boxes with those images for the names of each meal being returned.

Expected vs. Actual Behavior:


  1. More space for meal returns.
  2. More space has indeed been added in a way that's visible.

Code Snippets:



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Text Views for Meal Names -->
    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#FFFFFF"
        android:popupTheme="?attr/actionBarPopupTheme"
        android:theme="?attr/actionBarTheme">

        <ImageButton
            android:id="@+id/btn_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:background="?attr/selectableItemBackgroundBorderless"
            android:src="@drawable/ic_arrow_back" />
    </androidx.appcompat.widget.Toolbar>

    <TextView
        android:id="@+id/text_meal_name1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:text="Meal 1 Name"
        android:textColor="@android:color/white" />

    <TextView
        android:id="@+id/text_meal_name2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/text_meal_name1"
        android:layout_marginStart="16dp"
        android:layout_marginTop="171dp"
        android:text="Meal 2 Name"
        android:textColor="@android:color/white" />

    <!-- Image Views for Meal Images -->

    <!-- Buttons to Go Back and Save the Meal -->

    <TextView
        android:id="@+id/text_meal_name3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/text_meal_name2"
        android:layout_marginStart="16dp"
        android:layout_marginTop="167dp"
        android:text="Meal 3 Name"
        android:textColor="@android:color/white" />

    <ImageView
        android:id="@+id/image_meal1"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@id/text_meal_name1"
        android:layout_marginStart="16dp"
        android:layout_marginTop="20dp"
        />

    <ImageView
        android:id="@+id/image_meal2"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@id/text_meal_name2"
        android:layout_marginStart="16dp"
        android:layout_marginTop="20dp"
        />

    <ImageView
        android:id="@+id/image_meal3"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@id/text_meal_name3"
        android:layout_marginStart="16dp"
        android:layout_marginTop="20dp"
        />

    <Button
        android:id="@+id/btn_go_back"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/image_meal3"
        android:layout_alignParentStart="true"
        android:layout_marginStart="0dp"
        android:layout_marginTop="673dp"
        android:text="Re-Generate" />

    <Button
        android:id="@+id/btn_save_meal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/image_meal3"
        android:layout_alignParentEnd="true"
        android:layout_marginTop="717dp"
        android:layout_marginEnd="0dp"
        android:text="Save Meal" />

</RelativeLayout>

Environment Details:


Android Studio, Windows OS

Current Status:


Completed