Skip to content

Instantly share code, notes, and snippets.

@gold24park
Created October 7, 2023 09:08
Show Gist options
  • Save gold24park/b122accf9ecb1c9b600f0c8c216404a2 to your computer and use it in GitHub Desktop.
Save gold24park/b122accf9ecb1c9b600f0c8c216404a2 to your computer and use it in GitHub Desktop.
DialogQueue-1
interface DialogQueue {
fun add(element: DialogQueueElement)
enum class Priority {
HIGH,
MEDIUM,
LOW,
}
}
data class DialogQueueElement(
val priority: DialogQueue.Priority,
val tag: String,
val dialogBuilder: (context: Context, dismiss: () -> Unit) -> QueueDialogFragment<*>,
): Comparable<DialogQueueElement> {
override fun compareTo(other: DialogQueueElement): Int {
return priority.compareTo(other.priority)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment