diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2019-03-07 12:20:46 +0100 |
---|---|---|
committer | Łukasz Paczos <lukas.paczos@gmail.com> | 2019-03-07 12:20:46 +0100 |
commit | 666777fdcf80cf919dc7e8e681c9dcb5f5df2778 (patch) | |
tree | 58d0312171351839d7f50e443032121f6cd9e4eb /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java | |
parent | fa4fa5d9fe41874d463ba8df29db61ba4bc1b89e (diff) | |
download | qtlocation-mapboxgl-upstream/lp-set-vector-drawables-programatically.tar.gz |
[android] get vector drawables using AppCompatResources and set vector drawables programmaticallyupstream/lp-set-vector-drawables-programatically
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java index ae664dfe3f..9f0fa62cdd 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/IconFactory.java @@ -9,13 +9,13 @@ import android.graphics.drawable.Drawable; import android.os.Build; import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; -import android.support.v4.content.ContextCompat; import android.util.DisplayMetrics; import android.view.WindowManager; import com.mapbox.mapboxsdk.MapStrictMode; import com.mapbox.mapboxsdk.R; import com.mapbox.mapboxsdk.exceptions.TooManyIconsException; +import com.mapbox.mapboxsdk.utils.BitmapUtils; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -30,7 +30,7 @@ import java.io.InputStream; * * @deprecated As of 7.0.0, * use <a href="https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-annotation"> - * Mapbox Annotation Plugin</a> instead + * Mapbox Annotation Plugin</a> instead */ @Deprecated public final class IconFactory { @@ -100,7 +100,7 @@ public final class IconFactory { * @return The icon that was loaded from the asset or {@code null} if failed to load. */ public Icon fromResource(@DrawableRes int resourceId) { - Drawable drawable = ContextCompat.getDrawable(context, resourceId); + Drawable drawable = BitmapUtils.getDrawableFromRes(context, resourceId); if (drawable instanceof BitmapDrawable) { BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; return fromBitmap(bitmapDrawable.getBitmap()); |