Added Nav Bar and Refactor some activities to fragments

- Added a nav bar to go to customer chat and staff profile
- refactored the activities for pets, suppliers, services and it's detailed activates to make the newly added nav bar to work on all screens.

TODO:
- add functionalities to profile and chat fragments
- change theme of app to stay consistent with desktop app
- change text so it uses String.xml values
This commit is contained in:
Alex
2026-03-06 04:49:15 -07:00
parent 309a209ecd
commit c7a959d4f6
49 changed files with 1249 additions and 768 deletions

View File

@@ -5,7 +5,7 @@
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.AdoptionActivity">
tools:context=".activities.listactivities.AdoptionActivity">
<TextView
android:id="@+id/textView4"

View File

@@ -5,7 +5,7 @@
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.AppointmentActivity">
tools:context=".activities.listactivities.AppointmentActivity">
<TextView
android:id="@+id/textView3"

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurface"
app:menu="@menu/bottom_nav_menu" />
</LinearLayout>

View File

@@ -5,7 +5,7 @@
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.InventoryActivity">
tools:context=".activities.listactivities.InventoryActivity">
<TextView
android:id="@+id/textView"

View File

@@ -12,9 +12,10 @@
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:src="@tools:sample/avatars" />
android:layout_width="184dp"
android:layout_height="173dp"
android:src="@drawable/petstore_logo"
android:scaleType="fitCenter" />
<TextView
android:layout_width="wrap_content"

View File

@@ -5,7 +5,7 @@
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.ProductActivity">
tools:context=".activities.listactivities.ProductActivity">
<TextView
android:id="@+id/textView2"

View File

@@ -0,0 +1,50 @@
<?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"
android:orientation="vertical"
android:background="#F5F5F5"
android:fitsSystemWindows="true">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="8dp"
android:fitsSystemWindows="true">
<LinearLayout
android:id="@+id/chatContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp"/>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp"
android:background="@android:color/white">
<EditText
android:id="@+id/etMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Type a message..."
android:inputType="text"
android:layout_marginEnd="8dp"/>
<Button
android:id="@+id/btnSend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Send"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/inner_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.ListFragment"/>

View File

@@ -7,14 +7,11 @@
android:layout_height="match_parent"
android:background="#F5F5F5">
<!-- The list of pets -->
<!-- Floating add button in the bottom right corner -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewPets"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp" />
android:padding="8dp"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabAddPet"

View File

@@ -6,18 +6,19 @@
android:background="#F5F5F5"
android:gravity="center_vertical"
android:orientation="vertical"
android:padding="24dp">
android:paddingLeft="20dp"
android:paddingRight="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tvMode"
android:layout_width="143dp"
android:layout_width="245dp"
android:layout_height="48dp"
android:fontFamily="sans-serif-black"
android:text="Add Pet"
@@ -37,17 +38,17 @@
android:id="@+id/tvPetId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="10dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="30dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="20dp"
android:text="ID: 0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Pet Name"
android:textColor="@color/black"
@@ -57,8 +58,8 @@
android:id="@+id/etPetName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="16dp"
android:hint="Enter pet name"
android:inputType="text" />
@@ -66,8 +67,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Species"
android:textColor="@color/black"
@@ -77,8 +78,8 @@
android:id="@+id/etPetSpecies"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="16dp"
android:hint="e.g. Dog, Cat, Bird"
android:inputType="text" />
@@ -86,8 +87,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Breed"
android:textColor="@color/black"
@@ -97,8 +98,8 @@
android:id="@+id/etPetBreed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="16dp"
android:hint="Enter breed"
android:inputType="text" />
@@ -106,8 +107,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Age"
android:textColor="@color/black"
@@ -117,8 +118,8 @@
android:id="@+id/etPetAge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="16dp"
android:hint="Enter age"
android:inputType="number" />
@@ -126,8 +127,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Price"
android:textColor="@color/black"
@@ -137,8 +138,8 @@
android:id="@+id/etPetPrice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="16dp"
android:hint="Enter price"
android:inputType="numberDecimal" />
@@ -146,8 +147,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Status"
android:textColor="@color/black"
@@ -157,16 +158,15 @@
android:id="@+id/spinnerPetStatus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="32dp" />
<!-- Save button always visible -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:orientation="horizontal">
<Button
@@ -189,6 +189,4 @@
</LinearLayout>
<!-- Delete button only visible when editing -->
</LinearLayout>

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:background="#F5F5F5"
android:gravity="center"
android:orientation="vertical"
android:padding="24dp">
<ImageView
android:id="@+id/imgProfile"
android:layout_width="189dp"
android:layout_height="162dp"
android:layout_marginBottom="20dp"
android:src="@drawable/placeholder" />
<Button
android:id="@+id/btnChangePhoto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Change Photo"
android:layout_marginBottom="24dp"/>
<TextView
android:id="@+id/tvProfileName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:text="Name"
android:textColor="#000000"
android:textSize="26sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvProfileRole"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:text="Staff Role"
android:textColor="#2196F3"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:text="Email"
android:textColor="#888888"
android:textSize="12sp" />
<TextView
android:id="@+id/tvProfileEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="Example@example.com"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:text="Phone"
android:textColor="#888888"
android:textSize="12sp" />
<TextView
android:id="@+id/tvProfilePhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:text="123-123-1234"
android:textColor="#000000"
android:textSize="16sp" />
<Button
android:id="@+id/btnLogout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="#F44336"
android:text="Log Out"
android:textColor="#FFFFFF" />
</LinearLayout>

View File

@@ -6,18 +6,19 @@
android:background="#F5F5F5"
android:gravity="center_vertical"
android:orientation="vertical"
android:padding="24dp">
android:paddingLeft="20dp"
android:paddingRight="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tvMode"
android:layout_width="162dp"
android:layout_width="245dp"
android:layout_height="48dp"
android:fontFamily="sans-serif-black"
android:text="Add Service"
@@ -38,17 +39,17 @@
android:id="@+id/tvServiceId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="10dp"
android:layout_marginRight="50dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="30dp"
android:text="ID: 0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Service Name"
android:textColor="@color/black"
@@ -58,8 +59,8 @@
android:id="@+id/etServiceName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="16dp"
android:hint="Enter service name"
android:inputType="text" />
@@ -67,8 +68,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Description"
android:textColor="@color/black"
@@ -78,8 +79,8 @@
android:id="@+id/etServiceDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="16dp"
android:hint="Enter description"
android:inputType="textMultiLine"
@@ -88,8 +89,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Duration (minutes)"
android:textColor="@color/black"
@@ -99,8 +100,8 @@
android:id="@+id/etServiceDuration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="16dp"
android:hint="Enter duration in minutes"
android:inputType="number" />
@@ -108,8 +109,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="4dp"
android:text="Price"
android:textColor="@color/black"
@@ -119,8 +120,8 @@
android:id="@+id/etServicePrice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="32dp"
android:hint="Enter price"
android:inputType="numberDecimal" />
@@ -128,8 +129,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:orientation="horizontal">
<Button

View File

@@ -6,19 +6,19 @@
android:background="#F5F5F5"
android:gravity="center_vertical"
android:orientation="vertical"
android:padding="24dp">
android:paddingLeft="20dp"
android:paddingRight="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tvMode"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:width="245dp"
android:fontFamily="sans-serif-black"
android:text="Add Supplier"
android:textColor="@color/black"
@@ -38,17 +38,13 @@
android:id="@+id/tvSupId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="10dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="30dp"
android:text="ID: 0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="4dp"
android:text="Company Name"
android:textColor="@color/black"
@@ -58,8 +54,6 @@
android:id="@+id/etSupCompany"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="16dp"
android:hint="Enter company name"
android:inputType="text" />
@@ -67,8 +61,6 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="4dp"
android:text="Contact First Name"
android:textColor="@color/black"
@@ -78,8 +70,6 @@
android:id="@+id/etSupContactFirstName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="16dp"
android:hint="Enter first name"
android:inputType="text" />
@@ -87,8 +77,6 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="4dp"
android:text="Contact Last Name"
android:textColor="@color/black"
@@ -98,8 +86,6 @@
android:id="@+id/etSupContactLastName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="16dp"
android:hint="Enter last name"
android:inputType="text" />
@@ -107,8 +93,6 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="4dp"
android:text="Email"
android:textColor="@color/black"
@@ -118,8 +102,6 @@
android:id="@+id/etSupEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="16dp"
android:hint="Enter email"
android:inputType="textEmailAddress" />
@@ -127,8 +109,6 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="4dp"
android:text="Phone"
android:textColor="@color/black"
@@ -138,8 +118,6 @@
android:id="@+id/etSupPhone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="32dp"
android:hint="Enter phone number"
android:inputType="phone" />
@@ -147,8 +125,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:orientation="horizontal">
<Button

View File

@@ -6,7 +6,6 @@
android:padding="16dp"
android:background="@android:color/white">
<!-- Pet name and status on the same row -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -37,7 +36,6 @@
</LinearLayout>
<!-- Species and breed -->
<TextView
android:id="@+id/tvPetSpeciesBreed"
android:layout_width="wrap_content"
@@ -47,7 +45,6 @@
android:textColor="#666666"
android:textSize="14sp" />
<!-- Age and price on the same row -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -74,7 +71,6 @@
</LinearLayout>
<!-- Divider line between items -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"

View File

@@ -6,7 +6,6 @@
android:padding="16dp"
android:background="@android:color/white">
<!-- Service name -->
<TextView
android:id="@+id/tvServiceName"
android:layout_width="match_parent"
@@ -16,7 +15,6 @@
android:textSize="18sp"
android:textStyle="bold" />
<!-- Service description -->
<TextView
android:id="@+id/tvServiceDesc"
android:layout_width="match_parent"
@@ -26,7 +24,6 @@
android:textColor="#666666"
android:textSize="14sp" />
<!-- Duration and price on the same row -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -53,7 +50,6 @@
</LinearLayout>
<!-- Divider -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"

View File

@@ -6,7 +6,6 @@
android:padding="16dp"
android:background="@android:color/white">
<!-- Company name -->
<TextView
android:id="@+id/tvSupCompany"
android:layout_width="match_parent"
@@ -16,7 +15,6 @@
android:textSize="18sp"
android:textStyle="bold" />
<!-- Contact name -->
<TextView
android:id="@+id/tvSupContactName"
android:layout_width="match_parent"
@@ -26,7 +24,6 @@
android:textColor="#666666"
android:textSize="14sp" />
<!-- Email and phone on the same row -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -52,7 +49,6 @@
</LinearLayout>
<!-- Divider -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"