package com.ama.core.architecture.message

import android.app.Application
import androidx.annotation.StringRes


object MessageManager {

    private lateinit var globalMessageController: MessageController

    @JvmStatic
    fun initGlobalMessage(
        application: Application,
        messageController: MessageController,
        messageCollector: MessageCollector,
    ) {
        globalMessageController = messageController
        messageCollector.initGlobalCollect(application, messageController)
    }

    @JvmOverloads
    @JvmStatic
    fun showGlobalMessage(@StringRes message: Int, isShort: Boolean = true) {
        globalMessageController.sendMessage(message, isShort)
    }

    @JvmOverloads
    @JvmStatic
    fun showGlobalMessage(message: String, isShort: Boolean = true) {
        globalMessageController.sendMessage(message, isShort)
    }
}