list fragments to view
This commit is contained in:
@@ -17,6 +17,10 @@ import com.example.petstoremobile.R;
|
|||||||
import com.example.petstoremobile.fragments.listfragments.PetFragment;
|
import com.example.petstoremobile.fragments.listfragments.PetFragment;
|
||||||
import com.example.petstoremobile.fragments.listfragments.ServiceFragment;
|
import com.example.petstoremobile.fragments.listfragments.ServiceFragment;
|
||||||
import com.example.petstoremobile.fragments.listfragments.SupplierFragment;
|
import com.example.petstoremobile.fragments.listfragments.SupplierFragment;
|
||||||
|
import com.example.petstoremobile.fragments.listfragments.AdoptionFragment;
|
||||||
|
import com.example.petstoremobile.fragments.listfragments.AppointmentFragment;
|
||||||
|
import com.example.petstoremobile.fragments.listfragments.InventoryFragment;
|
||||||
|
import com.example.petstoremobile.fragments.listfragments.ProductFragment;
|
||||||
|
|
||||||
//The Fragment for the displaying the list of entities to be viewed
|
//The Fragment for the displaying the list of entities to be viewed
|
||||||
public class ListFragment extends Fragment {
|
public class ListFragment extends Fragment {
|
||||||
@@ -25,6 +29,10 @@ public class ListFragment extends Fragment {
|
|||||||
private LinearLayout drawerPets, drawerServices, drawerSuppliers;
|
private LinearLayout drawerPets, drawerServices, drawerSuppliers;
|
||||||
private View touchBlocker;
|
private View touchBlocker;
|
||||||
|
|
||||||
|
// Adoptions, Appointments, Inventory, Products
|
||||||
|
|
||||||
|
private LinearLayout drawerAdoptions, drawerAppointments, drawerInventory, drawerProducts;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
@@ -36,6 +44,10 @@ public class ListFragment extends Fragment {
|
|||||||
drawerPets = view.findViewById(R.id.drawerPets);
|
drawerPets = view.findViewById(R.id.drawerPets);
|
||||||
drawerServices = view.findViewById(R.id.drawerServices);
|
drawerServices = view.findViewById(R.id.drawerServices);
|
||||||
drawerSuppliers = view.findViewById(R.id.drawerSuppliers);
|
drawerSuppliers = view.findViewById(R.id.drawerSuppliers);
|
||||||
|
drawerAdoptions = view.findViewById(R.id.drawerAdoptions);
|
||||||
|
drawerAppointments = view.findViewById(R.id.drawerAppointments);
|
||||||
|
drawerInventory = view.findViewById(R.id.drawerInventory);
|
||||||
|
drawerProducts = view.findViewById(R.id.drawerProducts);
|
||||||
|
|
||||||
//needed to disable touches on the innerContainer while the drawer is open
|
//needed to disable touches on the innerContainer while the drawer is open
|
||||||
touchBlocker = view.findViewById(R.id.touchBlocker);
|
touchBlocker = view.findViewById(R.id.touchBlocker);
|
||||||
@@ -89,6 +101,31 @@ public class ListFragment extends Fragment {
|
|||||||
drawerLayout.closeDrawers();
|
drawerLayout.closeDrawers();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Adoptions
|
||||||
|
|
||||||
|
drawerAdoptions.setOnClickListener(v -> {
|
||||||
|
loadFragment(new AdoptionFragment());
|
||||||
|
drawerLayout.closeDrawers();
|
||||||
|
});
|
||||||
|
|
||||||
|
//Appoinment
|
||||||
|
drawerAppointments.setOnClickListener(v -> {
|
||||||
|
loadFragment(new AppointmentFragment());
|
||||||
|
drawerLayout.closeDrawers();
|
||||||
|
});
|
||||||
|
|
||||||
|
//Inventory
|
||||||
|
drawerInventory.setOnClickListener(v -> {
|
||||||
|
loadFragment(new InventoryFragment());
|
||||||
|
drawerLayout.closeDrawers();
|
||||||
|
});
|
||||||
|
|
||||||
|
//Products
|
||||||
|
drawerProducts.setOnClickListener(v -> {
|
||||||
|
loadFragment(new ProductFragment());
|
||||||
|
drawerLayout.closeDrawers();
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,6 +133,82 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/drawerAdoptions"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Adoptions"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/drawerAppointments"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Appointments"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/drawerInventory"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Inventory"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/drawerProducts"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Products"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.drawerlayout.widget.DrawerLayout>
|
</androidx.drawerlayout.widget.DrawerLayout>
|
||||||
Reference in New Issue
Block a user