public class Utils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Utils.List
The type List.
|
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static float |
convertDpToPixel(float dp)
Convert dp to pixel float.
|
static java.util.Currency |
getCurrency(java.lang.String currencyCode)
Gets currency.
|
static java.lang.String |
getCurrencyName(java.lang.String currencyCode,
java.util.Currency currency)
Gets currency name.
|
static java.lang.String |
getFormattedCurrency(AmountedCurrency amountedCurrency)
Get formatted currency string.
|
private static java.lang.String |
getOptionallyHardcodedSymbol(java.lang.String symbol) |
static android.util.DisplayMetrics |
getWindowDisplayMetrics()
Get window display metrics display metrics.
|
static void |
hideKeyboard(android.app.Activity activity)
Hide keyboard.
|
static void |
hideKeyboardFrom(android.content.Context context,
android.view.View view)
Hide keyboard from.
|
static void |
highlightPhoneNumber(android.content.Context context,
android.text.SpannableStringBuilder sb,
int startIndex,
java.lang.String textToHighlight)
Highlight phone number.
|
static void |
highlightText(android.content.Context context,
android.text.SpannableStringBuilder sb,
int index)
Highlight text.
|
static void |
highlightText(android.content.Context context,
android.text.SpannableStringBuilder sb,
int index,
java.lang.String textToHighlight)
Highlight text.
|
static android.graphics.drawable.Drawable |
setImageTint(android.content.Context context,
int drawableId,
int colorId)
Sets image tint.
|
static void |
showKeyboard(android.content.Context context,
android.view.View focusableView)
Show keyboard.
|
public static float convertDpToPixel(float dp)
dp
- the dppublic static android.graphics.drawable.Drawable setImageTint(android.content.Context context, int drawableId, int colorId)
context
- the contextdrawableId
- the drawable idcolorId
- the color idpublic static void showKeyboard(android.content.Context context, android.view.View focusableView)
context
- the contextfocusableView
- the focusable viewpublic static void hideKeyboard(android.app.Activity activity)
activity
- the activitypublic static void hideKeyboardFrom(android.content.Context context, android.view.View view)
context
- the contextview
- the viewpublic static java.lang.String getFormattedCurrency(AmountedCurrency amountedCurrency)
amountedCurrency
- the amounted currencyprivate static java.lang.String getOptionallyHardcodedSymbol(java.lang.String symbol)
public static java.util.Currency getCurrency(java.lang.String currencyCode)
currencyCode
- the currency codepublic static java.lang.String getCurrencyName(java.lang.String currencyCode, java.util.Currency currency)
currencyCode
- the currency codecurrency
- the currencypublic static void highlightText(android.content.Context context, android.text.SpannableStringBuilder sb, int index, java.lang.String textToHighlight)
context
- the contextsb
- the sbindex
- the indextextToHighlight
- the text to highlightpublic static void highlightText(android.content.Context context, android.text.SpannableStringBuilder sb, int index)
context
- the contextsb
- the sbindex
- the indexpublic static void highlightPhoneNumber(android.content.Context context, android.text.SpannableStringBuilder sb, int startIndex, java.lang.String textToHighlight)
context
- the contextsb
- the sbstartIndex
- the start indextextToHighlight
- the text to highlightpublic static android.util.DisplayMetrics getWindowDisplayMetrics()