public class Utils
extends java.lang.Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compareFloat(float a,
float b)
Compare the size of two floating point numbers
|
static int |
compareFloat(float a,
float b,
int degree)
Compare the size of two floating point numbers with accuracy
|
static int |
dp2px(android.content.Context context,
float dpValue) |
static android.graphics.Bitmap |
drawableToBitmap(android.content.Context context,
int width,
int height,
int drawableId) |
static android.graphics.Bitmap |
drawableToBitmap(int width,
int height,
android.graphics.drawable.Drawable drawable)
make a drawable to a bitmap
|
static void |
drawBitmap(android.graphics.Canvas canvas,
android.graphics.Paint paint,
android.graphics.Bitmap bmp,
android.graphics.Rect rect) |
static void |
drawNinePath(android.graphics.Canvas canvas,
android.graphics.Bitmap bmp,
android.graphics.Rect rect)
draw 9Path
|
static int |
getColor(android.content.Context context,
int colorId) |
static android.graphics.Rect |
measureText(java.lang.String text,
float textSize) |
static float |
parseFloat(java.lang.String s) |
static void |
print(java.lang.Object... logs) |
static void |
print(java.lang.String log) |
static boolean |
verifyBitmap(android.graphics.Bitmap bitmap) |
public static void print(java.lang.String log)
public static void print(java.lang.Object... logs)
public static android.graphics.Bitmap drawableToBitmap(android.content.Context context,
int width,
int height,
int drawableId)
public static android.graphics.Bitmap drawableToBitmap(int width,
int height,
android.graphics.drawable.Drawable drawable)
drawable - drawable you want convertpublic static void drawNinePath(android.graphics.Canvas canvas,
android.graphics.Bitmap bmp,
android.graphics.Rect rect)
canvas - Canvasbmp - 9path bitmaprect - 9path rectpublic static void drawBitmap(android.graphics.Canvas canvas,
android.graphics.Paint paint,
android.graphics.Bitmap bmp,
android.graphics.Rect rect)
public static int dp2px(android.content.Context context,
float dpValue)
public static int compareFloat(float a,
float b)
a - b - public static int compareFloat(float a,
float b,
int degree)
a - b - public static float parseFloat(java.lang.String s)
public static android.graphics.Rect measureText(java.lang.String text,
float textSize)
public static boolean verifyBitmap(android.graphics.Bitmap bitmap)
public static int getColor(android.content.Context context,
int colorId)