ResourcesProvider

class ResourcesProvider(context: Context, defaultLocale: Locale = LocaleProvider.getLocale(context))

Provides access to resources in an easier way.

Parameters

context

Android context.

defaultLocale

Locale which will be used as a default locale to retrieve resources.

Constructors

Link copied to clipboard
fun ResourcesProvider(context: Context, defaultLocale: Locale = LocaleProvider.getLocale(context))

Functions

Link copied to clipboard
fun getFormattedString(@StringRes formatResId: Int, vararg args: Any?, locale: Locale? = null): String

Returns a localized string obtained by substituting the specified arguments.

Link copied to clipboard
fun getPluralString(resId: Int, quantity: Int, locale: Locale? = null): String

Returns a localized string for plurals retrieved by its ID.

Link copied to clipboard
fun getString(@StringRes resId: Int, locale: Locale? = null): String

Returns a localized string retrieved by its ID.