mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-03-25 07:50:30 +01:00
refactor
This commit is contained in:
parent
52ef736ec2
commit
e5500526e1
@ -268,7 +268,7 @@ fun Context.formatTo12HourFormat(showSeconds: Boolean, hours: Int, minutes: Int,
|
|||||||
return "${formatTime(showSeconds, false, newHours, minutes, seconds)} $appendable"
|
return "${formatTime(showSeconds, false, newHours, minutes, seconds)} $appendable"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.getClosestEnabledAlarmString(callback: (String) -> Unit) {
|
fun Context.getClosestEnabledAlarmString(callback: (result: String) -> Unit) {
|
||||||
getEnabledAlarms { enabledAlarms ->
|
getEnabledAlarms { enabledAlarms ->
|
||||||
if (enabledAlarms == null) {
|
if (enabledAlarms == null) {
|
||||||
callback("")
|
callback("")
|
||||||
@ -308,7 +308,7 @@ fun Context.getClosestEnabledAlarmString(callback: (String) -> Unit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.getEnabledAlarms(callback: (List<Alarm>?) -> Unit) {
|
fun Context.getEnabledAlarms(callback: (result: List<Alarm>?) -> Unit) {
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
val alarms = dbHelper.getEnabledAlarms()
|
val alarms = dbHelper.getEnabledAlarms()
|
||||||
Handler(Looper.getMainLooper()).post {
|
Handler(Looper.getMainLooper()).post {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user