Faded text for disabled spinners in staff

This commit is contained in:
Alex
2026-04-12 00:51:49 -06:00
parent d166ec1b4d
commit 3472b4bcd7
2 changed files with 4 additions and 6 deletions

View File

@@ -217,7 +217,7 @@ public class AdoptionDetailFragment extends Fragment {
if (employees != null) SpinnerUtils.populateSpinner(requireContext(), binding.spinnerAdoptionEmployee, if (employees != null) SpinnerUtils.populateSpinner(requireContext(), binding.spinnerAdoptionEmployee,
employees, DropdownDTO::getLabel, "-- Select Staff --", state.selectedEmployeeId, DropdownDTO::getId); employees, DropdownDTO::getLabel, "-- Select Staff --", state.selectedEmployeeId, DropdownDTO::getId);
if (isStaff()) binding.spinnerAdoptionStore.setEnabled(false); if (isStaff()) UIUtils.setViewsEnabled(false, binding.spinnerAdoptionStore);
isUpdatingUI = false; isUpdatingUI = false;
} }

View File

@@ -92,7 +92,7 @@ public class PetDetailFragment extends Fragment {
boolean storeEnabled = state == null || state.isStoreEnabled; boolean storeEnabled = state == null || state.isStoreEnabled;
Long selectedStoreId = (staffCreating && storeEnabled) ? tokenManager.getPrimaryStoreId() : (state != null ? state.selectedStoreId : null); Long selectedStoreId = (staffCreating && storeEnabled) ? tokenManager.getPrimaryStoreId() : (state != null ? state.selectedStoreId : null);
updateStoreSpinnerSelection(selectedStoreId); updateStoreSpinnerSelection(selectedStoreId);
if (staffCreating && storeEnabled) binding.spinnerStore.setEnabled(false); if (staffCreating && storeEnabled) UIUtils.setViewsEnabled(false, binding.spinnerStore);
}); });
viewModel.getSpeciesList().observe(getViewLifecycleOwner(), list -> { viewModel.getSpeciesList().observe(getViewLifecycleOwner(), list -> {
@@ -356,13 +356,11 @@ public class PetDetailFragment extends Fragment {
if (isStaff() && !state.isEditing && state.isStoreEnabled) { if (isStaff() && !state.isEditing && state.isStoreEnabled) {
updateStoreSpinnerSelection(tokenManager.getPrimaryStoreId()); updateStoreSpinnerSelection(tokenManager.getPrimaryStoreId());
binding.spinnerStore.setEnabled(false); UIUtils.setViewsEnabled(false, binding.spinnerStore);
} }
if (isStaff() && state.isEditing && viewModel.isOriginallyOwnedOrAdopted()) { if (isStaff() && state.isEditing && viewModel.isOriginallyOwnedOrAdopted()) {
binding.spinnerCustomer.setEnabled(false); UIUtils.setViewsEnabled(false, binding.spinnerCustomer, binding.spinnerPetStatus, binding.spinnerStore);
binding.spinnerPetStatus.setEnabled(false);
binding.spinnerStore.setEnabled(false);
} }
isUpdatingUI = false; isUpdatingUI = false;