Search in sources :

Example 1 with IconFactory

use of com.mapbox.mapboxsdk.annotations.IconFactory in project mapbox-navigation-android by mapbox.

the class ThemeSwitcher method retrieveMapMarker.

/**
 * Returns a map marker {@link Icon} based on the current theme setting.
 *
 * @param context to retrieve {@link SharedPreferences} and an instance of {@link IconFactory}
 * @return {@link Icon} map marker dark or light
 */
static Icon retrieveMapMarker(Context context) {
    TypedValue destinationMarkerResId = obtainTypedValue(context, R.attr.navigationViewDestinationMarker);
    int markerResId = destinationMarkerResId.resourceId;
    IconFactory iconFactory = IconFactory.getInstance(context);
    return iconFactory.fromResource(markerResId);
}
Also used : TypedValue(android.util.TypedValue) IconFactory(com.mapbox.mapboxsdk.annotations.IconFactory)

Aggregations

TypedValue (android.util.TypedValue)1 IconFactory (com.mapbox.mapboxsdk.annotations.IconFactory)1