Skip to content

Commit

Permalink
Export path groups from the list item menu
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Sep 9, 2023
1 parent 46cbdef commit 3d3c7f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kylecorry.trail_sense.navigation.paths.ui

enum class PathGroupAction {
Export,
Delete,
Rename,
Open,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class PathGroupListItemMapper(
PathGroupAction.Rename
)
},
ListMenuItem(context.getString(R.string.export)) {
actionHandler(
value,
PathGroupAction.Export
)
},
ListMenuItem(context.getString(R.string.delete)) {
actionHandler(
value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ class PathsFragment : BoundFragment<FragmentPathsBinding>() {
PathGroupAction.Rename -> renameGroup(group)
PathGroupAction.Open -> manager.open(group.id)
PathGroupAction.Move -> movePath(group)
PathGroupAction.Export -> exportPath(group)
}
}

Expand Down Expand Up @@ -296,7 +297,7 @@ class PathsFragment : BoundFragment<FragmentPathsBinding>() {
command.execute(manager.root?.id)
}

private fun exportPath(path: Path) {
private fun exportPath(path: IPath) {
val command = ExportPathCommand(requireContext(), this, gpxService, pathService)
command.execute(path)
}
Expand Down

0 comments on commit 3d3c7f4

Please sign in to comment.