@@ -35,7 +35,7 @@ typealias QueueSwipeCallback = (IndexPath, _ completionHandler: @escaping (_ pla
35
35
36
36
extension BasicTableViewController {
37
37
func createInsertNextQueueSwipeAction( indexPath: IndexPath , actionCallback: @escaping QueueSwipeCallback ) -> UIContextualAction {
38
- let action = UIContextualAction ( style: . normal, title: " Insert into Next in Main Queue " ) { ( action, view, completionHandler) in
38
+ let action = UIContextualAction ( style: . normal, title: " Play Next" ) { ( action, view, completionHandler) in
39
39
let generator = UINotificationFeedbackGenerator ( )
40
40
generator. notificationOccurred ( . success)
41
41
actionCallback ( indexPath) { playables in
@@ -44,49 +44,21 @@ extension BasicTableViewController {
44
44
completionHandler ( true )
45
45
}
46
46
action. backgroundColor = . systemBlue
47
- action. image = UIImage ( named: " main_insert " ) ? . invertedImage ( )
48
- return action
49
- }
50
-
51
- func createInsertWaitingQueueSwipeAction( indexPath: IndexPath , actionCallback: @escaping QueueSwipeCallback ) -> UIContextualAction {
52
- let action = UIContextualAction ( style: . normal, title: " Insert into Next in Waiting Queue " ) { ( action, view, completionHandler) in
53
- let generator = UIImpactFeedbackGenerator ( style: . light)
54
- generator. impactOccurred ( )
55
- actionCallback ( indexPath) { playables in
56
- self . appDelegate. player. insertFirstToWaitingQueue ( playables: playables. filterCached ( dependigOn: self . appDelegate. persistentStorage. settings. isOfflineMode) )
57
- }
58
- completionHandler ( true )
59
- }
60
- action. backgroundColor = . systemOrange
61
- action. image = UIImage ( named: " waiting_insert " ) ? . invertedImage ( )
47
+ action. image = UIImage ( named: " context_queue_insert " ) ? . invertedImage ( )
62
48
return action
63
49
}
64
50
65
51
func createAppendNextQueueSwipeAction( indexPath: IndexPath , actionCallback: @escaping QueueSwipeCallback ) -> UIContextualAction {
66
- let action = UIContextualAction ( style: . normal, title: " Append to Next in Main Queue " ) { ( action, view, completionHandler) in
52
+ let action = UIContextualAction ( style: . normal, title: " Play Later " ) { ( action, view, completionHandler) in
67
53
let generator = UINotificationFeedbackGenerator ( )
68
54
generator. notificationOccurred ( . success)
69
55
actionCallback ( indexPath) { playables in
70
56
self . appDelegate. player. appendToNextInMainQueue ( playables: playables. filterCached ( dependigOn: self . appDelegate. persistentStorage. settings. isOfflineMode) )
71
57
}
72
58
completionHandler ( true )
73
59
}
74
- action. backgroundColor = . systemBlue
75
- action. image = UIImage ( named: " main_append " ) ? . invertedImage ( )
76
- return action
77
- }
78
-
79
- func createAppendWaitingQueueSwipeAction( indexPath: IndexPath , actionCallback: @escaping QueueSwipeCallback ) -> UIContextualAction {
80
- let action = UIContextualAction ( style: . normal, title: " Append to Next in Waiting Queue " ) { ( action, view, completionHandler) in
81
- let generator = UIImpactFeedbackGenerator ( style: . light)
82
- generator. impactOccurred ( )
83
- actionCallback ( indexPath) { playables in
84
- self . appDelegate. player. appendToWaitingQueue ( playables: playables. filterCached ( dependigOn: self . appDelegate. persistentStorage. settings. isOfflineMode) )
85
- }
86
- completionHandler ( true )
87
- }
88
60
action. backgroundColor = . systemOrange
89
- action. image = UIImage ( named: " waiting_append " ) ? . invertedImage ( )
61
+ action. image = UIImage ( named: " context_queue_append " ) ? . invertedImage ( )
90
62
return action
91
63
}
92
64
}
@@ -120,18 +92,11 @@ class BasicTableViewController: UITableViewController {
120
92
updateSearchResults ( for: searchController)
121
93
}
122
94
123
- override func tableView( _ tableView: UITableView , leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath ) -> UISwipeActionsConfiguration ? {
124
- guard let swipeCB = swipeCallback else { return nil }
125
- return UISwipeActionsConfiguration ( actions: [
126
- createInsertNextQueueSwipeAction ( indexPath: indexPath, actionCallback: swipeCB) ,
127
- createInsertWaitingQueueSwipeAction ( indexPath: indexPath, actionCallback: swipeCB)
128
- ] )
129
- }
130
95
override func tableView( _ tableView: UITableView , trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath ) -> UISwipeActionsConfiguration ? {
131
96
guard let swipeCB = swipeCallback else { return nil }
132
97
return UISwipeActionsConfiguration ( actions: [
133
- createAppendNextQueueSwipeAction ( indexPath: indexPath, actionCallback: swipeCB) ,
134
- createAppendWaitingQueueSwipeAction ( indexPath: indexPath, actionCallback: swipeCB)
98
+ createInsertNextQueueSwipeAction ( indexPath: indexPath, actionCallback: swipeCB) ,
99
+ createAppendNextQueueSwipeAction ( indexPath: indexPath, actionCallback: swipeCB)
135
100
] )
136
101
}
137
102
0 commit comments