|
|
|
|
@ -3,9 +3,11 @@ package net.pokeranalytics.android.ui.fragment.components |
|
|
|
|
import android.app.DatePickerDialog |
|
|
|
|
import android.app.TimePickerDialog |
|
|
|
|
import android.content.Context |
|
|
|
|
import android.content.DialogInterface |
|
|
|
|
import android.text.format.DateFormat |
|
|
|
|
import android.widget.DatePicker |
|
|
|
|
import android.widget.TimePicker |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.components.DynamicRowInterface |
|
|
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
@ -41,7 +43,6 @@ class DateTimePickerManager : DatePickerDialog.OnDateSetListener, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onDateSet(view: DatePicker?, year: Int, month: Int, dayOfMonth: Int) { |
|
|
|
|
calendar.set(Calendar.YEAR, year) |
|
|
|
|
calendar.set(Calendar.MONTH, month) |
|
|
|
|
@ -64,6 +65,10 @@ class DateTimePickerManager : DatePickerDialog.OnDateSetListener, |
|
|
|
|
val day = calendar.get(Calendar.DAY_OF_MONTH) |
|
|
|
|
context?.let { |
|
|
|
|
val datePickerDialog = DatePickerDialog(it, this, year, month, day) |
|
|
|
|
datePickerDialog.setButton(DialogInterface.BUTTON_NEGATIVE, it.getString(R.string.clear)) { dialog, _ -> |
|
|
|
|
bottomSheetDelegate.clickOnClear(row) |
|
|
|
|
dialog.dismiss() |
|
|
|
|
} |
|
|
|
|
datePickerDialog.show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -76,6 +81,10 @@ class DateTimePickerManager : DatePickerDialog.OnDateSetListener, |
|
|
|
|
val minute = calendar.get(Calendar.MINUTE) |
|
|
|
|
context?.let { |
|
|
|
|
val timePickerDialog = TimePickerDialog(context, this, hour, minute, DateFormat.is24HourFormat(context)) |
|
|
|
|
timePickerDialog.setButton(DialogInterface.BUTTON_NEGATIVE, it.getString(R.string.clear)) { dialog, _ -> |
|
|
|
|
bottomSheetDelegate.clickOnClear(row) |
|
|
|
|
dialog.dismiss() |
|
|
|
|
} |
|
|
|
|
timePickerDialog.show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|