Skip to content

Commit

Permalink
let collection times time picker dialog follow system setting regardi…
Browse files Browse the repository at this point in the history
…n 12/24 hours format (fixes #2807)
  • Loading branch information
westnordost committed Apr 26, 2021
1 parent a4ef00f commit f564445
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.westnordost.streetcomplete.quests.postbox_collection_times

import android.content.Context
import android.text.format.DateFormat
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
Expand Down Expand Up @@ -140,7 +141,7 @@ class CollectionTimesAdapter(
}

private fun openSetTimeDialog(minutes: Int, callback: (minutes: Int) -> Unit) {
TimePickerDialog(context, minutes / 60, minutes % 60, true) { hourOfDay, minute ->
TimePickerDialog(context, minutes / 60, minutes % 60, DateFormat.is24HourFormat(context)) { hourOfDay, minute ->
callback(hourOfDay * 60 + minute)
}.show()
}
Expand Down

0 comments on commit f564445

Please sign in to comment.