integrated Jetpack navigation to project so we dont have to manually code the functionallities of loading to different fragments
This commit is contained in:
136
android/app/src/main/res/navigation/list_nav_graph.xml
Normal file
136
android/app/src/main/res/navigation/list_nav_graph.xml
Normal file
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<navigation 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:id="@+id/list_nav_graph"
|
||||
app:startDestination="@id/nav_pet">
|
||||
|
||||
<!-- List Screens -->
|
||||
<fragment
|
||||
android:id="@+id/nav_pet"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.PetFragment"
|
||||
android:label="Pets"
|
||||
tools:layout="@layout/fragment_pet" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_service"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.ServiceFragment"
|
||||
android:label="Services"
|
||||
tools:layout="@layout/fragment_service" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_supplier"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.SupplierFragment"
|
||||
android:label="Suppliers"
|
||||
tools:layout="@layout/fragment_supplier" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_adoption"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.AdoptionFragment"
|
||||
android:label="Adoptions"
|
||||
tools:layout="@layout/fragment_adoption" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_appointment"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.AppointmentFragment"
|
||||
android:label="Appointments"
|
||||
tools:layout="@layout/fragment_appointment" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_inventory"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.InventoryFragment"
|
||||
android:label="Inventory"
|
||||
tools:layout="@layout/fragment_inventory" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_product"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.ProductFragment"
|
||||
android:label="Products"
|
||||
tools:layout="@layout/fragment_product" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_product_supplier"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.ProductSupplierFragment"
|
||||
android:label="Product Suppliers"
|
||||
tools:layout="@layout/fragment_product_supplier" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_purchase_order"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.PurchaseOrderFragment"
|
||||
android:label="Purchase Orders"
|
||||
tools:layout="@layout/fragment_purchase_order" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_sale"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.SaleFragment"
|
||||
android:label="Sales"
|
||||
tools:layout="@layout/fragment_sale" />
|
||||
|
||||
<!-- Detail Screens -->
|
||||
<fragment
|
||||
android:id="@+id/nav_pet_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.PetDetailFragment"
|
||||
android:label="Pet Details"
|
||||
tools:layout="@layout/fragment_pet_detail" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_pet_profile"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.listprofilefragments.PetProfileFragment"
|
||||
android:label="Pet Profile"
|
||||
tools:layout="@layout/fragment_pet_profile" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_adoption_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.AdoptionDetailFragment"
|
||||
android:label="Adoption Details"
|
||||
tools:layout="@layout/fragment_adoption_detail" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_service_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.ServiceDetailFragment"
|
||||
android:label="Service Details"
|
||||
tools:layout="@layout/fragment_service_detail" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_supplier_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.SupplierDetailFragment"
|
||||
android:label="Supplier Details"
|
||||
tools:layout="@layout/fragment_supplier_detail" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_inventory_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.InventoryDetailFragment"
|
||||
android:label="Inventory Details"
|
||||
tools:layout="@layout/fragment_inventory_detail" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_appointment_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.AppointmentDetailFragment"
|
||||
android:label="Appointment Details"
|
||||
tools:layout="@layout/fragment_appointment_detail" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_purchase_order_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.PurchaseOrderDetailFragment"
|
||||
android:label="Purchase Order Details"
|
||||
tools:layout="@layout/fragment_purchase_order_detail" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_product_supplier_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.ProductSupplierDetailFragment"
|
||||
android:label="Product Supplier Details"
|
||||
tools:layout="@layout/fragment_product_supplier_detail" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_product_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.ProductDetailFragment"
|
||||
android:label="Product Details"
|
||||
tools:layout="@layout/fragment_product_detail" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_refund_detail"
|
||||
android:name="com.example.petstoremobile.fragments.listfragments.detailfragments.RefundDetailFragment"
|
||||
android:label="Refund Details"
|
||||
tools:layout="@layout/fragment_refund_detail" />
|
||||
|
||||
</navigation>
|
||||
26
android/app/src/main/res/navigation/nav_graph.xml
Normal file
26
android/app/src/main/res/navigation/nav_graph.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<navigation 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:id="@+id/nav_graph"
|
||||
app:startDestination="@id/nav_list">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_list"
|
||||
android:name="com.example.petstoremobile.fragments.ListFragment"
|
||||
android:label="List"
|
||||
tools:layout="@layout/fragment_list" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_chat"
|
||||
android:name="com.example.petstoremobile.fragments.ChatFragment"
|
||||
android:label="Chat"
|
||||
tools:layout="@layout/fragment_chat" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_profile"
|
||||
android:name="com.example.petstoremobile.fragments.ProfileFragment"
|
||||
android:label="Profile"
|
||||
tools:layout="@layout/fragment_profile" />
|
||||
|
||||
</navigation>
|
||||
Reference in New Issue
Block a user