-
-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5359 from jmizv/master
Disable restoring hidden quests when there are none to unhide.
- Loading branch information
Showing
21 changed files
with
1,191 additions
and
102 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
16 changes: 16 additions & 0 deletions
16
...c/main/java/de/westnordost/streetcomplete/data/osm/osmquests/OsmQuestsHiddenController.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,16 @@ | ||
package de.westnordost.streetcomplete.data.osm.osmquests | ||
|
||
import de.westnordost.streetcomplete.data.quest.OsmQuestKey | ||
|
||
/** Controller for managing which osm quests have been hidden by user interaction */ | ||
interface OsmQuestsHiddenController : OsmQuestsHiddenSource, HideOsmQuestController { | ||
|
||
/** Mark the quest as hidden by user interaction */ | ||
override fun hide(key: OsmQuestKey) | ||
|
||
/** Un-hide the given quest. Returns whether it was hid before */ | ||
fun unhide(key: OsmQuestKey): Boolean | ||
|
||
/** Un-hides all previously hidden quests by user interaction */ | ||
fun unhideAll(): Int | ||
} |
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
25 changes: 25 additions & 0 deletions
25
app/src/main/java/de/westnordost/streetcomplete/data/osm/osmquests/OsmQuestsHiddenSource.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,25 @@ | ||
package de.westnordost.streetcomplete.data.osm.osmquests | ||
|
||
import de.westnordost.streetcomplete.data.quest.OsmQuestKey | ||
|
||
interface OsmQuestsHiddenSource { | ||
|
||
interface Listener { | ||
fun onHid(edit: OsmQuestHidden) | ||
fun onUnhid(edit: OsmQuestHidden) | ||
fun onUnhidAll() | ||
} | ||
|
||
/** Get information about an osm quest hidden by the user or null if it does not exist / has not | ||
* been hidden */ | ||
fun getHidden(key: OsmQuestKey): OsmQuestHidden? | ||
|
||
/** Get information about all osm quests hidden by the user after the given [timestamp] */ | ||
fun getAllHiddenNewerThan(timestamp: Long): List<OsmQuestHidden> | ||
|
||
/** Get number of osm quests hidden by the user */ | ||
fun countAll(): Long | ||
|
||
fun addListener(listener: Listener) | ||
fun removeListener(listener: Listener) | ||
} |
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
14 changes: 14 additions & 0 deletions
14
...a/de/westnordost/streetcomplete/data/osmnotes/notequests/OsmNoteQuestsHiddenController.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,14 @@ | ||
package de.westnordost.streetcomplete.data.osmnotes.notequests | ||
|
||
/** Controller for managing which osm note quests have been hidden by user interaction */ | ||
interface OsmNoteQuestsHiddenController : OsmNoteQuestsHiddenSource { | ||
|
||
/** Mark the note quest as hidden by user interaction */ | ||
fun hide(questId: Long) | ||
|
||
/** Un-hides a specific hidden quest by user interaction */ | ||
fun unhide(questId: Long): Boolean | ||
|
||
/** Un-hides all previously hidden quests by user interaction */ | ||
fun unhideAll(): Int | ||
} |
Oops, something went wrong.