com.here.msdkui.common

## Class ThemeUtil

- java.lang.Object
- - com.here.msdkui.common.ThemeUtil

-     public final class ThemeUtil
      extends java.lang.Object

  A convenience class to access theme attributes.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `getColor(android.content.Context context, int colorAttribute)` Returns a color value specified by the given theme attribute.
    `static android.graphics.drawable.Drawable` | `getDrawable(android.content.Context context, android.content.res.TypedArray typedArray, int index)` Gets a `Drawable` from `TypedArray` and index of attribute.
    `static java.lang.String` | `getString(android.content.res.TypedArray typedArray, int index)` Gets a string from `TypedArray` and index of attribute.
    `static int` | `getStyleId(android.content.Context context, int themeAttribute)` Returns a resource id for the given theme attribute.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getDrawable

          public static android.graphics.drawable.Drawable getDrawable(android.content.Context context,
                                                                       android.content.res.TypedArray typedArray,
                                                                       int index)

      Gets a `Drawable` from `TypedArray` and index of attribute.
      Parameters:
        `context` - the required context.
        `typedArray` - the array of values.
        `index` - the index of the attribute.
      Returns:
        a `Drawable` or null if a raw TypedValue could not be retrieved.
      Throws:
        `java.lang.IllegalArgumentException` - if the attribute at index cannot be resolved.

    - #### getString

          public static java.lang.String getString(android.content.res.TypedArray typedArray,
                                                   int index)

      Gets a string from `TypedArray` and index of attribute.
      Parameters:
        `typedArray` - the array of values.
        `index` - the index of the attribute.
      Returns:
        a string or null if a raw TypedValue could not be retrieved.

    - #### getColor

          public static int getColor(android.content.Context context,
                                     int colorAttribute)

      Returns a color value specified by the given theme attribute.
      Parameters:
        `context` - the required context.
        `colorAttribute` - a theme attribute such as `R.attr.colorBackground`.
      Returns:
        a color. In case of errors `Color.CYAN` is returned.

    - #### getStyleId

          public static int getStyleId(android.content.Context context,
                                       int themeAttribute)

      Returns a resource id for the given theme attribute.
      Parameters:
        `context` - the required context.
        `themeAttribute` - a theme attribute whose value is an arbitrary resource id.
      Returns:
        a resource id.