IanTDuncan / MealTime

Project for CSC 480
0 stars 0 forks source link

UI Overhaul - Fragment_Layout.Xml #186

Closed BeepDroid closed 2 months ago

BeepDroid commented 2 months ago

UI Overhaul - Fragment_Layout.Xml


Description:


I added a new layout XML file that will serve as the host for our tablayout and fragment pages, those of which will take on the UX and UI of our current pages after the splash and meal generation screen.

Steps to Reproduce:


  1. Create a simple XML page and change LinearLayout to "androidx.coordinatorlayout.widget.CoordinatorLayout".
  2. Populate with an appBar to hold our tabs and seperate them from the pageViewer.
  3. Make a pageViewer, this will be saving and loading our fragments.
  4. Add a tabLayout frame! We'll be populating this with tabs in code instead of directly in the XML file.

Expected vs. Actual Behavior:


  1. The frame for fragment implementation
  2. Successfully designed.

Code Snippets:


<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    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"
    android:background="@color/lettuce_green">

    <androidx.viewpager.widget.ViewPager
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="87dp"
        android:background="@color/orange"
        >

        <com.google.android.material.tabs.TabLayout
            android:id="@+id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/mealResultsTitle"
            android:background="@color/orange"/>

    </com.google.android.material.appbar.AppBarLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>

Environment Details:


Android Studio IDE, Windows OS.

Current Status:


Completed