Package io.didomi.sdk.resources
Class ResourcesHelper
-
- All Implemented Interfaces:
public final class ResourcesHelperHelper to handle resources used by the SDK given a selected language
-
-
Constructor Summary
Constructors Constructor Description ResourcesHelper(Context context)
-
Method Summary
Modifier and Type Method Description final IntegergetColor(@ColorRes() Integer resourceId)Get Color from resource id final FloatgetDensity()Retrieve the DisplayMetrics density associated with the resources final DrawablegetDrawable(@DrawableRes() Integer resourceId)Get Drawable from resource id final TypefacegetFontTypeFaceByName(String resourceName)Get Font type face by its resource name final StringgetStringResourceByName(String resourceName, String language)Retrieve the string value corresponding to this key with the "didomi_" prefix in the specified language final BooleanisTablet()Check if device is a tablet -
-
Method Detail
-
getColor
@ColorInt() final Integer getColor(@ColorRes() Integer resourceId)
Get Color from resource id
- Parameters:
resourceId- the id as Int
-
getDensity
final Float getDensity()
Retrieve the DisplayMetrics density associated with the resources
-
getDrawable
final Drawable getDrawable(@DrawableRes() Integer resourceId)
Get Drawable from resource id
- Parameters:
resourceId- the id as Int
-
getFontTypeFaceByName
final Typeface getFontTypeFaceByName(String resourceName)
Get Font type face by its resource name
- Parameters:
resourceName- the name of the resource as String
-
getStringResourceByName
final String getStringResourceByName(String resourceName, String language)
Retrieve the string value corresponding to this key with the "didomi_" prefix in the specified language
- Parameters:
resourceName- name of the resource, without the prefix.language- requested language of the translation
-
-
-
-