Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ResourceManager @Inject constructor(@ApplicationContext private val context: Context) {
- fun getText(stringRes: Int): CharSequence {
- return context.resources.getText(stringRes)
- }
- fun getString(stringRes: Int): String {
- return context.resources.getString(stringRes)
- }
- fun getQuantityString(stringRes: Int, quantity: Int): String {
- return context.resources.getQuantityString(stringRes, quantity, quantity)
- }
- fun getString(stringRes: Int, vararg textToFormat: Any): String {
- return context.resources.getString(stringRes, *textToFormat)
- }
- fun getColor(color: Int): Int {
- return ContextCompat.getColor(context, color)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement