package com.doverfuelingsolutions.issp.utils

import android.content.Context
import androidx.annotation.StringRes
import com.doverfuelingsolutions.issp.DFSApplication
import java.lang.ref.WeakReference

class StringUtil {

    companion object {

        var ctxBeforeApplication: WeakReference<Context>? = null

        fun get(@StringRes id: Int, vararg params: Any): String = ctx.getString(id, *params)

        private val ctx: Context get() = ctxBeforeApplication?.get() ?: DFSApplication.instance.applicationContext
    }
}