-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 #6438 from grzesiek2010/COLLECT-6174
Address review comments for PR 6118, 6169, 6175
- Loading branch information
Showing
14 changed files
with
486 additions
and
461 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
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
29 changes: 29 additions & 0 deletions
29
maps/src/test/java/org/odk/collect/maps/layers/InMemReferenceLayerRepository.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,29 @@ | ||
package org.odk.collect.maps.layers | ||
|
||
import java.io.File | ||
|
||
class InMemReferenceLayerRepository : ReferenceLayerRepository { | ||
val sharedLayers = mutableListOf<ReferenceLayer>() | ||
val projectLayers = mutableListOf<ReferenceLayer>() | ||
|
||
override fun getAll(): List<ReferenceLayer> { | ||
return sharedLayers + projectLayers | ||
} | ||
|
||
override fun get(id: String): ReferenceLayer? { | ||
return sharedLayers.find { it.id == id } ?: projectLayers.find { it.id == id } | ||
} | ||
|
||
override fun addLayer(file: File, shared: Boolean) { | ||
if (shared) { | ||
sharedLayers.add(ReferenceLayer(file.absolutePath, file, file.name)) | ||
} else { | ||
projectLayers.add(ReferenceLayer(file.absolutePath, file, file.name)) | ||
} | ||
} | ||
|
||
override fun delete(id: String) { | ||
sharedLayers.removeIf { it.id == id } | ||
projectLayers.removeIf { it.id == id } | ||
} | ||
} |
Oops, something went wrong.