IanTDuncan / MealTime

Project for CSC 480
0 stars 0 forks source link

UI Overhaul -- Main Menu XML Update #192

Closed BeepDroid closed 5 months ago

BeepDroid commented 5 months ago

UI Overhaul -- Main Menu XML Update

Description:


An update to our Main Menu to add some more color and design.

Steps to Reproduce:


  1. Add a FrameLayout to hold the header image.
  2. Update the buttons with the background xml.
  3. Adjust to buttons to best fit our whitespace.

Expected vs. Actual Behavior:


Implementation of new design that works with the code. It does indeed work.

Code Snippets:



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

</LinearLayout>-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF">

   <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="340dp"
        android:gravity="center"
        android:elevation="0dp"
        android:id="@+id/appbar"
        >

       <ImageView
           android:id="@+id/backgroundImage"
           android:layout_width="720dp"
           android:layout_height="410dp"
           android:layout_gravity="center"
           android:background="@mipmap/food_clipart_background" />

    </FrameLayout>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="0dp"
        android:layout_marginTop="341dp"
        android:gravity="center"
        android:text="Welcome to MealTime!"
        android:background="@color/lettuce_green"
        android:textSize="20dp"
        android:textColor="@color/white"
        android:id="@+id/welcome_message"/>

    <Button
        android:id="@+id/buttonGenerateMeal"
        android:layout_width="180dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="123dp"
        android:layout_marginTop="402dp"
        android:layout_marginBottom="20dp"
        android:background="@drawable/button_border"
        android:gravity="center"
        android:padding="16dp"
        android:text="Generate My Meal" />

    <Button
        android:id="@+id/buttonGroceryList"
        android:layout_width="180dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="506dp"
        android:layout_marginStart="123dp"
        android:layout_marginBottom="20dp"
        android:padding="16dp"
        android:background="@drawable/button_border"
        android:gravity="center"
        android:text="My Grocery List" />

    <Button
        android:id="@+id/buttonMyAccount"
        android:layout_width="180dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="123dp"
        android:layout_marginTop="609dp"
        android:layout_marginBottom="20dp"
        android:background="@drawable/button_border"
        android:gravity="center"
        android:padding="16dp"
        android:text="About MealTime" />

</RelativeLayout>

Environment Details:


Android Studio, Windows OS.

Current Status:


Completed