diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FontCache.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FontCache.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FontCache.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FontCache.java index 3d885dba18..e2271bd5ff 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FontCache.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/FontCache.java @@ -2,24 +2,25 @@ package com.mapbox.mapboxsdk.testapp.utils; import android.content.Context; import android.graphics.Typeface; + import timber.log.Timber; import java.util.Hashtable; public class FontCache { - private static Hashtable<String, Typeface> fontCache = new Hashtable<>(); + private static Hashtable<String, Typeface> fontCache = new Hashtable<>(); - public static Typeface get(String name, Context context) { - Typeface tf = fontCache.get(name); - if (tf == null) { - try { - tf = Typeface.createFromAsset(context.getAssets(), name); - fontCache.put(name, tf); - } catch (Exception exception) { - Timber.e("Font not found"); - } - } - return tf; + public static Typeface get(String name, Context context) { + Typeface tf = fontCache.get(name); + if (tf == null) { + try { + tf = Typeface.createFromAsset(context.getAssets(), name); + fontCache.put(name, tf); + } catch (Exception exception) { + Timber.e("Font not found"); + } } + return tf; + } }
\ No newline at end of file |