added pet images to petfragment and changed other views to look consistant

This commit is contained in:
Alex
2026-03-29 21:47:49 -06:00
parent c37a2fdf45
commit 67f77f4b19
29 changed files with 569 additions and 365 deletions

View File

@@ -38,9 +38,16 @@ public class HomeActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
EdgeToEdge.enable(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home); setContentView(R.layout.activity_home);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
//get the bottom navbar from the layout //get the bottom navbar from the layout
bottomNav = findViewById(R.id.bottom_navigation); bottomNav = findViewById(R.id.bottom_navigation);

View File

@@ -36,6 +36,7 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
EdgeToEdge.enable(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// Check if user is already logged in // Check if user is already logged in
@@ -54,6 +55,12 @@ public class MainActivity extends AppCompatActivity {
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
//get all controls from layout //get all controls from layout
tvLoginStatus = findViewById(R.id.tvLoginStatus); tvLoginStatus = findViewById(R.id.tvLoginStatus);
etUser = findViewById(R.id.etUser); etUser = findViewById(R.id.etUser);

View File

@@ -0,0 +1,44 @@
package com.example.petstoremobile.adapters;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import com.example.petstoremobile.R;
import java.util.List;
// A class that overrides the arrayAdapter so the text color changes based on theme
public class BlackTextArrayAdapter<T> extends ArrayAdapter<T> {
public BlackTextArrayAdapter(@NonNull Context context, int resource, @NonNull T[] objects) {
super(context, resource, objects);
}
public BlackTextArrayAdapter(@NonNull Context context, int resource, @NonNull List<T> objects) {
super(context, resource, objects);
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View view = super.getView(position, convertView, parent);
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white));
if (view instanceof TextView) {
((TextView) view).setTextColor(ContextCompat.getColor(getContext(), R.color.spinner_text));
}
return view;
}
@Override
public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View view = super.getDropDownView(position, convertView, parent);
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white));
if (view instanceof TextView) {
((TextView) view).setTextColor(ContextCompat.getColor(getContext(), R.color.spinner_text));
}
return view;
}
}

View File

@@ -63,10 +63,12 @@ public class InventoryAdapter extends RecyclerView.Adapter<InventoryAdapter.Inve
InventoryDTO inv = inventoryList.get(position); InventoryDTO inv = inventoryList.get(position);
// Column: Inventory ID // Column: Inventory ID
holder.tvInventoryId.setText(String.valueOf(inv.getInventoryId() != null ? inv.getInventoryId() : "")); String invIdStr = inv.getInventoryId() != null ? String.valueOf(inv.getInventoryId()) : "";
holder.tvInventoryId.setText("Inv ID: " + invIdStr);
// Column: Product ID // Column: Product ID
holder.tvProdId.setText(String.valueOf(inv.getProdId() != null ? inv.getProdId() : "")); String prodIdStr = inv.getProdId() != null ? String.valueOf(inv.getProdId()) : "";
holder.tvProdId.setText("Prod ID: " + prodIdStr);
// Column: Product Name // Column: Product Name
holder.tvProductName.setText(inv.getProductName() != null ? inv.getProductName() : ""); holder.tvProductName.setText(inv.getProductName() != null ? inv.getProductName() : "");

View File

@@ -4,10 +4,16 @@ import android.graphics.Color;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.api.PetApi;
import com.example.petstoremobile.api.RetrofitClient;
import com.example.petstoremobile.dtos.PetDTO; import com.example.petstoremobile.dtos.PetDTO;
import java.util.List; import java.util.List;
@@ -30,6 +36,7 @@ public class PetAdapter extends RecyclerView.Adapter<PetAdapter.PetViewHolder> {
// Get the controls of each row in recycler view // Get the controls of each row in recycler view
public static class PetViewHolder extends RecyclerView.ViewHolder { public static class PetViewHolder extends RecyclerView.ViewHolder {
TextView tvPetName, tvPetSpeciesBreed, tvPetAge, tvPetPrice, tvPetStatus; TextView tvPetName, tvPetSpeciesBreed, tvPetAge, tvPetPrice, tvPetStatus;
ImageView ivPetProfile;
public PetViewHolder(@NonNull View v) { public PetViewHolder(@NonNull View v) {
super(v); super(v);
@@ -38,6 +45,7 @@ public class PetAdapter extends RecyclerView.Adapter<PetAdapter.PetViewHolder> {
tvPetAge = v.findViewById(R.id.tvPetAge); tvPetAge = v.findViewById(R.id.tvPetAge);
tvPetPrice = v.findViewById(R.id.tvPetPrice); tvPetPrice = v.findViewById(R.id.tvPetPrice);
tvPetStatus = v.findViewById(R.id.tvPetStatus); tvPetStatus = v.findViewById(R.id.tvPetStatus);
ivPetProfile = v.findViewById(R.id.ivPetProfile);
} }
} }
@@ -74,6 +82,17 @@ public class PetAdapter extends RecyclerView.Adapter<PetAdapter.PetViewHolder> {
holder.tvPetStatus.setBackgroundColor(Color.parseColor("#F44336")); holder.tvPetStatus.setBackgroundColor(Color.parseColor("#F44336"));
} }
// Load pet image using Glide with circle crop
String imageUrl = RetrofitClient.BASE_URL + String.format(PetApi.PET_IMAGE_PATH, pet.getPetId());
Glide.with(holder.itemView.getContext())
.load(imageUrl)
.circleCrop()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true)
.placeholder(R.drawable.placeholder)
.error(R.drawable.placeholder)
.into(holder.ivPetProfile);
//when a row is clicked, open the detail view //when a row is clicked, open the detail view
holder.itemView.setOnClickListener(v -> petClickListener.onPetClick(position)); holder.itemView.setOnClickListener(v -> petClickListener.onPetClick(position));
} }

View File

@@ -24,6 +24,7 @@ import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.BlackTextArrayAdapter;
import com.example.petstoremobile.adapters.InventoryAdapter; import com.example.petstoremobile.adapters.InventoryAdapter;
import com.example.petstoremobile.api.CategoryApi; import com.example.petstoremobile.api.CategoryApi;
import com.example.petstoremobile.api.InventoryApi; import com.example.petstoremobile.api.InventoryApi;
@@ -140,7 +141,7 @@ public class InventoryFragment extends Fragment implements InventoryAdapter.OnIn
categoryNames.add(c.getCategoryName()); categoryNames.add(c.getCategoryName());
} }
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>( BlackTextArrayAdapter<String> spinnerAdapter = new BlackTextArrayAdapter<>(
requireContext(), requireContext(),
android.R.layout.simple_spinner_item, android.R.layout.simple_spinner_item,
categoryNames); categoryNames);

View File

@@ -21,6 +21,7 @@ import android.widget.Spinner;
import android.widget.Toast; import android.widget.Toast;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.BlackTextArrayAdapter;
import com.example.petstoremobile.adapters.PetAdapter; import com.example.petstoremobile.adapters.PetAdapter;
import com.example.petstoremobile.api.PetApi; import com.example.petstoremobile.api.PetApi;
import com.example.petstoremobile.api.RetrofitClient; import com.example.petstoremobile.api.RetrofitClient;
@@ -63,7 +64,6 @@ public class PetFragment extends Fragment implements PetAdapter.OnPetClickListen
setupSearch(view); setupSearch(view);
setupStatusFilter(view); setupStatusFilter(view);
setupSwipeRefresh(view); setupSwipeRefresh(view);
loadPetData();
//Add button to opens the add dialog //Add button to opens the add dialog
@@ -82,6 +82,12 @@ public class PetFragment extends Fragment implements PetAdapter.OnPetClickListen
return view; return view;
} }
@Override
public void onResume() {
super.onResume();
loadPetData();
}
private void setupSearch(View view) { private void setupSearch(View view) {
etSearch = view.findViewById(R.id.etSearchPet); etSearch = view.findViewById(R.id.etSearchPet);
etSearch.addTextChangedListener(new TextWatcher() { etSearch.addTextChangedListener(new TextWatcher() {
@@ -97,7 +103,7 @@ public class PetFragment extends Fragment implements PetAdapter.OnPetClickListen
private void setupStatusFilter(View view) { private void setupStatusFilter(View view) {
spinnerStatus = view.findViewById(R.id.spinnerStatus); spinnerStatus = view.findViewById(R.id.spinnerStatus);
String[] statuses = {"All Statuses", "Available", "Adopted"}; String[] statuses = {"All Statuses", "Available", "Adopted"};
ArrayAdapter<String> adapter = new ArrayAdapter<>(requireContext(), android.R.layout.simple_spinner_item, statuses); BlackTextArrayAdapter<String> adapter = new BlackTextArrayAdapter<>(requireContext(), android.R.layout.simple_spinner_item, statuses);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerStatus.setAdapter(adapter); spinnerStatus.setAdapter(adapter);

View File

@@ -11,6 +11,8 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.SaleAdapter; import com.example.petstoremobile.adapters.SaleAdapter;
import com.example.petstoremobile.fragments.ListFragment; import com.example.petstoremobile.fragments.ListFragment;
@@ -26,25 +28,37 @@ public class SaleFragment extends Fragment implements SaleAdapter.OnSaleClickLis
private SaleAdapter adapter; private SaleAdapter adapter;
private SwipeRefreshLayout swipeRefreshLayout; private SwipeRefreshLayout swipeRefreshLayout;
private EditText etSearch; private EditText etSearch;
private ImageButton btnHamburger;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_sale, container, false); View view = inflater.inflate(R.layout.fragment_sale, container, false);
btnHamburger = view.findViewById(R.id.btnHamburger);
setupRecyclerView(view); setupRecyclerView(view);
loadSaleData(); loadSaleData();
setupSearch(view); setupSearch(view);
setupSwipeRefresh(view); setupSwipeRefresh(view);
// Make the hamburger button open the drawer from listFragment
if (btnHamburger != null) {
btnHamburger.setOnClickListener(v -> {
ListFragment listFragment = (ListFragment) getParentFragment();
if (listFragment != null) {
listFragment.openDrawer();
}
});
}
return view; return view;
} }
private void setupSearch(View view) { private void setupSearch(View view) {
etSearch = view.findViewById(R.id.etSearchSale); etSearch = view.findViewById(R.id.etSearchSale);
etSearch.addTextChangedListener(new TextWatcher() { etSearch.addTextChangedListener(new TextWatcher() {
@Override @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
} }
@Override @Override
@@ -127,4 +141,4 @@ public class SaleFragment extends Fragment implements SaleAdapter.OnSaleClickLis
recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);
} }
} }

View File

@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.BlackTextArrayAdapter;
import com.example.petstoremobile.api.*; import com.example.petstoremobile.api.*;
import com.example.petstoremobile.dtos.*; import com.example.petstoremobile.dtos.*;
import com.example.petstoremobile.fragments.ListFragment; import com.example.petstoremobile.fragments.ListFragment;
@@ -61,7 +62,7 @@ public class AdoptionDetailFragment extends Fragment {
} }
private void setupSpinners() { private void setupSpinners() {
spinnerStatus.setAdapter(new ArrayAdapter<>(requireContext(), spinnerStatus.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, STATUSES)); android.R.layout.simple_spinner_item, STATUSES));
} }
@@ -102,7 +103,7 @@ public class AdoptionDetailFragment extends Fragment {
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
names.add("-- Select Pet --"); names.add("-- Select Pet --");
for (PetDTO p : petList) names.add(p.getPetName()); for (PetDTO p : petList) names.add(p.getPetName());
spinnerPet.setAdapter(new ArrayAdapter<>(requireContext(), spinnerPet.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, names)); android.R.layout.simple_spinner_item, names));
if (preselectedPetId != -1) { if (preselectedPetId != -1) {
for (int i = 0; i < petList.size(); i++) { for (int i = 0; i < petList.size(); i++) {
@@ -134,7 +135,7 @@ public class AdoptionDetailFragment extends Fragment {
names.add("-- Select Customer --"); names.add("-- Select Customer --");
for (CustomerDTO c : customerList) for (CustomerDTO c : customerList)
names.add(c.getFirstName() + " " + c.getLastName()); names.add(c.getFirstName() + " " + c.getLastName());
spinnerCustomer.setAdapter(new ArrayAdapter<>(requireContext(), spinnerCustomer.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, names)); android.R.layout.simple_spinner_item, names));
if (preselectedCustomerId != -1) { if (preselectedCustomerId != -1) {
for (int i = 0; i < customerList.size(); i++) { for (int i = 0; i < customerList.size(); i++) {

View File

@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.BlackTextArrayAdapter;
import com.example.petstoremobile.api.*; import com.example.petstoremobile.api.*;
import com.example.petstoremobile.dtos.*; import com.example.petstoremobile.dtos.*;
import com.example.petstoremobile.fragments.ListFragment; import com.example.petstoremobile.fragments.ListFragment;
@@ -72,15 +73,15 @@ public class AppointmentDetailFragment extends Fragment {
} }
private void setupSpinners() { private void setupSpinners() {
spinnerStatus.setAdapter(new ArrayAdapter<>(requireContext(), spinnerStatus.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, STATUSES)); android.R.layout.simple_spinner_item, STATUSES));
String[] hours = new String[HOURS.length]; String[] hours = new String[HOURS.length];
for (int i = 0; i < HOURS.length; i++) for (int i = 0; i < HOURS.length; i++)
hours[i] = String.format("%02d:00", HOURS[i]); hours[i] = String.format("%02d:00", HOURS[i]);
spinnerHour.setAdapter(new ArrayAdapter<>(requireContext(), spinnerHour.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, hours)); android.R.layout.simple_spinner_item, hours));
spinnerMinute.setAdapter(new ArrayAdapter<>(requireContext(), spinnerMinute.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, new String[]{"00","15","30","45"})); android.R.layout.simple_spinner_item, new String[]{"00","15","30","45"}));
} }
@@ -124,7 +125,7 @@ public class AppointmentDetailFragment extends Fragment {
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
names.add("-- Select Pet --"); names.add("-- Select Pet --");
for (PetDTO p : petList) names.add(p.getPetName()); for (PetDTO p : petList) names.add(p.getPetName());
spinnerPet.setAdapter(new ArrayAdapter<>(requireContext(), spinnerPet.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, names)); android.R.layout.simple_spinner_item, names));
if (preselectedPetId != -1) { if (preselectedPetId != -1) {
for (int i = 0; i < petList.size(); i++) { for (int i = 0; i < petList.size(); i++) {
@@ -154,7 +155,7 @@ public class AppointmentDetailFragment extends Fragment {
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
names.add("-- Select Service --"); names.add("-- Select Service --");
for (ServiceDTO s : serviceList) names.add(s.getServiceName()); for (ServiceDTO s : serviceList) names.add(s.getServiceName());
spinnerService.setAdapter(new ArrayAdapter<>(requireContext(), spinnerService.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, names)); android.R.layout.simple_spinner_item, names));
if (preselectedServiceId != -1) { if (preselectedServiceId != -1) {
for (int i = 0; i < serviceList.size(); i++) { for (int i = 0; i < serviceList.size(); i++) {
@@ -185,7 +186,7 @@ public class AppointmentDetailFragment extends Fragment {
names.add("-- Select Customer --"); names.add("-- Select Customer --");
for (CustomerDTO c : customerList) for (CustomerDTO c : customerList)
names.add(c.getFirstName() + " " + c.getLastName()); names.add(c.getFirstName() + " " + c.getLastName());
spinnerCustomer.setAdapter(new ArrayAdapter<>(requireContext(), spinnerCustomer.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, names)); android.R.layout.simple_spinner_item, names));
if (preselectedCustomerId != -1) { if (preselectedCustomerId != -1) {
for (int i = 0; i < customerList.size(); i++) { for (int i = 0; i < customerList.size(); i++) {
@@ -215,7 +216,7 @@ public class AppointmentDetailFragment extends Fragment {
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
names.add("-- Select Store --"); names.add("-- Select Store --");
for (StoreDTO s : storeList) names.add(s.getStoreName()); for (StoreDTO s : storeList) names.add(s.getStoreName());
spinnerStore.setAdapter(new ArrayAdapter<>(requireContext(), spinnerStore.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, names)); android.R.layout.simple_spinner_item, names));
if (preselectedStoreId != -1) { if (preselectedStoreId != -1) {
for (int i = 0; i < storeList.size(); i++) { for (int i = 0; i < storeList.size(); i++) {

View File

@@ -18,6 +18,7 @@ import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.BlackTextArrayAdapter;
import com.example.petstoremobile.api.InventoryApi; import com.example.petstoremobile.api.InventoryApi;
import com.example.petstoremobile.api.ProductApi; import com.example.petstoremobile.api.ProductApi;
import com.example.petstoremobile.api.RetrofitClient; import com.example.petstoremobile.api.RetrofitClient;
@@ -94,7 +95,7 @@ public class InventoryDetailFragment extends Fragment {
btnBack = view.findViewById(R.id.btnInventoryBack); btnBack = view.findViewById(R.id.btnInventoryBack);
// Setup dropdown adapter // Setup dropdown adapter
dropdownAdapter = new ArrayAdapter<>(requireContext(), dropdownAdapter = new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_dropdown_item_1line, new ArrayList<>()); android.R.layout.simple_dropdown_item_1line, new ArrayList<>());
etProductSearch.setAdapter(dropdownAdapter); etProductSearch.setAdapter(dropdownAdapter);
etProductSearch.setThreshold(1); // start showing after 1 character etProductSearch.setThreshold(1); // start showing after 1 character

View File

@@ -20,6 +20,7 @@ import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.BlackTextArrayAdapter;
import com.example.petstoremobile.api.PetApi; import com.example.petstoremobile.api.PetApi;
import com.example.petstoremobile.api.RetrofitClient; import com.example.petstoremobile.api.RetrofitClient;
import com.example.petstoremobile.dtos.PetDTO; import com.example.petstoremobile.dtos.PetDTO;
@@ -234,19 +235,9 @@ public class PetDetailFragment extends Fragment {
//helper function to set up the spinner menu for pet status //helper function to set up the spinner menu for pet status
private void setupSpinner() { private void setupSpinner() {
ArrayAdapter<String> adapter = new ArrayAdapter<String>(requireContext(), BlackTextArrayAdapter<String> adapter = new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, android.R.layout.simple_spinner_item,
new String[]{"Available", "Adopted"}) { new String[]{"Available", "Adopted"});
//Override the getView method for the spinner to make the text color darker for more readability
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View view = super.getView(position, convertView, parent);
((TextView) view).setTextColor(ContextCompat.getColor(requireContext(), R.color.text_dark));
return view;
}
};
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerPetStatus.setAdapter(adapter); spinnerPetStatus.setAdapter(adapter);
} }

View File

@@ -8,6 +8,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.BlackTextArrayAdapter;
import com.example.petstoremobile.api.*; import com.example.petstoremobile.api.*;
import com.example.petstoremobile.dtos.*; import com.example.petstoremobile.dtos.*;
import com.example.petstoremobile.fragments.ListFragment; import com.example.petstoremobile.fragments.ListFragment;
@@ -74,7 +75,7 @@ public class ProductDetailFragment extends Fragment {
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
names.add("-- Select Category --"); names.add("-- Select Category --");
for (CategoryDTO c : categoryList) names.add(c.getCategoryName()); for (CategoryDTO c : categoryList) names.add(c.getCategoryName());
spinnerCategory.setAdapter(new ArrayAdapter<>(requireContext(), spinnerCategory.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, names)); android.R.layout.simple_spinner_item, names));
if (preselectedCategoryId != -1) { if (preselectedCategoryId != -1) {
for (int i = 0; i < categoryList.size(); i++) { for (int i = 0; i < categoryList.size(); i++) {

View File

@@ -8,6 +8,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.BlackTextArrayAdapter;
import com.example.petstoremobile.api.*; import com.example.petstoremobile.api.*;
import com.example.petstoremobile.dtos.*; import com.example.petstoremobile.dtos.*;
import com.example.petstoremobile.fragments.ListFragment; import com.example.petstoremobile.fragments.ListFragment;
@@ -80,7 +81,7 @@ public class ProductSupplierDetailFragment extends Fragment {
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
names.add("-- Select Product --"); names.add("-- Select Product --");
for (ProductDTO p : productList) names.add(p.getProdName()); for (ProductDTO p : productList) names.add(p.getProdName());
spinnerProduct.setAdapter(new ArrayAdapter<>(requireContext(), spinnerProduct.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, names)); android.R.layout.simple_spinner_item, names));
if (preselectedProductId != -1) { if (preselectedProductId != -1) {
for (int i = 0; i < productList.size(); i++) { for (int i = 0; i < productList.size(); i++) {
@@ -111,7 +112,7 @@ public class ProductSupplierDetailFragment extends Fragment {
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
names.add("-- Select Supplier --"); names.add("-- Select Supplier --");
for (SupplierDTO s : supplierList) names.add(s.getSupCompany()); for (SupplierDTO s : supplierList) names.add(s.getSupCompany());
spinnerSupplier.setAdapter(new ArrayAdapter<>(requireContext(), spinnerSupplier.setAdapter(new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, names)); android.R.layout.simple_spinner_item, names));
if (preselectedSupplierId != -1) { if (preselectedSupplierId != -1) {
for (int i = 0; i < supplierList.size(); i++) { for (int i = 0; i < supplierList.size(); i++) {

View File

@@ -12,6 +12,7 @@ import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.example.petstoremobile.R; import com.example.petstoremobile.R;
import com.example.petstoremobile.adapters.BlackTextArrayAdapter;
import com.example.petstoremobile.fragments.ListFragment; import com.example.petstoremobile.fragments.ListFragment;
import com.example.petstoremobile.fragments.listfragments.SaleFragment; import com.example.petstoremobile.fragments.listfragments.SaleFragment;
import com.example.petstoremobile.utils.ActivityLogger; import com.example.petstoremobile.utils.ActivityLogger;
@@ -126,10 +127,10 @@ public class RefundDetailFragment extends Fragment {
} }
private void setupSpinner() { private void setupSpinner() {
ArrayAdapter<String> adapter = new ArrayAdapter<>(requireContext(), BlackTextArrayAdapter<String> adapter = new BlackTextArrayAdapter<>(requireContext(),
android.R.layout.simple_spinner_item, android.R.layout.simple_spinner_item,
new String[] { "Cash", "Card", "Debit" }); new String[] { "Cash", "Card", "Debit" });
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerRefundPayment.setAdapter(adapter); spinnerRefundPayment.setAdapter(adapter);
} }
} }

View File

@@ -5,13 +5,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:background="@color/background_grey"> android:background="@color/primary_dark">
<FrameLayout <FrameLayout
android:id="@+id/fragment_container" android:id="@+id/fragment_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"/> android:layout_weight="1"
android:background="@color/background_grey"/>
<com.google.android.material.bottomnavigation.BottomNavigationView <com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation" android:id="@+id/bottom_navigation"

View File

@@ -39,33 +39,34 @@
</LinearLayout> </LinearLayout>
<!-- Search bar --> <LinearLayout
<EditText
android:id="@+id/etSearchInventory"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:orientation="horizontal"
android:layout_marginEnd="8dp" android:padding="8dp"
android:layout_marginTop="8dp" android:gravity="center_vertical">
android:hint="Search by product or category…"
android:inputType="text"
android:drawableStart="@android:drawable/ic_menu_search"
android:drawablePadding="8dp"
android:background="@android:color/white"
android:padding="12dp"
android:textColor="@color/text_dark"/>
<!-- Category filter dropdown --> <EditText
<Spinner android:id="@+id/etSearchInventory"
android:id="@+id/spinnerCategory" android:layout_width="0dp"
android:layout_width="match_parent" android:layout_height="48dp"
android:layout_height="wrap_content" android:layout_weight="1"
android:layout_marginStart="8dp" android:hint="Search by product or category…"
android:layout_marginEnd="8dp" android:inputType="text"
android:layout_marginTop="4dp" android:drawableStart="@android:drawable/ic_menu_search"
android:layout_marginBottom="4dp" android:drawablePadding="8dp"
android:background="@android:color/white" android:background="@android:color/white"
android:padding="4dp"/> android:padding="12dp"
android:textColor="@color/text_dark"/>
<Spinner
android:id="@+id/spinnerCategory"
android:layout_width="140dp"
android:layout_height="48dp"
android:layout_marginStart="8dp"
android:background="@android:color/white"
android:padding="10dp"/>
</LinearLayout>
<!-- Bulk-delete action bar (hidden until long-press) --> <!-- Bulk-delete action bar (hidden until long-press) -->
<LinearLayout <LinearLayout

View File

@@ -9,8 +9,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical">
android:fitsSystemWindows="true">
<LinearLayout <LinearLayout
android:id="@+id/header" android:id="@+id/header"

View File

@@ -8,8 +8,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical">
android:fitsSystemWindows="true">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android" 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_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background_grey"> android:background="@color/background_grey">
@@ -10,6 +11,33 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@color/primary_dark"
android:gravity="center_vertical"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<ImageButton
android:id="@+id/btnHamburger"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/baseline_menu_36"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Open menu"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sales"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"/>
</LinearLayout>
<EditText <EditText
android:id="@+id/etSearchSale" android:id="@+id/etSearchSale"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -20,7 +48,8 @@
android:drawableStart="@android:drawable/ic_menu_search" android:drawableStart="@android:drawable/ic_menu_search"
android:drawablePadding="8dp" android:drawablePadding="8dp"
android:background="@android:color/white" android:background="@android:color/white"
android:padding="12dp"/> android:padding="12dp"
android:textColor="@color/text_dark"/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshSale" android:id="@+id/swipeRefreshSale"
@@ -37,4 +66,4 @@
</LinearLayout> </LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -1,78 +1,89 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:orientation="vertical"
app:cardCornerRadius="8dp" android:paddingStart="16dp"
app:cardElevation="2dp"> android:paddingEnd="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:background="@color/white">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="horizontal"
android:padding="16dp"> android:gravity="center_vertical">
<LinearLayout <TextView
android:layout_width="match_parent" android:id="@+id/tvAdoptionCustomerName"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="Customer Name"
android:textColor="@color/text_dark"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout <TextView
android:layout_width="0dp" android:id="@+id/tvAdoptionStatus"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_weight="1" android:layout_height="wrap_content"
android:orientation="vertical"> android:paddingStart="8dp"
android:paddingTop="3dp"
<TextView android:paddingEnd="8dp"
android:id="@+id/tvAdoptionCustomerName" android:paddingBottom="3dp"
android:layout_width="wrap_content" android:text="Status"
android:layout_height="wrap_content" android:textAllCaps="true"
android:textSize="16sp" android:textColor="@color/white"
android:textStyle="bold" android:textSize="11sp" />
android:textColor="@color/text_dark"/>
<TextView
android:id="@+id/tvAdoptionPetName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="@color/text_light"
android:layout_marginTop="2dp"/>
<TextView
android:id="@+id/tvAdoptionDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/text_light"
android:layout_marginTop="2dp"/>
<TextView
android:id="@+id/tvAdoptionFee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/text_dark"
android:layout_marginTop="2dp"/>
</LinearLayout>
<TextView
android:id="@+id/tvAdoptionStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:textSize="12sp"
android:textColor="@color/white"
android:layout_gravity="center_vertical"/>
</LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> <TextView
android:id="@+id/tvAdoptionPetName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1"
android:text="Pet Name"
android:textColor="#888888"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="8dp">
<TextView
android:id="@+id/tvAdoptionFee"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="$0.00"
android:textColor="@color/accent_coral"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvAdoptionDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Date"
android:textColor="#888888"
android:textSize="13sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
android:layout_marginTop="12dp"/>
</LinearLayout>

View File

@@ -6,16 +6,16 @@
android:background="@color/white" android:background="@color/white"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingTop="12dp" android:paddingTop="16dp"
android:paddingBottom="12dp"> android:paddingBottom="16dp"
android:gravity="center_vertical">
<!-- Checkbox (visible only in bulk-delete selection mode) --> <!-- Checkbox (visible only in bulk-delete selection mode) -->
<CheckBox <CheckBox
android:id="@+id/cbSelectInventory" android:id="@+id/cbSelectInventory"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_marginEnd="12dp"
android:layout_marginEnd="8dp"
android:visibility="gone" android:visibility="gone"
android:clickable="false" android:clickable="false"
android:focusable="false"/> android:focusable="false"/>
@@ -25,33 +25,50 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<!-- Row 1: Product Name (most prominent — like desktop table header) -->
<TextView
android:id="@+id/tvProductName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="Product Name"
android:textColor="@color/text_dark"
android:textSize="17sp"
android:textStyle="bold"/>
<!-- Row 2: Inventory ID | Product ID -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_marginTop="4dp"> android:gravity="center_vertical">
<TextView <TextView
android:id="@+id/tvInventoryId" android:id="@+id/tvProductName"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="Inv ID: —" android:ellipsize="end"
android:textColor="#888888" android:maxLines="1"
android:textSize="12sp"/> android:text="Product Name"
android:textColor="@color/text_dark"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvQuantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@color/text_dark"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/tvInventoryId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Inv ID: —"
android:textColor="#888888"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="8dp">
<TextView <TextView
android:id="@+id/tvProdId" android:id="@+id/tvProdId"
@@ -60,25 +77,15 @@
android:layout_weight="1" android:layout_weight="1"
android:text="Prod ID: —" android:text="Prod ID: —"
android:textColor="#888888" android:textColor="#888888"
android:textSize="12sp"/> android:textSize="13sp" />
</LinearLayout> </LinearLayout>
<!-- Row 3: Quantity -->
<TextView
android:id="@+id/tvQuantity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="0"
android:textSize="14sp"
android:textStyle="bold"/>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="#F0F0F0" android:background="#F0F0F0"
android:layout_marginTop="10dp"/> android:layout_marginTop="12dp"/>
</LinearLayout> </LinearLayout>

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout 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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
@@ -15,68 +16,96 @@
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <com.google.android.material.imageview.ShapeableImageView
android:id="@+id/tvPetName" android:id="@+id/ivPetProfile"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginEnd="16dp"
android:scaleType="centerCrop"
android:src="@drawable/placeholder"
app:shapeAppearanceOverlay="@style/CircleImageView"
app:strokeWidth="2dp"
app:strokeColor="#BDBDBD"
android:padding="2dp"
android:contentDescription="@string/pet_profile_image_desc" />
<LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="end" android:orientation="vertical">
android:maxLines="1"
android:text="Pet Name"
android:textColor="@color/text_dark"
android:textSize="18sp"
android:textStyle="bold" />
<TextView <LinearLayout
android:id="@+id/tvPetStatus" android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:orientation="horizontal"
android:paddingStart="8dp" android:gravity="center_vertical">
android:paddingTop="3dp"
android:paddingEnd="8dp"
android:paddingBottom="3dp"
android:text="Status"
android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout> <TextView
android:id="@+id/tvPetName"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="Pet Name"
android:textColor="@color/text_dark"
android:textSize="18sp"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/tvPetSpeciesBreed" android:id="@+id/tvPetStatus"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:paddingStart="8dp"
android:ellipsize="end" android:paddingTop="3dp"
android:maxLines="1" android:paddingEnd="8dp"
android:text="Breed" android:paddingBottom="3dp"
android:textColor="#888888" android:text="Status"
android:textSize="14sp" /> android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="11sp" />
<LinearLayout </LinearLayout>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="8dp">
<TextView <TextView
android:id="@+id/tvPetPrice" android:id="@+id/tvPetSpeciesBreed"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_marginTop="4dp"
android:text="$126.00" android:ellipsize="end"
android:textColor="@color/accent_coral" android:maxLines="1"
android:textSize="16sp" android:text="Breed"
android:textStyle="bold" /> android:textColor="#888888"
android:textSize="14sp" />
<TextView <LinearLayout
android:id="@+id/tvPetAge" android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:orientation="horizontal"
android:text="1" android:gravity="center_vertical"
android:textColor="#888888" android:layout_marginTop="8dp">
android:textSize="13sp" />
<TextView
android:id="@+id/tvPetPrice"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="$126.00"
android:textColor="@color/accent_coral"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvPetAge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:textColor="#888888"
android:textSize="13sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>

View File

@@ -1,69 +1,70 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:orientation="vertical"
app:cardCornerRadius="8dp" android:paddingStart="16dp"
app:cardElevation="2dp"> android:paddingEnd="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:background="@color/white">
<TextView
android:id="@+id/tvProductName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="Product Name"
android:textColor="@color/text_dark"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvProductCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1"
android:text="Category"
android:textColor="#888888"
android:textSize="14sp" />
<TextView
android:id="@+id/tvProductDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="2"
android:text="Product Description"
android:textColor="#888888"
android:textSize="13sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="horizontal"
android:padding="16dp"> android:gravity="center_vertical"
android:layout_marginTop="8dp">
<LinearLayout <TextView
android:layout_width="match_parent" android:id="@+id/tvProductPrice"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:layout_weight="1"
android:text="$0.00"
<LinearLayout android:textColor="@color/accent_coral"
android:layout_width="0dp" android:textSize="16sp"
android:layout_height="wrap_content" android:textStyle="bold" />
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tvProductName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/text_dark"/>
<TextView
android:id="@+id/tvProductCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="@color/text_light"
android:layout_marginTop="2dp"/>
<TextView
android:id="@+id/tvProductDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/text_light"
android:layout_marginTop="2dp"
android:maxLines="2"
android:ellipsize="end"/>
</LinearLayout>
<TextView
android:id="@+id/tvProductPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/accent_coral"
android:layout_gravity="center_vertical"/>
</LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> <View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
android:layout_marginTop="12dp"/>
</LinearLayout>

View File

@@ -1,44 +1,59 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:orientation="vertical"
app:cardCornerRadius="8dp" android:paddingStart="16dp"
app:cardElevation="2dp"> android:paddingEnd="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:background="@color/white">
<TextView
android:id="@+id/tvPSProductName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="Product Name"
android:textColor="@color/text_dark"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvPSSupplierName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1"
android:text="Supplier Name"
android:textColor="#888888"
android:textSize="14sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="horizontal"
android:padding="16dp"> android:gravity="center_vertical"
android:layout_marginTop="8dp">
<TextView
android:id="@+id/tvPSProductName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/text_dark"/>
<TextView
android:id="@+id/tvPSSupplierName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="@color/text_light"
android:layout_marginTop="2dp"/>
<TextView <TextView
android:id="@+id/tvPSCost" android:id="@+id/tvPSCost"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="14sp" android:layout_weight="1"
android:textStyle="bold" android:text="$0.00"
android:textColor="@color/accent_coral" android:textColor="@color/accent_coral"
android:layout_marginTop="4dp"/> android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> <View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
android:layout_marginTop="12dp"/>
</LinearLayout>

View File

@@ -1,70 +1,80 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:orientation="vertical"
app:cardCornerRadius="8dp" android:paddingStart="16dp"
app:cardElevation="2dp"> android:paddingEnd="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:background="@color/white">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="horizontal"
android:padding="16dp"> android:gravity="center_vertical">
<LinearLayout <TextView
android:layout_width="match_parent" android:id="@+id/tvPOId"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="PO #000"
android:textColor="@color/text_dark"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout <TextView
android:layout_width="0dp" android:id="@+id/tvPOStatus"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_weight="1" android:layout_height="wrap_content"
android:orientation="vertical"> android:paddingStart="8dp"
android:paddingTop="3dp"
<TextView android:paddingEnd="8dp"
android:id="@+id/tvPOId" android:paddingBottom="3dp"
android:layout_width="wrap_content" android:text="Status"
android:layout_height="wrap_content" android:textAllCaps="true"
android:textSize="16sp" android:textColor="@color/white"
android:textStyle="bold" android:textSize="11sp" />
android:textColor="@color/text_dark"/>
<TextView
android:id="@+id/tvPOSupplier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="@color/text_light"
android:layout_marginTop="2dp"/>
<TextView
android:id="@+id/tvPODate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/text_light"
android:layout_marginTop="2dp"/>
</LinearLayout>
<TextView
android:id="@+id/tvPOStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:textSize="12sp"
android:textColor="@color/white"
android:layout_gravity="center_vertical"/>
</LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> <TextView
android:id="@+id/tvPOSupplier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1"
android:text="Supplier Name"
android:textColor="#888888"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="8dp">
<TextView
android:id="@+id/tvPODate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Date"
android:textColor="#888888"
android:textSize="13sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
android:layout_marginTop="12dp"/>
</LinearLayout>

View File

@@ -11,4 +11,5 @@
<color name="status_available">#2ECC71</color> <color name="status_available">#2ECC71</color>
<color name="status_adopted">#E74C3C</color> <color name="status_adopted">#E74C3C</color>
<color name="accent_blue">#3498DB</color> <color name="accent_blue">#3498DB</color>
<color name="spinner_text">#000000</color>
</resources> </resources>

View File

@@ -2,4 +2,5 @@
<string name="app_name">Leons Pet Store</string> <string name="app_name">Leons Pet Store</string>
<!-- TODO: Remove or change this placeholder text --> <!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string> <string name="hello_blank_fragment">Hello blank fragment</string>
<string name="pet_profile_image_desc">Pet Profile Image</string>
</resources> </resources>

View File

@@ -8,10 +8,13 @@
<item name="editTextStyle">@style/Widget.App.EditText</item> <item name="editTextStyle">@style/Widget.App.EditText</item>
<item name="spinnerStyle">@style/Widget.App.Spinner</item> <item name="spinnerStyle">@style/Widget.App.Spinner</item>
<item name="android:statusBarColor">@color/primary_dark</item> <item name="android:statusBarColor">@color/primary_dark</item>
<item name="android:navigationBarColor">@color/primary_dark</item>
<item name="android:windowLightStatusBar">false</item> <item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar">false</item>
</style> </style>
<style name="CircleImageView" parent="">
<item name="cornerSize">50%</item>
</style>
<style name="Widget.App.EditText" parent="Widget.AppCompat.EditText"> <style name="Widget.App.EditText" parent="Widget.AppCompat.EditText">
<item name="android:textColor">@color/text_dark</item> <item name="android:textColor">@color/text_dark</item>
</style> </style>