Closed dmpr0 closed 16 hours ago
Technical Plan:
1) Work with the class TracksViewController. 2) Function setupNavBarMenuButton.
3) To display a toast, use: OAUtilities.showToast(text, details: nil, duration: 4, in: view)
4) Example of implementing a nested menu:
buttonView.isUserInteractionEnabled = true
let interaction = UIContextMenuInteraction(delegate: self)
buttonView.addInteraction(interaction)
extension ViewController: UIContextMenuInteractionDelegate {
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
let configuration = UIContextMenuConfiguration(identifier: nil, previewProvider: nil) { actions -> UIMenu? in
// Creating Save button
let save = UIAction(title: "Save", image: UIImage(systemName: "tray.and.arrow.down.fill")) { action in
// Just showing some alert
// self.showAlert(title: action.title)
}
// Creating Rotate button
let rotate = UIAction(title: "Rotate", image: UIImage(systemName: "arrow.counterclockwise")) { action in
// self.showAlert(title: action.title)
}
// Creating Delete button
let delete = UIAction(title: "Delete", image: UIImage(systemName: "trash.fill")) { action in
// self.showAlert(title: action.title)
}
// Creating Edit, which will open Submenu
let edit = UIMenu(title: "Edit...", children: [rotate, delete])
// Creating main context menu
return UIMenu(title: "Menu", children: [save, edit])
}
return configuration
}
}
Testing:
I spent 8 hours building the project due to issues that arose after adding the Kotlin library.
Description
Add action that will allow to sort all folders and tracks in the present folder.
ToDo
Open folder menu
Context menu available as action on NavBar for open folder.
ic_custom_sort_subfolder
Sort by
Confirmation
Subfolders in “FOLDER NAME” is sorted by: “SORTING ORDER NAME”
, exampleSubfolders in “Summer 2021” is sorted by: “Name A – Z”