Package com.cheetahdigital.uikit.helper
Class FontHelper
- java.lang.Object
-
- com.cheetahdigital.uikit.helper.FontHelper
-
public class FontHelper extends java.lang.Object
Helper class for fonts.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DYNAMIC_FONT_SIZE_KEY
-
Constructor Summary
Constructors Constructor Description FontHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
applyDefaultFont(android.app.Activity activity, android.content.res.Configuration appConfig)
Applies the default font from app config.static android.graphics.Typeface
getFontFromResource(android.content.Context context, int resource)
Returns the Typeface from resource.static boolean
isDeviceFontIgnored(android.content.Context context)
Checks if device font is ignored based on shared preferences helper and context.static void
setFontEnabledState(android.content.Context context, boolean state)
Enables the font size to change dynamically.
-
-
-
Field Detail
-
DYNAMIC_FONT_SIZE_KEY
public static final java.lang.String DYNAMIC_FONT_SIZE_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFontFromResource
public static android.graphics.Typeface getFontFromResource(android.content.Context context, int resource)
Returns the Typeface from resource.- Parameters:
context
- used for getting resourcesresource
- resource id to be extracted- Returns:
Typeface
loaded from resource
-
applyDefaultFont
public static void applyDefaultFont(android.app.Activity activity, android.content.res.Configuration appConfig)
Applies the default font from app config.- Parameters:
activity
- ActivityappConfig
- Configuration
-
isDeviceFontIgnored
public static boolean isDeviceFontIgnored(android.content.Context context)
Checks if device font is ignored based on shared preferences helper and context.- Parameters:
context
- context of the application- Returns:
- true if device font is ignored, else false.
-
setFontEnabledState
public static void setFontEnabledState(android.content.Context context, boolean state)
Enables the font size to change dynamically.- Parameters:
context
- context of the applicationstate
- true if font size can change dynamically, else false.
-
-