Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. class ResourceManager @Inject constructor(@ApplicationContext private val context: Context) {
  2.  
  3. fun getText(stringRes: Int): CharSequence {
  4. return context.resources.getText(stringRes)
  5. }
  6.  
  7. fun getString(stringRes: Int): String {
  8. return context.resources.getString(stringRes)
  9. }
  10.  
  11. fun getQuantityString(stringRes: Int, quantity: Int): String {
  12. return context.resources.getQuantityString(stringRes, quantity, quantity)
  13. }
  14.  
  15. fun getString(stringRes: Int, vararg textToFormat: Any): String {
  16. return context.resources.getString(stringRes, *textToFormat)
  17. }
  18.  
  19. fun getColor(color: Int): Int {
  20. return ContextCompat.getColor(context, color)
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement