public final class FoxBaseResourceUtils
extends java.lang.Object
author: Blankj
blog : http://blankj.com
time : 2018/05/07
desc : utils about resource
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
copyFileFromAssets(java.lang.String assetsFilePath,
java.lang.String destFilePath)
Copy the file from assets.
|
static boolean |
copyFileFromRaw(int resId,
java.lang.String destFilePath)
Copy the file from raw.
|
static int |
getAnimIdByName(java.lang.String name)
Return the anim identifier by name.
|
static int |
getColorIdByName(java.lang.String name)
Return the color identifier by name.
|
static int |
getDimenIdByName(java.lang.String name)
Return the dimen identifier by name.
|
static android.graphics.drawable.Drawable |
getDrawable(int id)
Return the drawable by identifier.
|
static int |
getDrawableIdByName(java.lang.String name)
Return the drawable identifier by name.
|
static int |
getIdByName(java.lang.String name)
Return the id identifier by name.
|
static int |
getLayoutIdByName(java.lang.String name)
Return the layout identifier by name.
|
static int |
getMenuIdByName(java.lang.String name)
Return the menu identifier by name.
|
static int |
getMipmapIdByName(java.lang.String name)
Return the mipmap identifier by name.
|
static int |
getStringIdByName(java.lang.String name)
Return the string identifier by name.
|
static int |
getStyleIdByName(java.lang.String name)
Return the style identifier by name.
|
static java.util.List<java.lang.String> |
readAssets2List(java.lang.String assetsPath)
Return the content of file in assets.
|
static java.util.List<java.lang.String> |
readAssets2List(java.lang.String assetsPath,
java.lang.String charsetName)
Return the content of file in assets.
|
static java.lang.String |
readAssets2String(java.lang.String assetsFilePath)
Return the content of assets.
|
static java.lang.String |
readAssets2String(java.lang.String assetsFilePath,
java.lang.String charsetName)
Return the content of assets.
|
static java.util.List<java.lang.String> |
readRaw2List(int resId)
Return the content of resource in raw.
|
static java.util.List<java.lang.String> |
readRaw2List(int resId,
java.lang.String charsetName)
Return the content of resource in raw.
|
static java.lang.String |
readRaw2String(int resId)
Return the content of resource in raw.
|
static java.lang.String |
readRaw2String(int resId,
java.lang.String charsetName)
Return the content of resource in raw.
|
public static android.graphics.drawable.Drawable getDrawable(int id)
id - The identifier.public static int getIdByName(java.lang.String name)
name - The name of id.public static int getStringIdByName(java.lang.String name)
name - The name of string.public static int getColorIdByName(java.lang.String name)
name - The name of color.public static int getDimenIdByName(java.lang.String name)
name - The name of dimen.public static int getDrawableIdByName(java.lang.String name)
name - The name of drawable.public static int getMipmapIdByName(java.lang.String name)
name - The name of mipmap.public static int getLayoutIdByName(java.lang.String name)
name - The name of layout.public static int getStyleIdByName(java.lang.String name)
name - The name of style.public static int getAnimIdByName(java.lang.String name)
name - The name of anim.public static int getMenuIdByName(java.lang.String name)
name - The name of menu.public static boolean copyFileFromAssets(java.lang.String assetsFilePath,
java.lang.String destFilePath)
assetsFilePath - The path of file in assets.destFilePath - The path of destination file.true: successfalse: failpublic static java.lang.String readAssets2String(java.lang.String assetsFilePath)
assetsFilePath - The path of file in assets.public static java.lang.String readAssets2String(java.lang.String assetsFilePath,
java.lang.String charsetName)
assetsFilePath - The path of file in assets.charsetName - The name of charset.public static java.util.List<java.lang.String> readAssets2List(java.lang.String assetsPath)
assetsPath - The path of file in assets.public static java.util.List<java.lang.String> readAssets2List(java.lang.String assetsPath,
java.lang.String charsetName)
assetsPath - The path of file in assets.charsetName - The name of charset.public static boolean copyFileFromRaw(int resId,
java.lang.String destFilePath)
resId - The resource id.destFilePath - The path of destination file.true: successfalse: failpublic static java.lang.String readRaw2String(int resId)
resId - The resource id.public static java.lang.String readRaw2String(int resId,
java.lang.String charsetName)
resId - The resource id.charsetName - The name of charset.public static java.util.List<java.lang.String> readRaw2List(int resId)
resId - The resource id.public static java.util.List<java.lang.String> readRaw2List(int resId,
java.lang.String charsetName)
resId - The resource id.charsetName - The name of charset.