updated DailyMonthYearPickerDialog

This commit is contained in:
sathwikcs
2025-03-21 18:02:34 +05:30
parent e2e5733d4b
commit aed649bf7d

View File

@@ -5,7 +5,6 @@ import android.app.Dialog
import android.os.Bundle
import android.view.LayoutInflater
import android.widget.CalendarView
import android.widget.NumberPicker
import androidx.fragment.app.DialogFragment
import `in`.sminnovations.smiadmin.R
import java.util.Calendar
@@ -33,8 +32,8 @@ class DailyMonthYearPickerDialog : DialogFragment() {
// Build the Dialog
val dialog = AlertDialog.Builder(requireContext())
.setView(view)
.setTitle("Select Date")
.setPositiveButton("OK") { _, _ ->
.setTitle("Select Date for the Report")
.setPositiveButton("Generate Report") { _, _ ->
// Pass the selected date back through the callback
onDateSelected?.invoke(selectedDate)
}
@@ -47,8 +46,4 @@ class DailyMonthYearPickerDialog : DialogFragment() {
fun setOnDateSelectedListener(listener: (Calendar) -> Unit) {
onDateSelected = listener
}
fun setInitialDate(calendar: Calendar) {
selectedDate = calendar
}
}