From 9d1701b957cfba8ae5cf1291120340c29c29aba3 Mon Sep 17 00:00:00 2001 From: andresmr Date: Tue, 28 May 2024 10:09:46 +0200 Subject: [PATCH] refactor: [ANDROAPP-6170] Remove OpenYearMonthDayAgeCalendar UiEventType Signed-off-by: andresmr --- .../eventCapture/EventCaptureActivity.kt | 9 --------- .../eventCaptureFragment/EventCaptureFormFragment.java | 9 +-------- .../eventCaptureFragment/OnEditionListener.kt | 5 ----- .../java/org/dhis2/form/ui/mapper/FormSectionMapper.kt | 2 +- 4 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/eventCaptureFragment/OnEditionListener.kt diff --git a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureActivity.kt b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureActivity.kt index 7053dc8c81..d42059d7f1 100644 --- a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureActivity.kt +++ b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/EventCaptureActivity.kt @@ -35,7 +35,6 @@ import org.dhis2.ui.dialogs.bottomsheet.BottomSheetDialogUiModel import org.dhis2.ui.dialogs.bottomsheet.DialogButtonStyle.DiscardButton import org.dhis2.ui.dialogs.bottomsheet.DialogButtonStyle.MainButton import org.dhis2.usescases.eventsWithoutRegistration.eventCapture.eventCaptureFragment.EventCaptureFormFragment -import org.dhis2.usescases.eventsWithoutRegistration.eventCapture.eventCaptureFragment.OnEditionListener import org.dhis2.usescases.eventsWithoutRegistration.eventCapture.model.EventCompletionDialog import org.dhis2.usescases.eventsWithoutRegistration.eventDetails.injection.EventDetailsComponent import org.dhis2.usescases.eventsWithoutRegistration.eventDetails.injection.EventDetailsComponentProvider @@ -90,7 +89,6 @@ class EventCaptureActivity : private var teiUid: String? = null private var enrollmentUid: String? = null private val relationshipMapButton: LiveData = MutableLiveData(false) - private var onEditionListener: OnEditionListener? = null private var adapter: EventCapturePagerAdapter? = null private var eventViewPager: ViewPager2? = null private var dashboardViewModel: DashboardViewModel? = null @@ -243,9 +241,6 @@ class EventCaptureActivity : @Deprecated("Deprecated in Java") override fun onBackPressed() { - if (onEditionListener != null) { - onEditionListener!!.onEditionListener() - } finishEditMode() } @@ -505,10 +500,6 @@ class EventCaptureActivity : // there are no relationships on events } - fun setFormEditionListener(onEditionListener: OnEditionListener?) { - this.onEditionListener = onEditionListener - } - override fun provideEventDetailsComponent(module: EventDetailsModule?): EventDetailsComponent? { return eventCaptureComponent!!.plus(module) } diff --git a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/eventCaptureFragment/EventCaptureFormFragment.java b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/eventCaptureFragment/EventCaptureFormFragment.java index e80476cb7a..67b5b694e2 100644 --- a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/eventCaptureFragment/EventCaptureFormFragment.java +++ b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/eventCaptureFragment/EventCaptureFormFragment.java @@ -34,8 +34,7 @@ import kotlin.Unit; -public class EventCaptureFormFragment extends FragmentGlobalAbstract implements EventCaptureFormView, - OnEditionListener { +public class EventCaptureFormFragment extends FragmentGlobalAbstract implements EventCaptureFormView { @Inject EventCaptureFormPresenter presenter; @@ -102,7 +101,6 @@ public void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedI .setRecords(new EventRecords(eventUid, eventMode)) .openErrorLocation(getArguments().getBoolean(OPEN_ERROR_LOCATION, false)) .build(); - activity.setFormEditionListener(this); super.onCreate(savedInstanceState); } @@ -163,11 +161,6 @@ public void performSaveClick() { formView.onSaveClick(); } - @Override - public void onEditionListener() { - - } - @Override public void hideSaveButton() { binding.actionButton.setVisibility(View.GONE); diff --git a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/eventCaptureFragment/OnEditionListener.kt b/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/eventCaptureFragment/OnEditionListener.kt deleted file mode 100644 index f41decda96..0000000000 --- a/app/src/main/java/org/dhis2/usescases/eventsWithoutRegistration/eventCapture/eventCaptureFragment/OnEditionListener.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.dhis2.usescases.eventsWithoutRegistration.eventCapture.eventCaptureFragment - -interface OnEditionListener { - fun onEditionListener() -} diff --git a/form/src/main/java/org/dhis2/form/ui/mapper/FormSectionMapper.kt b/form/src/main/java/org/dhis2/form/ui/mapper/FormSectionMapper.kt index 2f5187dbe1..118e47ae2a 100644 --- a/form/src/main/java/org/dhis2/form/ui/mapper/FormSectionMapper.kt +++ b/form/src/main/java/org/dhis2/form/ui/mapper/FormSectionMapper.kt @@ -27,7 +27,7 @@ class FormSectionMapper { null -> SectionState.FIXED }, fields = fields, - warningMessage = if (item.isOpen != false && fields.isEmpty()) { + warningMessage = if (fields.isEmpty()) { R.string.form_without_fields } else { null