package es.craftsmanship.toledo.katangapp.utils;

import android.content.res.AssetManager;

import android.graphics.Typeface;

/**
 * @author Manuel de la Peña
 */
public enum KatangaFont {

   QUICKSAND_BOLD, QUICKSAND_LIGHT, QUICKSAND_REGULAR;

    public static Typeface getFont(AssetManager assetManager, KatangaFont font) {
        String fontPath = "fonts/Quicksand-Regular.ttf";

        switch (font) {
            case QUICKSAND_BOLD:
                fontPath = "fonts/Quicksand-Bold.ttf";
                break;
            case QUICKSAND_LIGHT:
                fontPath = "fonts/Quicksand-Light.ttf";
                break;
            case QUICKSAND_REGULAR:
                fontPath = "fonts/Quicksand-Regular.ttf";
        }

        return Typeface.createFromAsset(assetManager, fontPath);
    }

}
@@ -84,17 +84,16 @@
 anager;%0A
-%0A
 import a
@@ -117,16 +117,59 @@
 ypeface;
+%0Aimport android.support.annotation.NonNull;
 %0A%0A/**%0A *
@@ -229,16 +229,17 @@
 t %7B%0A%0A   
+ 
 QUICKSAN
@@ -395,39 +395,173 @@
 h = 
-%22fonts/Quicksand-Regular.ttf%22;%0A
+getFontPath(font);%0A        return Typeface.createFromAsset(assetManager, fontPath);%0A    %7D%0A    %0A    @NonNull%0A    private static String getFontPath(KatangaFont font) %7B
 %0A   
@@ -626,34 +626,30 @@
             
-fontPath =
+return
  %22fonts/Quic
@@ -665,39 +665,16 @@
 d.ttf%22;%0A
-                break;%0A
         
@@ -711,34 +711,30 @@
             
-fontPath =
+return
  %22fonts/Quic
@@ -755,31 +755,8 @@
 f%22;%0A
-                break;%0A
     
@@ -803,22 +803,39 @@
     
-    fontPath =
+default:%0A                return
  %22fo
@@ -875,74 +875,8 @@
    %7D
-%0A%0A        return Typeface.createFromAsset(assetManager, fontPath);
 %0A   

switch with default