-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'resurvey-opening_hours-new' into resurvey-new
- Loading branch information
Showing
38 changed files
with
1,668 additions
and
1,037 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/MonthsPickerDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package de.westnordost.streetcomplete.quests.opening_hours | ||
|
||
import android.content.Context | ||
import androidx.appcompat.app.AlertDialog | ||
|
||
import de.westnordost.streetcomplete.R | ||
import de.westnordost.streetcomplete.quests.opening_hours.model.Months | ||
|
||
object MonthsPickerDialog { | ||
|
||
fun show(context: Context, months: Months?, callback: (Months) -> Unit): AlertDialog { | ||
val selection = months?.selection ?: BooleanArray(Months.MONTHS_COUNT) | ||
|
||
return AlertDialog.Builder(context) | ||
.setTitle(R.string.quest_openingHours_chooseMonthsTitle) | ||
.setMultiChoiceItems(Months.getNames(), selection) { _, _, _ -> } | ||
.setNegativeButton(android.R.string.cancel, null) | ||
.setPositiveButton(android.R.string.ok) { _, _ -> callback(Months(selection)) } | ||
.show() | ||
} | ||
|
||
} |
6 changes: 3 additions & 3 deletions
6
app/src/main/java/de/westnordost/streetcomplete/quests/opening_hours/OpeningHoursAnswer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package de.westnordost.streetcomplete.quests.opening_hours | ||
|
||
import de.westnordost.streetcomplete.quests.opening_hours.model.OpeningMonths | ||
import de.westnordost.streetcomplete.quests.opening_hours.model.OpeningHoursRuleList | ||
|
||
sealed class OpeningHoursAnswer | ||
|
||
data class RegularOpeningHours(val times:List<OpeningMonths>) : OpeningHoursAnswer() | ||
data class RegularOpeningHours(val hours: OpeningHoursRuleList) : OpeningHoursAnswer() | ||
object AlwaysOpen : OpeningHoursAnswer() | ||
object NoOpeningHoursSign : OpeningHoursAnswer() | ||
data class DescribeOpeningHours(val text:String) : OpeningHoursAnswer() | ||
object NoOpeningHoursSign : OpeningHoursAnswer() |
Oops, something went wrong.