public class OakUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
changeFonts(android.view.View root,
android.content.Context ctx,
String typeface)
Given a View, this method sets the Typeface on every TextView contained within that View
|
static android.graphics.Typeface |
getStaticTypeFace(android.content.Context context,
String fontFileName) |
static android.text.SpannableString |
getTypefaceFormattedText(android.content.Context context,
String text,
String typeface)
Returns a formatted String to be used in places like an ActionBar
|
static boolean |
isPackageInstalled(android.content.Context ctx,
String packageName)
Method that determines whether a specified package is installed on the device
|
static boolean |
isValidEmail(String email)
Method to determine whether string is a valid email address
|
static boolean |
isValidPhone(String phone)
Method to determine whether string is a valid phone number
|
public static android.graphics.Typeface getStaticTypeFace(android.content.Context context, String fontFileName)
context
- Context for fetching TypefacefontFileName
- Typeface to fetch. Must match a typeface name in /assets/fontspublic static android.text.SpannableString getTypefaceFormattedText(android.content.Context context, String text, String typeface)
context
- Context for fetching Typefacetext
- text to be formattedtypeface
- typeface to convert the text into.public static void changeFonts(android.view.View root, android.content.Context ctx, String typeface)
root
- View to checkctx
- Context for fetching Typefacetypeface
- Typeface to set. Must match a typeface name in /assets/fontspublic static boolean isPackageInstalled(android.content.Context ctx, String packageName)
ctx
- Context for package managerpackageName
- Target package namepublic static boolean isValidEmail(String email)
email
- email to verifypublic static boolean isValidPhone(String phone)
phone
- phone number to verifyCopyright © 2011–2014. All rights reserved.